scottransom / presto

Open source pulsar search and analysis toolkit
http://www.cv.nrao.edu/~sransom/presto/
GNU General Public License v2.0
240 stars 177 forks source link

ld: cannot find -lfftw3f: No such file or directory #179

Closed AdamLusvith closed 2 years ago

AdamLusvith commented 2 years ago

Hello scott, I got an issue when I'm trying do 'pip3 install .' to install python package, but then I got an error:

  gcc -pthread -B /home/adam/anaconda3/envs/presto/compiler_compat -shared -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib build/temp.linux-x86_64-cpython-310/python/ppgplot_src/_ppgplot.o -L/usr/X11R6/lib -L/home/adam/astrosoft/pgplot -lcpgplot -lpgplot -lX11 -lpng -lm -o build/lib.linux-x86_64-cpython-310/_ppgplot.cpython-310-x86_64-linux-gnu.so -Wl,-rpath,/home/adam/astrosoft/presto/lib
  building '_presto' extension
  compiling C sources
  C compiler: gcc -pthread -B /home/adam/anaconda3/envs/presto/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/adam/anaconda3/envs/presto/include -fPIC -O2 -isystem /home/adam/anaconda3/envs/presto/include -fPIC

  compile options: '-I/tmp/pip-build-env-6dy4p9y6/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/adam/astrosoft/pgplot -I/home/adam/astrosoft/presto/include -I/tmp/pip-build-env-6dy4p9y6/overlay/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/distutils/include -I/home/adam/anaconda3/envs/presto/include/python3.10 -c'
  extra options: '-DUSEFFTW -msse -msse2 -msse3'
  gcc: python/presto_src/presto_wrap.c
  gcc -pthread -B /home/adam/anaconda3/envs/presto/compiler_compat -shared -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib build/temp.linux-x86_64-cpython-310/python/presto_src/presto_wrap.o -L/home/adam/astrosoft/presto/lib -lpresto -lfftw3f -lm -o build/lib.linux-x86_64-cpython-310/_presto.cpython-310-x86_64-linux-gnu.so -Wl,-rpath,/home/adam/astrosoft/presto/lib
  /home/adam/anaconda3/envs/presto/compiler_compat/ld: cannot find -lfftw3f: No such file or directory
  collect2: error: ld returned 1 exit status
  error: Command "gcc -pthread -B /home/adam/anaconda3/envs/presto/compiler_compat -shared -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib -Wl,-rpath,/home/adam/anaconda3/envs/presto/lib -Wl,-rpath-link,/home/adam/anaconda3/envs/presto/lib -L/home/adam/anaconda3/envs/presto/lib build/temp.linux-x86_64-cpython-310/python/presto_src/presto_wrap.o -L/home/adam/astrosoft/presto/lib -lpresto -lfftw3f -lm -o build/lib.linux-x86_64-cpython-310/_presto.cpython-310-x86_64-linux-gnu.so -Wl,-rpath,/home/adam/astrosoft/presto/lib" failed with exit status 1

  ########### EXT COMPILER OPTIMIZATION ###########
  Platform      :
    Architecture: x64
    Compiler    : gcc

  CPU baseline  :
    Requested   : 'min'
    Enabled     : SSE SSE2 SSE3
    Flags       : -msse -msse2 -msse3
    Extra checks: none

  CPU dispatch  :
    Requested   : 'max -xop -fma4'
    Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_KNM AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
    Generated   : none
  CCompilerOpt.cache_flush[809] : write cache to path -> /home/adam/astrosoft/presto/build/temp.linux-x86_64-cpython-310/ccompiler_opt_cache_ext.py
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for presto Failed to build presto ERROR: Could not build wheels for presto, which is required to install pyproject.toml-based projects

It it seems like I have problem about fftw3, but I test my fftw path it works well, gcc is able to compile file using the fftw library. So is there any way to deal with this error?

scottransom commented 2 years ago

Yeah, it simply can't find the single-precision FFTW libraries. You can see where that lives by doing ldd on realfft from your PRESTO install (for instance). And then put that library path into the presto_library_dirs list in setup.py.

AdamLusvith commented 2 years ago

Yeah, it simply can't find the single-precision FFTW libraries. You can see where that lives by doing ldd on realfft from your PRESTO install (for instance). And then put that library path into the presto_library_dirs list in setup.py.

It works! Thank you for your help |・ω・`)