libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol xxx when making a shared object; rec

Consolidate compiler generated dependencies of target helmholtz_3d_hffmm_mex
[ 92%] Linking CXX shared library helmholtz_3d_hffmm_mex.mexa64
/usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
applications/helmholtz/CMakeFiles/helmholtz_3d_hffmm_mex.dir/build.make:101: recipe for target 'applications/helmholtz/helmholtz_3d_hffmm_mex.mexa64' failed
make[2]: *** [applications/helmholtz/helmholtz_3d_hffmm_mex.mexa64] Error 1
CMakeFiles/Makefile2:1366: recipe for target 'applications/helmholtz/CMakeFiles/helmholtz_3d_hffmm_mex.dir/all' failed
make[1]: *** [applications/helmholtz/CMakeFiles/helmholtz_3d_hffmm_mex.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

混编时候libfftw3.a是静态库, 需要编译的是动态库,动态库和静态库不能混编。
重新编译libfftw3,

sudo ./bootstrap.sh
sudo ./configure --enable-shared=yes
sudo make 
sudo make install

你可能感兴趣的:(cmake,C++,bug,c++,cmake,linux)