gromacs编译产生未定义的引用错误
我想在我的开放式suse 12.3平台上使用gromacs,但遇到了问题。 尝试使用gmx_模板编译分析工具时,我首先遇到以下错误:gromacs编译产生未定义的引用错误,c,gcc,C,Gcc,我想在我的开放式suse 12.3平台上使用gromacs,但遇到了问题。 尝试使用gmx_模板编译分析工具时,我首先遇到以下错误: g++ -L/usr/local/gromacs/lib -o msd msd.o -lmd -lgmx -lfftw3f -lxml2 -lnsl -lm
g++ -L/usr/local/gromacs/lib -o msd msd.o -lmd -lgmx -lfftw3f -lxml2 -lnsl -lm
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: /usr/local /gromacs/lib/libgmx.a(pthreads.c.o): undefined reference to symbol 'pthread_getaffinity_np@@GLIBC_2.3.4'
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'pthread_getaffinity_np@@GLIBC_2.3.4' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [msd] Fehler 1
然后我补充说
/将lib64/libpthread.so.0添加到makefile中的-L选项
但现在我遇到了很多这样的错误:
/usr/local/gromacs/lib/libgmx.a(pbc.c.o): In function `put_atoms_in_box_omp._omp_fn.0':
pbc.c:(.text+0x862f): undefined reference to `omp_get_num_threads'
我认为它们都与openmp有关。我对建造过程了解不够
同时启用openmp支持(可能是-fopenmp)和am
为了让gromacs工作,我必须更改cmake文件。我按照gromacs网站上的安装说明使用了快速脏安装
有什么建议到目前为止我可能做错了什么?
我正在使用gcc 4.7,以下是我的gromacs-2018.4安装过程
- gcc-8.3.0
- cmake-3.14.1
- fftw-3.3.8
./configure --prefix=/histor/kang/yangpc/soft/lib/packages/fftw-3.3.8/single_nompi/ --enable-sse2 --enable-avx --enable-float --enable-shared
export PATH=/histor/kang/yangpc//soft/09.system/cmake-3.14.1-Linux-x86_64/bin/:/histor/kang/yangpc//soft/lib/packages/gcc-8.3.0/bin/:$PATH
export CMAKE_PREFIX_PATH="/histor/kang/yangpc/soft/lib/packages/fftw-3.3.8/single_nompi/:/histor/kang/yangpc//soft/lib/packages/gcc-8.3.0/"
export LD_LIBRARY_PATH="/histor/kang/yangpc/soft/lib/packages/gcc-8.3.0/lib64/:$LD_LIBRARY_PATH"
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUD
export LD_LIBRARY_PATH=/histor/kang/yangpc/soft/lib/packages/gmp-5.1.3/lib/:/histor/kang/yangpc/soft/lib/packages/mpc-1.0.1/lib/:/histor/kang/yangpc/soft/lib/packages/mpfr-4.0.1/lib/:$LD_LIBRARY_PATH
~/soft/09.system/cmake-3.14.1-Linux-x86_64/bin/cmake .. -DCMAKE_INSTALL_PREFIX=/histor/kang/yangpc/soft/13.DrugDesign/GROMACS/gromacs-2018.4/InstallPos/ -DCMAKE_C_COMPILER="/histor/kang/yangpc/soft/lib/packages/gcc-8.3.0/bin/gcc" -DCMAKE_CXX_COMPILER="/histor/kang/yangpc/soft/lib/packages/gcc-8.3.0/bin/g++"
make
make install
与其添加
-L/lib64/libpthread.so.0
,不如将-pthread
添加到CFLAGS
,这将安排各个阶段所需的任何额外编译器、汇编程序和/或链接器选项。不过,我不知道这是否能完全解决你的问题,所以我现在只把它作为一个评论……好的,谢谢你,我会尝试的。我不得不做一些事情似乎很不寻常,这是否表明我的配置有问题?-pthread一直处于CFLAGS状态!另一种可能性(根据您的第一条错误消息-/lib64/libpthread.so.0:无法读取符号:无效操作
)是您的/lib/libpthread.so.0
不知何故已损坏。。。我以前从未见过那个特定的错误……好吧,我怎么能尝试修复它呢?