Open chenJBCA opened 2 years ago
@chenJBCA can I check:
a) What you modified in setup.py
b) What the contents of _deps
are
c) How you installed cfitsio
?
a) I modified the library_dirs and include_dirs input parameters in the _nmtlib function to include the path to the libraries of installed dependencies.
_nmtlib = Extension("_nmtlib",
["pymaster/namaster_wrap.c"],
extra_objects=["./_deps/lib/libnmt.a", "./_deps/lib/libchealpix.a"],
libraries=libs,
library_dirs=["./_deps/lib/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/gsl-2.7-evvggbegukvcrnklksicphtpyikcmv3z/lib/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/cfitsio-4.0.0-taviu3i2robj6b2dcajkhsnq5e5enogq/lib/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/fftw-3.3.10-bx2nhyp5w4hg5i2ta3i57gu7ioov6pbf/lib/"],
include_dirs=[numpy_include, "./src/","./_deps/include/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/gsl-2.7-evvggbegukvcrnklksicphtpyikcmv3z/include/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/cfitsio-4.0.0-taviu3i2robj6b2dcajkhsnq5e5enogq/include/", "/work/lastro/tianchen/packages/spack/opt/spack/linux-rhel7-haswell/gcc-4.8.5/fftw-3.3.10-bx2nhyp5w4hg5i2ta3i57gu7ioov6pbf/include/"],
extra_compile_args=extra,
extra_link_args=extra
)
b) the _deps directory is automatically created by the code when I install it from source. Once created, it contains the libraries of the installed libraries by the code, like healpix and libsharp. It appears to me as the place that the code is looking for the dependencies. I symlink the libraries of other pre-installed dependencies in the _deps/lib directory to help the code find them, which works for gsl but not cfitsio.
c) All the dependencies including gsl, fftw, cfisio are pre-installed using the spack software. They are all included in the $PATH and /LD_LIBRARY_PATH in the bash file.
I'm installing pymaster linux. I've all the dependencies installed in my system and included in $PATH and $LD_LIBRARY_PATH in my bash profile. I first try pip install, but it keeps failing with the following error. However, I checked that libgslcblas.a indeed already exists in the gsl library path so somehow pip just can't find it.
I then tried to install from source by downloading the code and then python setup.py install. In this case, I symlink the pre-installed dependencies under the _deps directory. However, the installation now complains configure: error: Couldn't find cfitsio However, the libcfitsio.a is indeed linked properly within the _deps directory. While the installation now seems find gsl in _deps, it still can't see cfitsio.
I also tried to modify the library_dirs and include_dirs under the _nmtlib function in setup.py, to include all the paths to dependencies libraries. The issue however remains.
I didn't want to use conda since I'm working on a HPC cluster where conda is not installed.