Installing Cmake in AiiDAlab container

Dear Community,

I am interested to install critic2 (GitHub - aoterodelaroza/critic2: Analysis of quantum chemical interactions in molecules and solids.) on the aiidalab container (arm64) , for this I need Cmake.
My idea is to have this code in aiidalab as localhost to be used by aiidalab_qe.

How can I install the appropriate Cmake, I was wondering if this should be done by changing the image

or

Should i just access the docker as a root-user and do it via sudo apt-get ?

best

Andres

Let’s just put it in the docker stack. I think in lab image @danielhollas ? I had a discussion with @AndresOrtegaGuerrero and we agree that for such generic tools we can bring it to the aiidalab-docker-stack. Any objection @danielhollas?

We need to compare the size increase of using apt and using conda and choose the light one.

No issue in general, but I will just note that if this package is not available on PyPI or conda, it cannot be automatically installed when aiidalab-qe is installed from the app store. And making users compile it themselves is very unfriendly. So I’d say that if the final goal is to integrate this into QeApp, it probably needs to be build as part of the QeApp image. And if that is the case, perhaps it is ultimatelly better to help the original maintainer and make it a conda-forge package, since otherwise it will slow down the image build.

tl;dr @AndresOrtegaGuerrero maybe before we start integrating it into the image, you can just explore it and install cmake via apt-get as root. (note that you’ll need to repeat this if you start a new container)

Does that make sense?

Actually, you don’t even need to be root. You can simply create a new conda environment and install cmake into it. New conda environments are created in ~/.conda, so they will be persisted in the attached volume even when you stop and delete the container.

So something like this should work

conda create -n build-tools cmake
conda activate build-tools

I think this is a more reasonable long-term strategy, rather then putting everything in the image. WDYT? The only things that really need to be in the image are those not available in conda-forge, or those that are needed during App installation for some reason (like compilers for pypi packages without wheels)

Yes, I am able to install like this, I wanted to have cmake and gfortran included since I am developing an external plugin for qe app that requires cmake and gfortran. But I will manage with conda forge.

Thank you!

1 Like

I remember @AndresOrtegaGuerrero mentioned he can make the package able to be compile within pip. What he need were cmake and gfortran. This can make it possible to avoid the specific compile from app user.

If you are planning to make a pypi package, you can publish a wheel so that there’s no compilation step during installation, right?