Cmake hwloc error

**hi i have been trying to install a program **
https://www.channotation.org/docs/home/
I am new to ubuntu. Can someone guide me through step 5
http://manual.gromacs.org/documentation/current/install-guide/index.html
I followed steps mentioned in guide carefully but getting cmake errors.

/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp: In function ‘int gmx::{anonymous}::parseHwLocNuma(hwloc_topology_t, gmx::HardwareTopology::Machine*)’:
/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:354:64: error: ‘struct hwloc_obj’ has no member named ‘memory’
354 | machine->numa.nodes[i].memory = hwlocNumaNodes[i]->memory.total_memory;
| ^~~~~~

/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:378:49: error: ‘hwloc_get_whole_distance_matrix_by_depth’ was not declared in this scope
378 | const struct hwloc_distances_s * dist = hwloc_get_whole_distance_matrix_by_depth(topo, depth);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:381:54: error: ‘const struct hwloc_distances_s’ has no member named ‘latency_base’
381 | machine->numa.baseLatency = dist->latency_base;
| ^~~~~~~~~~~~
/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:382:54: error: ‘const struct hwloc_distances_s’ has no member named ‘latency_max’
382 | machine->numa.maxRelativeLatency = dist->latency_max;
| ^~~~~~~~~~~
/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:389:65: error: ‘const struct hwloc_distances_s’ has no member named ‘latency’
389 | machine->numa.relativeLatency[i][j] = dist->latency[i*dist->nbobjs+j];
| ^~~~~~~

/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:407:65: error: ‘struct hwloc_obj’ has no member named ‘memory’
407 | machine->numa.nodes[0].memory = hwlocMachine->memory.total_memory;
| ^~~~~~

/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp: In function ‘void gmx::{anonymous}::parseHwLoc(gmx::HardwareTopology::Machine*, gmx::HardwareTopology::SupportLevel*, bool*)’:
/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:507:36: error: ‘HWLOC_TOPOLOGY_FLAG_IO_DEVICES’ was not declared in this scope; did you mean ‘HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM’?
507 | hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IO_DEVICES);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:10392: src/gromacs/CMakeFiles/libgromacs.dir/hardware/hardwaretopology.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3006: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

an other error after using some alternative approach
----------] Global test environment tear-down
1: [==========] 62 tests from 19 test cases ran. (4871 ms total)
1: [ PASSED ] 61 tests.
1: [ FAILED ] 1 test, listed below:
1: [ FAILED ] GaussianDensityDerivativeTest.GaussianDensityDerivativeSpacePartitioningTest
1:
1: 1 FAILED TEST
1/1 Test #1: runAllTests …***Failed 4.91 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) = 4.91 sec

The following tests FAILED:
1 - runAllTests (Failed)
Errors while running CTest
make[3]: *** [test/CMakeFiles/check.dir/build.make:57: test/CMakeFiles/check] Error 8
make[2]: *** [CMakeFiles/Makefile2:964: test/CMakeFiles/check.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:971: test/CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:578: check] Error 2

and consequently command chap not found upon "chap -h"

someone just told me to Use -DCMAKE_PREFIX_PATH=/path/to/your/fftw
** how can i extract path to my fftw :wink: **
my installation was somewhat like ; /home/: sudo apt-get install libfftw3-dev

thank you for your time

Hi,

this is not directly related to GitLab itself, but more of a compilation and dependency error with C++ and CMake. Nevertheless, I have developer experience in this area, so let’s have a quick look :slight_smile:

/home/nabi/simulations/gromacs-2016/src/gromacs/hardware/hardwaretopology.cpp:378:49: error: ‘hwloc_get_whole_distance_matrix_by_depth’ was not declared in this scope
378 | const struct hwloc_distances_s * dist = hwloc_get_whole_distance_matrix_by_depth(topo, depth);

Seems you are including an older version of the provided library or headers which result in these undefined errors.

Let’s do a quick run in Docker.

docker run -ti debian bash
apt-get update
apt-get -y install build-essential cmake wget

The guide needs some love, I have no idea where to download the tarball from.

cd
wget http://ftp.gromacs.org/pub/gromacs/gromacs-2020.3.tar.gz
tar xzf gromacs-2020.3.tar.gz
cd gromacs-2020.3

mkdir build
cd build
cmake ..

-- pkg-config could not detect fftw3f, trying generic detection
Could not find fftw3f library named libfftw3f, please specify its location in CMAKE_PREFIX_PATH or FFTWF_LIBRARY by hand (e.g. -DFFTWF_LIBRARY='/path/to/libfftw3f.so')
CMake Error at cmake/gmxManageFFTLibraries.cmake:92 (MESSAGE):
  Cannot find FFTW 3 (with correct precision - libfftw3f for mixed-precision
  GROMACS or libfftw3 for double-precision GROMACS).  Either choose the right
  precision, choose another FFT(W) library (-DGMX_FFT_LIBRARY), enable the
  advanced option to let GROMACS build FFTW 3 for you
  (-DGMX_BUILD_OWN_FFTW=ON), or use the really slow GROMACS built-in fftpack
  library (-DGMX_FFT_LIBRARY=fftpack).
Call Stack (most recent call first):
  CMakeLists.txt:716 (include)


-- Configuring incomplete, errors occurred!
See also "/root/gromacs-2020.3/build/CMakeFiles/CMakeOutput.log".
See also "/root/gromacs-2020.3/build/CMakeFiles/CMakeError.log".

Ok, should read the docs where it says to use the own library. This essentially downloads something during the CMake call. Looks a bit suspicious.

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON

Make downloads, configures the download and then kicks off the build.

make

Since this works for me, I would guess that the 2016 version is too old and incompatible with system headers. Though, it worked in Docker as well.

Which desktop environment are you using?

Cheers,
Michael