0

我想在我的 open suse 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

4

1 回答 1

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
    
于 2019-04-09T01:12:09.390 回答