Problem at step "cmake --build ."

Dear all
I am using lammps on CENTOS 7.5 workstation with 2 processors Intel Xeon Gold 6238R 28 cores each. For KOKKOS I guess it is SKL architecture
I succesfully installed the lammps 29Oct21 version on such workstation using the following command:
cmake -C…/cmake/presets/gcc.cmake -C …/cmake/presets/most.cmake -C …/cmake/presets/kokkos-openmp.cmake -D OpenMP_gomp_LIBRARY=$HOME/opt/gcc-11.1.0/lib64/ -D KOKKOS=yes -D Kokkos_ARCH_SKX=yes -D Kokkos_ENABLE_OPENMP=yes -D BUILD_OMP=yes …/cmake

This ran also finely when running it for builing 23Jun2022 stable release.

But when proceeding to next step “cmake --build .”
I got the following error message:

[ 90%] Building Fortran object CMakeFiles/linalg.dir/home/pascal/lammps-23Jun2022/lib/linalg/dasum.f.o
[ 90%] Building Fortran object CMakeFiles/linalg.dir/home/pascal/lammps-23Jun2022/lib/linalg/daxpy.f.o
[ 90%] Building Fortran object CMakeFiles/linalg.dir/home/pascal/lammps-23Jun2022/lib/linalg/dbdsqr.f.o
[ 90%] Building Fortran object CMakeFiles/linalg.dir/home/pascal/lammps-23Jun2022/lib/linalg/dcabs1.f.o

56 | COMPLEX16 Z
| 1
Error: GNU Extension: Nonstandard type declaration COMPLEX
16 at (1)

| 1
Error: The intrinsic ‘dimag’ declared INTRINSIC at (1) is not available in the current standard settings but a GNU Fortran extension. Use an appropriate ‘-std=*’ option or enable ‘-fall-intrinsics’ in order to use it.

| 1
Error: In call to ‘dimag’ at (1), type mismatch in argument ‘z’; pass ‘REAL(4)’ to ‘COMPLEX(8)’

| 1
Error: Function ‘dimag’ at (1) is INTRINSIC but is not compatible with an intrinsic
gmake[2]: *** [CMakeFiles/linalg.dir/home/pascal/lammps-23Jun2022/lib/linalg/dcabs1.f.o] Error 1
gmake[1]: *** [CMakeFiles/linalg.dir/all] Error 2
gmake: *** [all] Error 2
[[email protected] build]$

gcc --version gives: gcc (GCC) 11.1.0
gfortran --version gives: GNU Fortran (GCC) 11.1.0

I do not know how to solve this issue ?
Thanks a lot for your help
kind regards

You can avoid this by installing a proper set of BLAS / LAPACK libraries and their development packages through your Linux distribution. Then CMake won’t try to compile the problematic code.

Otherwise you may try configuring without the gcc preset. Not sure if that helps but it is worth a try.

Dear Axel
Thanks a lot. only gcc version 4.8.5 is available on Centos 7. So I should upgrade it for building LAMMPS with KOKKOS.
Thus I will install BLAS/LAPACK library for solving the issue.
Thanks again for your help

Recent versions of Kokkos require a C++14 compatible compiler. GCC 4.8 is not.

Hi Axel
All works fine now after installing BLAS/LAPACK. No need of gcc preset since gcc11.2 was properly installed.
here is beginning of ./lmp -h command
[[email protected] build]$ ./lmp -h

Large-scale Atomic/Molecular Massively Parallel Simulator - 23 Jun 2022
Usage example: ./lmp -var t 300 -echo screen -in in.alloy
List of command line options supported by this LAMMPS executable:
-echo none/screen/log/both : echoing of input script (-e)
-help : print this help message (-h)
-in none/filename : read input from file or stdin (default) (-i)
-kokkos on/off … : turn KOKKOS mode on or off (-k)
-log none/filename : where to send log output (-l)
-mdi ‘’ : pass flags to the MolSSI Driver Interface
-mpicolor color : which exe in a multi-exe mpirun cmd (-m)
-cite : select citation reminder style (-c)
-nocite : disable citation reminder (-nc)
-package style … : invoke package command (-pk)
-partition size1 size2 … : assign partition sizes (-p)
-plog basename : basename for partition logs (-pl)
-pscreen basename : basename for partition screens (-ps)
-restart2data rfile dfile … : convert restart to data file (-r2data)
-restart2dump rfile dgroup dstyle dfile …
: convert restart to dump file (-r2dump)
-reorder topology-specs : processor reordering (-r)
-screen none/filename : where to send screen output (-sc)
-skiprun : skip loops in run and minimize (-sr)
-suffix gpu/intel/opt/omp : style suffix to apply (-sf)
-var varname value : set index style variable (-v)

OS: Linux “CentOS Linux 7 (Core)” 3.10.0-1160.71.1.el7.x86_64 x86_64
Compiler: GNU C++ 11.1.0 with OpenMP 4.5
C++ standard: C++14
MPI v3.1: Open MPI v4.1.1, package: Open MPI [email protected] Distribution, ident: 4.1.1, repo rev: v4.1.1, Apr 24, 2021

Accelerator configuration:
KOKKOS package API: OpenMP Serial
KOKKOS package precision: double
OPENMP package API: OpenMP
OPENMP package precision: double

Active compile time flags:
sizeof(smallint): 32-bit
sizeof(imageint): 32-bit
sizeof(tagint): 32-bit
sizeof(bigint): 64-bit

thanks alot again.
Kind regards