gpt4 book ai didi

c - gromacs 编译给出 undefined reference 错误

转载 作者:行者123 更新时间:2023-11-30 17:48:39 28 4
gpt4 key购买 nike

我想在我的开放式 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

最佳答案

这是我的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

关于c - gromacs 编译给出 undefined reference 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18448796/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com