rosalindfranklininstitute/python-multem

Installation fails with "Unix Makefiles ...does not match generator ... Ninja"

Closed this issue · 1 comments

[Ubuntu Linux 18.04 LTS 64-bit; python 3.6.9; CUDA 10.2 installed from NVidia debs at /usr/local/cuda]
Steps followed to install:

git clone https://github.com/rosalindfranklininstitute/python-multem.git  
cd python-multem/  
git clone https://github.com/pybind/pybind11.git
git clone https://github.com/rosalindfranklininstitute/MULTEM.git  
pip3 install -r requirements.txt  

Installing collected packages: wheel, six, pyparsing, packaging, distro, setuptools, scikit-build, cmake, ninja
Successfully installed cmake-3.18.2 distro-1.5.0 ninja-1.10.0.post1 packaging-20.4 pyparsing-2.4.7 scikit-build-0.11.1 setuptools-49.6.0 six-1.15.0 wheel-0.35.1

python3 setup.py install

CMake Error at CMakeLists.txt:4 (project):
No ``` CMAKE_CUDA_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

Solved by:

cd _skbuild/linux-x86_64-3.6/cmake-build/  
nano CMakeCache.txt  

CUDA compiler line edited: CMAKE_CUDA_COMPILER:FILEPATH=/usr/local/cuda/bin/nvcc ; file saved; exit from nano.

cd ../../../  
python3 setup.py install  

At this point I have multiple errors on consequent runs of setup script:

CMake Error in CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "multem_ext".
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

And:

Trying "Unix Makefiles" generator - success

Configuring Project
Working directory:
/home/divakar/dev/python-multem/_skbuild/linux-x86_64-3.6/cmake-build
Command:
cmake /home/divakar/dev/python-multem -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/home/divakar/dev/python-multem/_skbuild/linux-x86_64-3.6/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.6.9 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.6m -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.6m.so -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/divakar/.local/lib/python3.6/site-packages/skbuild/resources/cmake -DCMAKE_BUILD_TYPE:STRING=Release

CMake Error: Error: generator : Unix Makefiles
Does not match the generator used previously: Ninja
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Traceback (most recent call last):
File "/home/divakar/.local/lib/python3.6/site-packages/skbuild/setuptools_wrap.py", line 586, in setup
languages=cmake_languages
File "/home/divakar/.local/lib/python3.6/site-packages/skbuild/cmaker.py", line 240, in configure
os.path.abspath(CMAKE_BUILD_DIR())))

How do I solve this? Also, what should the CUDAXX environment variable point to? /usr/local/cuda?

Hi.

I've had a look at the error and I think that cmake has changed the behaviour of the CUDA_ARCHITECTURE flag. I've fixed this in the CMakeLists.txt file so you should be able to install as follows:

python3 -m venv testenv
source testenv/bin/activate

git clone https://github.com/rosalindfranklininstitute/python-multem.git  
pushd python-multem/  
git clone https://github.com/pybind/pybind11.git
git clone https://github.com/rosalindfranklininstitute/MULTEM.git  
git checkout gpu_ice_contribution
pushd MULTEM
git checkout local_required_changes
popd

python -m pip install -r requirements.txt 
python setup.py install -- -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc

So this is alpha software and currently not very user friendly. In particular, you need to check out a couple of branches to get it to work (see instructions above). I am a bit busy with other things at the moment but I am hoping to tidy things up a bit and make it more user friendly soon!