0

I am posting here since I don't think GROMACS is going to know my issue. I have MacOS Big Sur and download Intel C/C++ compiler because it is supposed to make this program faster. I can compile with clang and GNU gcc but not Intel. The cmake commands finds both feenableexcept/fedisableexcept but when using the functions in one of the C++ files math/utilities.cpp during making the progam it fails. See failure below. It is related maybe to this post

-- Looking for feenableexcept in m
-- Looking for feenableexcept in m - found
-- Looking for fedisableexcept in m
-- Looking for fedisableexcept in m - found

Failure:

/Users/brian/tools/gromacs-2021.4/src/gromacs/math/utilities.cpp(96): error: identifier "feenableexcept" is undefined
      return feenableexcept(c_FPexceptions);
             ^

/Users/brian/tools/gromacs-2021.4/src/gromacs/math/utilities.cpp(125): error: identifier "fedisableexcept" is undefined
      return fedisableexcept(c_FPexceptions);
             ^

This is my cmake commmand

cmake .. -DGMX_FFT_LIBRARY=mkl \
      -DMKL_LIBRARIES="/opt/intel/oneapi/mkl/2021.4.0/lib" \
      -DMKL_INCLUDE_DIR="/opt/intel/oneapi/mkl/2021.4.0/include" \
      -DCMAKE_C_COMPILER=icc \
      -DCMAKE_CXX_COMPILER=icpc \
      -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk \
      -DCMAKE_OSX_DEPLOYMENT_TARGET=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk \
      -DGMX_USE_TNG=OFF \
      -DZLIB_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/lib 

And these are my flags I set before running cmake

CFLAGS="-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/lib  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -L/opt/intel/oneapi/ipp/latest/lib -I/opt/intel/oneapi/compiler/2021.4.0/mac/compiler/include -I/opt/intel/oneapi/ipp/latest/include -MMD -MF -MP -lz -std=99 -lboost" 
CXXFLAGS="-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -L/opt/intel/oneapi/ipp/latest/lib -I/opt/intel/oneapi/compiler/2021.4.0/mac/compiler/include -I/opt/intel/oneapi/ipp/latest/include -MMD -MF -MP -lz -std=99 -lboost" 
export CPLUS_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/mac/compiler/include:/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include:/opt/intel/oneapi/ipp/latest/include
export C_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/mac/compiler/include:/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include:/opt/intel/oneapi/ipp/latest/include
export CPATH=/opt/intel/oneapi/compiler/2021.4.0/mac/compiler/include:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include:$(xcrun --show-sdk-path)/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include:/opt/intel/oneapi/ipp/latest/include
export LIBRARY_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/lib
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Brian Wiley
  • 485
  • 2
  • 11
  • 21
  • Does Gromacs perhaps not include the headers that the docs specify? Maybe other implementations happen to pull in the relevant headers when you include other things, but this build setup doesn't. – Peter Cordes Dec 17 '21 at 17:21
  • They don't have it but Intel does. Oddly seems that I got past this part in the compilation by changing `CPATH` to `icc`. Not sure where I got the recommendation to set it to the `include` from the compiler I wished to use. – Brian Wiley Dec 17 '21 at 21:32
  • I meant maybe the Gromacs source code is missing a `#include `, and instead relied on it being pulled in by `#include ` or something to get `feenableexcept` declared. That would be surprising, though; `fenv.h` is one of the most special header files, and ISO C++ requires `#pragma STDC FENV_ACCESS ON` for compilers to respect things you do with it, like making FP exceptions a visible side-effect. – Peter Cordes Dec 18 '21 at 00:43

0 Answers0