CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
65 stars 66 forks source link

calling python 2.7 while make build #458

Closed ryohiguchi closed 7 months ago

ryohiguchi commented 7 months ago

Dear developers,

I have problems installing CRPropa on my system System Information:

I installed version 3.2 from git.

I read and followed the installation instructions at https://crpropa.github.io/CRPropa3/ . Before writing this request I also checked previous installation issues at https://github.com/CRPropa/CRPropa3/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Ainstallation+ . However, this did not work. I receive the following output:

(crpropa) bash-4.2$ CMAKE_PREFIX_PATH=$CRPROPA_DIR cmake - DCMAKE_INSTALL_PREFIX=$CRPROPA_DIR .. CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- The Fortran compiler identification is GNU 4.8.5 -- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Check for working Fortran compiler: /usr/bin/f95 - skipped -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Use --as-needed linker flags! With SIMD_EXTENSIONS "none" tricubic interpolation of vector grids is not possible. You should set SIMD_EXTENSION to a compatible value ("avx", "avx+fma", or -- depending on the build CPU -- "native"). Trilinear interpolation is still possible. -- Build Type: Release -- CRPropa version: 3.2-no-git
CMake Deprecation Warning at libs/gtest/CMakeLists.txt:20 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
CMake Deprecation Warning at libs/kiss/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell

CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at libs/HepPID/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at libs/sophia/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at libs/dint/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at libs/EleCa/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

Using provided EIGEN CMake Deprecation Warning at libs/healpix_base/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Found OpenMP_C: -fopenmp (found version "3.1") -- Found OpenMP_CXX: -fopenmp (found version "3.1") -- Found OpenMP_Fortran: -fopenmp (found version "3.1") -- Found OpenMP: TRUE (found version "3.1")
-- Google perftools: NOT Found! -- Include: GOOGLE_PERFTOOLS_INCLUDE_DIR-NOTFOUND -- FFTW3 with single precision (FFTW3F): Found! -- Include: /usr/include -- Library: /usr/lib64/libfftw3f.so -- Quimby: NOT Found! -- Include: QUIMBY_INCLUDE_DIR-NOTFOUND -- Library: QUIMBY_LIBRARY-NOTFOUND -- SAGA: NOT Found! -- Include: SAGA_INCLUDE_DIR-NOTFOUND -- Library: SAGA_LIBRARY-NOTFOUND -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- muParser: NOT Found! -- Include: MUPARSER_INCLUDE_DIR-NOTFOUND -- Library: MUPARSER_LIBRARY-NOTFOUND -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS C) (found version "") -- Use absolute RPATH /home/rhiguchi/.virtualenvs/crpropa/lib -- Downloading data file from crpropa.desy.de ~ 65 MB -- Extracting data file Error copying directory from "/home/rhiguchi/.virtualenvs/crpropa/CRPropa3-3.2/build/data-2022-07- 06/data" to "/home/rhiguchi/.virtualenvs/crpropa/CRPropa3-3.2/build/data/". -- Build of documentation disabeled. Enable with BUILD_DOC=On CMake Warning (dev) at CMakeLists.txt:474 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonInterp: /home/rhiguchi/.virtualenvs/crpropa/bin/python (found version "2.7.5") CMake Warning (dev) at CMakeLists.txt:475 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonLibs: /usr/lib64/libpython2.7.so (found version "2.7.5") CMake Error at /home/rhiguchi/.pyenv/versions/3.7.17/lib/python3.7/site-packages/cmake/data/share/cmake- 3.27/Modules/FindSWIG.cmake:102 (message): Command "/home/rhiguchi/.virtualenvs/crpropa/bin/swig -swiglib" failed with output:

Traceback (most recent call last):

 File "/home/rhiguchi/.virtualenvs/crpropa/bin/swig", line 7, in <module>
   from swig import swig

ImportError: No module named swig

Call Stack (most recent call first): CMakeLists.txt:479 (find_package)

CMake Error at /home/rhiguchi/.pyenv/versions/3.7.17/lib/python3.7/site-packages/cmake/data/share/cmake- 3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find SWIG (missing: SWIG_DIR) (Required is at least version "3.0") Call Stack (most recent call first): /home/rhiguchi/.pyenv/versions/3.7.17/lib/python3.7/site-packages/cmake/data/share/cmake- 3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) /home/rhiguchi/.pyenv/versions/3.7.17/lib/python3.7/site-packages/cmake/data/share/cmake- 3.27/Modules/FindSWIG.cmake:153 (find_package_handle_standard_args) CMakeLists.txt:479 (find_package)

-- Configuring incomplete, errors occurred!

I think there's something wrong that there's libpython2.7 in the output. Thank you for your help!

rafaelab commented 7 months ago

Dear @ryohiguchi ,

As you say, the problem is a conflicting version of Python that is exposed to your system. You should make sure that you are using the same version of python for everything that is relevant: library, headers, and executable. You can either make sure your system has the correct python libraries exposed or simply add the following lines when running cmake:

cmake .. <your options> -DPYTHON_INCLUDE_DIR=/path/to/folder/containing/Python.h -DPYTHON_LIBRARY=/path/to/libpythonXX.so

So you have to find in your system the directory where the file Python.h is located (corresponding to the python version you are using, python3.7) and the file libpython3.7.so (or .dylib for OSX). Don't forget to clean up the build folder before! Previous cmake installation might mess things up. By doing this you'll manually provide the python location to CRPropa.

Since this is not really a CRPropa-related problem, I will close this issue. For more information check out cmake flags that could be useful for manually specifying the Python version here and here.