Gromacs 2020.2 install error

GROMACS version:2020.2
GROMACS modification: No
Here post your question: What has to be done based on "…undefined reference to srot_' and ...strsm_’ " ?


[ 98%] Linking CXX executable …/…/bin/template
/usr/bin/ld: …/…/lib/libgromacs.so.5.0.0: undefined reference to srot_' /usr/bin/ld: ../../lib/libgromacs.so.5.0.0: undefined reference to strsm_’
collect2: error: ld returned 1 exit status
make[2]: *** [share/template/CMakeFiles/template.dir/build.make:87: bin/template] Error 1
make[1]: *** [CMakeFiles/Makefile2:2225: share/template/CMakeFiles/template.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Can you share your CMake command and the following output of CMake? This problem arises, as linker can not find the shared object in your path.

Hi Masrul,

Thank you for trying to help.

My OS Ubuntu 19.10 64x

–>cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DBUILD_SHARED_LIBS=ON -DGMX_PREFER_STATIC_LIBS=OFF -DGMX_FFT_LIBRARY=fftw3 -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc


– Configuring done
– Generating done
– Build files have been written to: /usr/local/gromacs-2020.2/build

All went ok!

–>make

/usr/bin/ld: …/…/lib/libgromacs.so.5.0.0: undefined reference to srot_' collect2: error: ld returned 1 exit status make[2]: *** [share/template/CMakeFiles/template.dir/build.make:87: bin/template] Error 1 make[1]: *** [CMakeFiles/Makefile2:2447: share/template/CMakeFiles/template.dir/all] Error 2 make: *** [Makefile:163: all] Error 2 /usr/bin/ld: ../../lib/libgromacs.so.5.0.0: undefined reference to srot_’
collect2: error: ld returned 1 exit status
make[2]: *** [share/template/CMakeFiles/template.dir/build.make:87: bin/template] Error 1
make[1]: *** [CMakeFiles/Makefile2:2447: share/template/CMakeFiles/template.dir/all] Error 2

make: *** [Makefile:163: all] Error 2

Regards
Bruno

The configuration seems okay. By the way, what is ‘…’ three dots after cmake. Is it an alias or a typo. Typically, You would do the following

  • tar xvf gromacs-2020.2.tar.gz
  • cd gromacs-2020.2
  • mkdir build
  • cd build
  • Then execute command to configure
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DBUILD_SHARED_LIBS=ON -DGMX_PREFER_STATIC_LIBS=OFF -DGMX_FFT_LIBRARY=fftw3 -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc

There are two dots unless ‘…’ is aliased to something else.

Regards,
Masrul

Hi Masrul,
Related to your question " what is ‘…’ three dots after cmake. Is it an alias or a typo.": It is not a typo; means “the directory immediately above the current one“. It is where the cmake script file (as released by gromacs ) is placed.

If I follow the Gromacs install recommendation (similar to your post)

Hello Bruno,
Is issue solved? Okay, My mistake, If you use zsh then ‘…’ makes sense, which is aliased to two directory above current one. I am using bash, btw

– Masrul

Unfortunately not solved. When it comes to ‘make’ I still get


[ 98%] Linking CXX executable …/…/bin/template
/usr/bin/ld: …/…/lib/libgromacs.so.5.0.0: undefined reference to strsm_' /usr/bin/ld: ../../lib/libgromacs.so.5.0.0: undefined reference to srot_’
collect2: error: ld returned 1 exit status
make[2]: *** [share/template/CMakeFiles/template.dir/build.make:87: bin/template] Error 1
make[1]: *** [CMakeFiles/Makefile2:2447: share/template/CMakeFiles/template.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Changing the install path to /home/myname/gromacs-2020/build runs smoothly with ‘make’ BUT in ‘make check’ I get "84% tests passed, 9 tests failed out of 56
". I didn’t found how to correct this up to this moment. I ACCEPT ANY SUGGESTION/COMMENT.
bcramer@schroedinger:~/gromacs-2020.2/build$ make check

84% tests passed, 9 tests failed out of 56

Label Time Summary:
GTest = 102.18 secproc (52 tests)
IntegrationTest = 8.80 sec
proc (9 tests)
MpiTest = 75.22 secproc (8 tests)
SlowTest = 70.89 sec
proc (2 tests)
UnitTest = 22.50 sec*proc (41 tests)

Total Test time (real) = 175.26 sec

The following tests FAILED:
43 - MdrunTests (Failed)
44 - MdrunNonIntegratorTests (Failed)
46 - MdrunMpiTests (Failed)
49 - GmxapiExternalInterfaceTests (Failed)
50 - GmxapiMpiTests (Failed)
53 - regressiontests/complex (Failed)
54 - regressiontests/freeenergy (Failed)
55 - regressiontests/rotation (Failed)
56 - regressiontests/essentialdynamics (Failed)
Errors while running CTest
make[3]: *** [CMakeFiles/run-ctest-nophys.dir/build.make:58: CMakeFiles/run-ctest-nophys] Error 8
make[2]: *** [CMakeFiles/Makefile2:1312: CMakeFiles/run-ctest-nophys.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1091: CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:587: check] Error 2

According to your configuration, you don’t have MPI enabled, so those will be failed (46,50). I would ignore external api test, but essential dynamics failure, you should not ignore. Could you try ‘-DGMX_DOBULE=ON’ on configuration.

You can also check failed tests on regression folder, see these failed at runtime or tolerance error.

Regards
Masrul

Hi Masrul, including -DGMX_DOBULE=ON did not change the errors in ‘make check’. But one thing called my attention but I do not know how to fix this, namely:

@bcramer Did you solve your problem? I also failed on test 43 44 53 54 55 and didn’t figure them out.

Hi Jason, I have not solved the tests problem. I still get error for test 43 to 55.
I am still trying to fix this issue.

Where do you put the install path, in the cmake?

I had the same problem on a Ubuntu 20.04 machine for gromacs-2020.4.
As far as I understand srot and strsm are both part of the BLAS/LAPACK libraries.
Installing those packages through apt-get and adding the -DGMX_EXTERNAL_BLAS=TRUE flag to the cmake command solved the issue for me:

sudo apt install libblas-dev liblapack-dev
tar xfz gromacs-2020.4.tar.gz
cd gromacs-2020.4
mkdir build && cd build
cmake .. -DGMX_EXTERNAL_BLAS=TRUE -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_FFT_LIBRARY=fftw3
make -j8
make check
sudo make install

Hope this helps,
Cédric

2 Likes

wanted to add I had the same issue with gromacs-2020.5 Ubuntu 20.04 and Cedric’s solution worked great

I had the same issue with gromacs 2021. The problem remained even after I tried Cedric’s solution.
The way I solved it was after installing the necessary BLAS/LAPACK libraries, I also included their location in the cmake step.
So for me the solution was: " cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DBLAS_LIBRARIES=“usr/local/lib” -DLAPACK_LIBRARIES="/usr/local/lib" " (don’t include the extra “”)

@sot I am trying to install gromacs 2021. I installed BLAS/LAPACK libraries (sudo apt install libblas-dev liblapack-dev).
My cmake line is:
cmake … -DCMAKE_INSTALL_PREFIX=/home/rbdavid/Apps/gromacs-2021 -DGMX_FFT_LIBRARY=fftw3 -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_EXTERNAL_BLAS=TRUE -DBLAS_LIBRARIES=“usr/lib/” -DLAPACK_LIBRARIES="/usr/lib/"

Whether I use “/usr/lib” or “/usr/local/lib” for BLAS/LAPACK libraries, I get this warning during cmake:
WARNING: Target “libgromacs” requests linking to directory “/usr/lib/”. Targets may link only to libraries. CMake is dropping the item.
WARNING: Target “libgromacs” requests linking to directory “/usr/lib/”. Targets may link only to libraries. CMake is dropping the item.

So, how does explicitly defining these parameters change the installation?

Hi.
If you “ls” the directory that you point the cmake to look into, do you see any blas files?
I am asking because I didn’t install the libraries through apt-get.
I downloaded them, installed them and then created a link to my /usr/local/lib directory.
You can find a straightforward walk through online.
I could paste the guide that I followed but I don’t know if it violates any guidelines.
I also didn’t use the “-DGMX_EXTERNAL_BLAS=TRUE”

Just to add that I faced the same issue on Ubuntu 20.04 with Gromacs 2021-1 and Cédric’s solution worked like a charm!
Thank you for that,
Hans

Thank you Cedric, your answer worked for me!