Dear developers,
I am compiling NWChem 7.2.3 on a supercomputer which has gcc 15.2.0, and am getting a lot of errors like this:
"nwchem-master/src/libext/scalapack/scalapack/TOOLS/reshape.c:32:4: error: too many arguments to function 'Cblacs_gridinfo'; expected 0, have 5
32 | Cblacs_gridinfo( context_in, &nprow_in, &npcol_in, &myrow_in, &mycol_in );"
This looks like a compiler incompatibility issue with the source code designed for an older gcc version.
Contacting the IT support, I was recommended to pass the flag "std=gnu17" to cmake.
I had to specify the flags manually for specific modules, which resulted in the successful compilation of the respective blocks, like "scalapack", "tools", "util", and "rtdb":
Thus. iIn "$NWCHEM_TOP/src/libext/scalapack/build_scalapa.sh", I added
if [[ ${GOTCLANG} == "1" ]] || [[ ${GCCVERSIONGT12} == "1" ]] ; then
C_FLAGS="
-std=gnu17 -Wno-error=implicit-function-declaration"
fi
2. In "$NWCHEM_TOP/src/tools", "$NWCHEM_TOP/src/rtdb", I did:
make CFLAGS="-std=gnu17"
However, I am getting the same "incorrect number of arguments" errors in other modules.
Moreover, in ", like "src/peigs"", the "gnu17" flag does not fix the errors.
Can you suggest how to pass the correct flags to the entire NWChem build, so that it compiles?
I am using these settings for the global compilation:
export NWCHEM_TOP=/path/to/nwchen/nwchem-master
export NWCHEM_TARGET=LINUX64
export USE_MPI=Y
export NWCHEM_MODULES="all"
export FC=gfortran
export CC=gcc
export USE_64TO32=y # Ensure compatibility with 64-bit systems
unset USE_INTERNALBLAS
export BUILD_OPENBLAS=1
export BUILD_SCALAPACK=1
export BLAS_SIZE=4
export SCALAPACK_SIZE=4
cd $NWCHEM_TOP/src
make clean
make nwchem_config
make 64_to_32
make -j16
Adding "export CMAKE_C_FLAGS="-std=gnu17"" did not help.
Unfortunately, there is no possibility to have an older gcc version on the supercomputer, which would be the most straightforward fix.
Thanks in advance.
Best regards,
Oleksii