GalacticDynamics-Oxford / Agama

Action-based galaxy modeling framework
Other
72 stars 35 forks source link

compilation fails on CentOS #42

Closed vedantchandra closed 3 months ago

vedantchandra commented 3 months ago

Hi Eugene,

I'm installing agama on our computing cluster, which runs CentOS. The Python installation is via conda. I cloned the GitHub repository and ran the setup.py as instructed, after loading the GSL module. However, the compilation eventually throws this error and crashes: make: *** No rule to make target 'extras/include/Eigen/src/SparseCore/Spar', needed by 'obj/math_linalg.o'. Stop. error: Compilation failed

Have you seen this before? Apologies if I'm doing something wrong, I have minimal experience with C. The full trace is below:

python setup.py install --user
running install
running bdist_egg
running egg_info
writing agama.egg-info/PKG-INFO
writing dependency_links to agama.egg-info/dependency_links.txt
writing top-level names to agama.egg-info/top_level.txt
reading manifest file 'agama.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'agama.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Makefile.local already exists, should we use it (Y) or generate a new one (N)? N

    ==== Checking supported compiler options and available libraries ====

c++ -fPIC -Wall -O2 test.cpp -o test.out 
c++ -fPIC -Wall -O2 test.cpp -o test.out -fopenmp -Werror -Wno-unknown-pragmas
c++ -fPIC -Wall -O2 -fopenmp test.cpp -o test.out -std=c++11
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 test.cpp -o test.out -march=native
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native test.cpp -o test.out -qno-opt-dynamic-align
c++: error: unrecognized command line option ‘-qno-opt-dynamic-align’
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native test.cpp -o test.out -Werror -Wno-missing-field-initializers
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers test.cpp -o test.out -Werror -Wno-cast-function-type
    **** Trying the following options for linking against Python library ****
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -shared -fPIC /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.exe ./agamatest.so
/usr/bin/ld: warning: libpython3.8.so.1.0, needed by ./agamatest.so, not found (try using -rpath or -rpath-link)
./agamatest.so: undefined reference to `PyObject_GetAttrString'
./agamatest.so: undefined reference to `PyCapsule_Type'
./agamatest.so: undefined reference to `PyRun_SimpleStringFlags'
./agamatest.so: undefined reference to `PyExc_AttributeError'
./agamatest.so: undefined reference to `PyErr_Format'
./agamatest.so: undefined reference to `Py_Finalize'
./agamatest.so: undefined reference to `_Py_Dealloc'
./agamatest.so: undefined reference to `PyImport_ImportModule'
./agamatest.so: undefined reference to `PyErr_SetString'
./agamatest.so: undefined reference to `PyCapsule_GetPointer'
./agamatest.so: undefined reference to `PyExc_RuntimeError'
./agamatest.so: undefined reference to `PyModule_Create2'
./agamatest.so: undefined reference to `PyExc_ImportError'
./agamatest.so: undefined reference to `Py_Initialize'
./agamatest.so: undefined reference to `PyErr_Print'
collect2: error: ld returned 1 exit status
Trying rpath
    **** Trying the following options for linking against Python library ****
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -shared -fPIC /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm -Wl,-rpath,/n/home03/vchandra/.conda/envs/outerhalo/lib
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.exe ./agamatest.so
    **** Successfully linked using these options ****
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -Lextras/lib /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm -Wl,-rpath,/n/home03/vchandra/.conda/envs/outerhalo/lib -lgsl -lgslcblas -fPIC -shared
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.exe ./agamatest.so
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o test.out -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include"
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o test.out -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -Lextras/lib /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm -Wl,-rpath,/n/home03/vchandra/.conda/envs/outerhalo/lib -lgsl -lgslcblas
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -Lextras/lib /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm -Wl,-rpath,/n/home03/vchandra/.conda/envs/outerhalo/lib -lgsl -lgslcblas -lglpk -fPIC -shared
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.exe ./agamatest.so
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -Lextras/lib /n/home03/vchandra/.conda/envs/outerhalo/lib/libpython3.8.so -lpthread -ldl -lutil -lrt -lm -Wl,-rpath,/n/home03/vchandra/.conda/envs/outerhalo/lib -lgsl -lgslcblas -lglpk -lunsio -lnemo -fPIC -shared
c++ -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.exe ./agamatest.so

    ==== Compiling the C++ library ====

c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/interface_c.o" "src/interface_c.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/interface_fortran.o" "src/interface_fortran.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/interface_nemo.o" "src/interface_nemo.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/interface_python.o" "src/interface_python.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/math_core.o" "src/math_core.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/math_fit.o" "src/math_fit.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/math_gausshermite.o" "src/math_gausshermite.cpp"
c++ -c -fPIC -Wall -O2 -fopenmp -std=c++11 -march=native -Wno-missing-field-initializers -Wno-cast-function-type -Isrc -Iextras/include -DHAVE_PYTHON -I"/n/home03/vchandra/.conda/envs/outerhalo/include/python3.8" -I"/n/home03/vchandra/.conda/envs/outerhalo/lib/python3.8/site-packages/numpy/core/include" -DHAVE_EIGEN -DHAVE_CVXOPT -DHAVE_GLPK -DHAVE_UNSIO -MMD -MP -o "obj/math_geometry.o" "src/math_geometry.cpp"
make: *** No rule to make target 'extras/include/Eigen/src/SparseCore/Spar', needed by 'obj/math_linalg.o'.  Stop.
error: Compilation failed
vedantchandra commented 3 months ago

Deleting the entire repository and re-installing worked like a charm. Something specific to my system was clearly wrong. Thanks @eugvas!