Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install issue on linux #159

Open
chenJBCA opened this issue Jun 10, 2022 · 2 comments
Open

Install issue on linux #159

chenJBCA opened this issue Jun 10, 2022 · 2 comments

Comments

@chenJBCA
Copy link

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.

  checking for library containing pow... -lm
  checking for library containing cblas_dgemm... no
  configure: error: Couldn't find libgslcblas.
  ERROR: failed to configure libnmt. Check all dependencies are installed
         Dependencies:
         - GSL
         - FFTW
         - CFITSIO
         - HEALPix
  error: Failed to compile C library.
  [end of output]

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.

@damonge
Copy link
Collaborator

damonge commented Jun 12, 2022

@chenJBCA can I check:
a) What you modified in setup.py
b) What the contents of _deps are
c) How you installed cfitsio
?

@chenJBCA
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants