It fails at 6 when I do ‘make’
checking size of size_t… configure: error: in /Applications/gromacs-2021.4/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-build': configure: error: cannot compute sizeof (size_t) See config.log’ for more details
make[2]: *** [src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-stamp/fftwBuild-configure] Error 77
make[1]: *** [src/external/build-fftw/CMakeFiles/fftwBuild.dir/all] Error 2
make: *** [all] Error 2
I run in on a MAC M1 OSX11.6, with Xcode
cmake --version
cmake version 3.22.0
g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Any idea of what to do would be greatly appreciated.
Many thanks in advance
Dear Alevilla,
Thanks for your input, but it does not work.
I do (point 5)
‘cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON’
and that runs fine.
It fails at 6 when I do ‘make’
checking size of size_t… configure: error: in /Applications/gromacs-2021.4/build/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild-build': configure: error: cannot compute sizeof (size_t) See config.log’ for more details
Problem is occuring in the fftw configure before build. It is possible that the automatic configure/build is not suitable for M1, or to your compilation environement. Perhaps you could build fftw separately to isolate what is causing it.
Get the fftw source from their website, then ./configure --prefix ~/(some directory to install to) --enable-single --with-pic --disable-fortran --disable-mpi --disable-threads --enable-shared --disable-static, then make. (NB: this is not necessarily the best build option for the platform in term of optimization)
if perchance the problem does not appear when building ffttw standalone, you can change the gromacs cmake options to -DGMX_BUILD_OWN_FFTW=OFF -DFFTWF_LIBRARY=/{prefix where fftw is installed}/lib64/libfftw3f.so -DFFTWF_INCLUDE_DIR=/{prefix where fftw is installed}/include . If so, you may want to rebuild fftw with the appropriate optimization flag (probably something like --enable-generic-simd128 or --enable-neon ?).
checking whether time.h and sys/time.h may both be included… no
checking for long double… yes
checking for hrtime_t… no
checking size of int… 0
checking size of unsigned int… 0
checking size of long… 0
checking size of unsigned long… 0
checking size of long long… 0
checking size of unsigned long long… 0
checking size of size_t… configure: error: in /Applications/fftw-3.3.10': configure: error: cannot compute sizeof (size_t) See config.log’ for more details
In the config.log there is 349 ‘error’.
The first error enconter is:
configure:4443: gcc --version >&5
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
configure:4454: ? = 0
configure:4443: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:4454: ? = 0
configure:4443: gcc -V >&5
clang: error: argument to ‘-V’ is missing (expected 1 value)
clang: error: no input files
configure:4454: ? = 1
configure:4443: gcc -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:4454: ? = 1
configure:4474: checking whether the C compiler works
configure:4496: gcc conftest.c >&5
configure:4500: $? = 0
configure:4548: result: yes
Unfortunately, none of these errors are actually errors. (some of the tests the configure script runs are actually expected to fail, so searching for “error” do not necessarily give results. For instance here, sizeof((size_t)) should not compile - if it did, this means size_t is not a type but a variable, which is the actual problem the test is trying to detect)
Can you search in config.log for “checking size of size_t” (full line “configure:16363: checking size of size_t”) and post the surrounding ?
For reference, you can post code verbatim like so:
This sounds like your compiler install has some problem ( uint8_t and other are built-in type, this should not occur). Seems very similar to the following stackoverflow post or this github post, i.e. interation between OS upgrade and homebrew/xcode.
I’m not knowledgeable on Mac OS, so cannot advise about any of the proposed solutions. If a solution does solve your problem, please write back what worked.
uint8_t is not guaranteed to be provided by any given tool chain. It can be particularly tricky to get the right combination of headers, compilers, and libraries on Mac.
I have not tried the M1 Macs, but on any Mac, I always use homebrew to install fftw.
If you can’t install fftw through homebrew or build it with the instructions on https://fftw.org, you could look for support on homebrew or fftw forums.
So I tried compiling with icc but I come across this error during building adler32.c.o. Not sure where add dependency check since it says not to edit the Makefile. It was made without any issue using clang and gcc.
Not sure where add dependency check since it says not to edit the Makefile.
That advice is because the Makefile is generated by CMake. Updates to the build system logic need to be made in the CMakeLists.txt (and related files) in order to be persistent.
For information, I failed to built the 2022.rc1 with the same command (some errors with static_cast?)
I saw something like that recently. I can’t remember if it was GROMACS or something else. It was reported that gcc 10 worked for the same case. I think it is some sort of low-priority incompatibility with gcc11 and some GPU code somewhere.