gromacs编译给出了未定义的引用错误

时间:2013-08-26 16:35:10

标签: c gcc

我想在我的开放式平台12.3平台上使用gromacs,但我遇到了麻烦。 当我尝试使用gmx_template编译分析工具时,我首先遇到了这个错误:

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)并且同时感到惊讶 我将不得不更改cmake文件,以使gromacs工作。我按照他们网站上的gromacs安装说明使用了快速和脏的安装。

到目前为止我能做什么/做错什么的任何建议? 我正在使用gcc 4.7

1 个答案:

答案 0 :(得分:0)

这是我的gromacs-2018.4安装过程。

  1. 预安装的软件包

    • 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 
      
  2. 安装gromacs

    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