Getting error during Gromacs installation

GROMACS version: 2020.6
GROMACS modification: No
Here post your question

After installation of OpenMPI, fftw and at the last step of GROMACS installation, I am getting error everytime. Command line used are given below.

cd build
sudo CC=/usr/bin/mpicc F77=/usr/bin/f77 CXX=/usr/bin/mpicxx MPICC=/usr/bin/mpicc CMAKE_PREFIX_PATH=/soft/fftw339/lib cmake … -DFFTWF_INCLUDE_DIR=/soft/fftw339/include -DFFTWF_LIBRARIES=/soft/fftw339/lib/libfftw3.so -DCMAKE_INSTALL_PREFIX=/soft/gmx2020 -DGMX_X11=OFF -DCMAKE_CXX_COMPILER=/usr/bin/mpicxx -DCMAKE_C_COMPILER=/usr/bin/mpicc -DGMX_MPI=ON -DGMX_DOUBLE=OFF -DGMX_DEFAULT_SUFFIX=ON -DGMX_PREFER_STATIC_LIBS=ON -DGMX_SIMD=SSE2 -DGMX_SIMD=AVX2_256 -DGMX_USE_RDTSCP=OFF
sudo make
sudo make install

ERROR Message

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(topology-linux.o): in function hwloc_linux_component_instantiate': (.text+0x8a1): undefined reference to udev_new’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(topology-linux.o): in function hwloc_linux_backend_disable': (.text+0x8eb): undefined reference to udev_unref’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(topology-linux.o): in function hwloc_linuxfs_block_class_fillinfos.isra.0': (.text+0x5185): undefined reference to udev_device_new_from_subsystem_sysname’
/usr/bin/ld: (.text+0x51a5): undefined reference to udev_device_get_property_value' /usr/bin/ld: (.text+0x51ce): undefined reference to udev_device_get_property_value’
/usr/bin/ld: (.text+0x51fc): undefined reference to udev_device_get_property_value' /usr/bin/ld: (.text+0x522d): undefined reference to udev_device_get_property_value’
/usr/bin/ld: (.text+0x5266): undefined reference to udev_device_get_property_value' /usr/bin/ld: (.text+0x528b): undefined reference to udev_device_unref’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(components.o): in function hwloc__dlforeach_cb': (.text+0xa4): undefined reference to lt_dlopenext’
/usr/bin/ld: (.text+0x12e): undefined reference to lt_dlsym' /usr/bin/ld: (.text+0x15a): undefined reference to lt_dlclose’
/usr/bin/ld: (.text+0x19f): undefined reference to lt_dlerror' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(components.o): in function hwloc_plugins_exit’:
(.text+0x48c): undefined reference to lt_dlclose' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(components.o): in function hwloc_components_init’:
(.text+0xbe8): undefined reference to lt_dlinit' /usr/bin/ld: (.text+0xc33): undefined reference to lt_dlforeachfile’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libhwloc.a(components.o): in function hwloc_plugins_exit': (.text+0x4c1): undefined reference to lt_dlexit’
collect2: error: ld returned 1 exit status
make[2]: *** [src/programs/CMakeFiles/gmx.dir/build.make:117: bin/gmx_mpi] Error 1
make[1]: *** [CMakeFiles/Makefile2:5804: src/programs/CMakeFiles/gmx.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Thanks in advance

The static library version of hwloc (libhwloc.a) is used (as per GMX_PREFER_STATIC_LIBS=ON), and seems to require symbols from libltdl and libudev

You can try adding the following variable before cmake invokation

LDFLAGS="-L/path/to/librarydir -ludev -lltdl"

where /path/to/librarydir is a path containing libudev.so and libltdl.so