Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Undefined reference to sgemm with LAMMPS

Vishnu
Novice
1,880 Views

I am trying to compile the latest stable release of LAMMPS (23 June 2022) using the classic C/C++ compilers from Intel's oneAPI toolkit. The process exits early on due to an error triggered by an " undefined reference to `sgemm_' ".

However, as you can see in the terminal output posted below, while sgemm is not found initially, it is found afterwards. Am I missing some dependencies?

Also attached are the CMake output and error logs.

 


-- The CXX compiler identification is Intel 2021.6.0.20220226
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/user/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.36.1")
-- Appending /home/user/intel/oneapi/tbb/2021.6.0/env/../lib/intel64/gcc4.8:/home/vishnu/intel/oneapi/mpi/2021.6.0//libfabric/lib:/home/vishnu/intel/oneapi/mpi/2021.6.0//lib/release:/home/vishnu/intel/oneapi/mpi/2021.6.0//lib:/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64:/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin:/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/lib to CMAKE_LIBRARY_PATH: /home/vishnu/intel/oneapi/tbb/2021.6.0/env/../lib/intel64/gcc4.8:/home/vishnu/intel/oneapi/mpi/2021.6.0//libfabric/lib:/home/vishnu/intel/oneapi/mpi/2021.6.0//lib/release:/home/vishnu/intel/oneapi/mpi/2021.6.0//lib:/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64:/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin:/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/lib
CMake Error at Modules/LAMMPSUtils.cmake:51 (string):
string sub-command STRIP requires two arguments.
Call Stack (most recent call first):
CMakeLists.txt:68 (get_lammps_version)


-- Running check for auto-generated files from make-based build system
-- Found MPI_CXX: /home/user/intel/oneapi/mpi/2021.6.0/lib/libmpicxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Looking for C++ include omp.h
-- Looking for C++ include omp.h - found
-- Found OpenMP_CXX: -qopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- The C compiler identification is Intel 2021.6.0.20220226
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/user/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /home/user/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_lp64.so;/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_thread.so;/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_core.so;/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin/libiomp5.so;-lm;-ldl
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /home/user/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_lp64.so;/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_thread.so;/home/vishnu/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_core.so;/home/vishnu/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin/libiomp5.so;-lm;-ldl;-lm;-ldl
-- Found JPEG: /usr/lib/libjpeg.so (found version "80")
-- Found PNG: /usr/lib/libpng.so (found version "1.6.37")
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.12")
-- Found GZIP: /usr/bin/gzip
-- Found FFMPEG: /usr/bin/ffmpeg
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Looking for C++ include immintrin.h
-- Looking for C++ include immintrin.h - found
-- Found TBB_MALLOC: /home/user/intel/oneapi/tbb/2021.6.0/lib/intel64/gcc4.8/libtbbmalloc.so
-- Performing Test COMPILER_SUPPORTS-O2
-- Performing Test COMPILER_SUPPORTS-O2 - Success
-- Performing Test COMPILER_SUPPORTS-fp-modelfast2
-- Performing Test COMPILER_SUPPORTS-fp-modelfast2 - Success
-- Performing Test COMPILER_SUPPORTS-no-prec-div
-- Performing Test COMPILER_SUPPORTS-no-prec-div - Success
-- Performing Test COMPILER_SUPPORTS-qoverride-limits
-- Performing Test COMPILER_SUPPORTS-qoverride-limits - Success
-- Performing Test COMPILER_SUPPORTS-qopt-zmm-usagehigh
-- Performing Test COMPILER_SUPPORTS-qopt-zmm-usagehigh - Success
-- Performing Test COMPILER_SUPPORTS-qno-offload
-- Performing Test COMPILER_SUPPORTS-qno-offload - Success
-- Performing Test COMPILER_SUPPORTS-fno-alias
-- Performing Test COMPILER_SUPPORTS-fno-alias - Success
-- Performing Test COMPILER_SUPPORTS-ansi-alias
-- Performing Test COMPILER_SUPPORTS-ansi-alias - Success
-- Performing Test COMPILER_SUPPORTS-restrict
-- Performing Test COMPILER_SUPPORTS-restrict - Success
-- Generating style headers...
-- Generating package headers...
-- Generating lmpinstalledpkgs.h...
-- Found ClangFormat: /usr/bin/clang-format (found suitable version "13.0.1", minimum required is "8.0")
-- The following tools and libraries have been found and configured:
* Git
* MPI
* OpenMP
* LAPACK
* BLAS
* JPEG
* PNG
* ZLIB
* TBB_MALLOC
* ClangFormat (required version >= 8.0)

-- <<< Build configuration >>>
LAMMPS Version:
Operating System: Linux Arch Linux
Build type:
Install path: /usr
Generator: Unix Makefiles using /usr/bin/make
-- Enabled packages: ATC;INTEL;MANYBODY
-- <<< Compilers and Flags: >>>
-- C++ Compiler: /home/user/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icpc
Type: Intel
Version: 2021.6.0.20220226
C++ Flags: -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -O3 -std=c++11 -DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG -restrict
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_JPEG;LAMMPS_PNG;LAMMPS_GZIP;LAMMPS_FFMPEG;LMP_INTEL;LMP_INTEL_USELRT;LMP_USE_MKL_RNG
Options: -xHost;-O2;-fp-model;fast=2;-no-prec-div;-qoverride-limits;-qopt-zmm-usage=high;-qno-offload;-fno-alias;-ansi-alias;-restrict
-- C compiler: /home/user/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icc
Type: Intel
Version: 2021.6.0.20220226
C Flags: -xHost -O3 -no-prec-div -qoverride-limits -qopt-zmm-usage=high
-- <<< Linker flags: >>>
-- Executable name: lmp
-- Executable linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
-- Static library flags:
-- <<< MPI flags >>>
-- MPI_defines: MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;_MPICC_H
-- MPI includes: /home/user/intel/oneapi/mpi/2021.6.0/include
-- MPI libraries: /home/user/intel/oneapi/mpi/2021.6.0/lib/libmpicxx.so;/home/vishnu/intel/oneapi/mpi/2021.6.0/lib/libmpifort.so;/home/vishnu/intel/oneapi/mpi/2021.6.0/lib/release/libmpi.so;/usr/lib64/libdl.a;/usr/lib64/librt.a;/usr/lib64/libpthread.a;
-- Configuring incomplete, errors occurred!
See also "/home/user/Applications/PKG_LMP/src/lammps/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/Applications/PKG_LMP/src/lammps/build/CMakeFiles/CMakeError.log".
==> ERROR: A failure occurred in build().
Aborting...

 

 

Also attached are the CMake output and error logs.

0 Kudos
1 Solution
VarshaS_Intel
Moderator
1,849 Views

Hi,

 

Thanks for posting in Intel Communities.

 

On our end, we have tried using Ubuntu 20. 04 and we did not face any errors at the time of CMake.

Please find the below screenshots where we are able to build successfully:

CMake.png

buildSuccess.png

We have observed that you are using ArchLinx which is not a supported operating system as per the latest Intel oneAPI Base Toolkit and Intel HPC Toolkit  System requirements.

Could you please try with the supported operating systems and let us know if you are still facing any issues? 

 

Please find the links for the system requirements of  Intel Base Toolkit System Requirements and Intel HPC Toolkit System Requirements 

 

Thanks & Regards,

Varsha

 

View solution in original post

0 Kudos
3 Replies
VarshaS_Intel
Moderator
1,850 Views

Hi,

 

Thanks for posting in Intel Communities.

 

On our end, we have tried using Ubuntu 20. 04 and we did not face any errors at the time of CMake.

Please find the below screenshots where we are able to build successfully:

CMake.png

buildSuccess.png

We have observed that you are using ArchLinx which is not a supported operating system as per the latest Intel oneAPI Base Toolkit and Intel HPC Toolkit  System requirements.

Could you please try with the supported operating systems and let us know if you are still facing any issues? 

 

Please find the links for the system requirements of  Intel Base Toolkit System Requirements and Intel HPC Toolkit System Requirements 

 

Thanks & Regards,

Varsha

 

0 Kudos
Vishnu
Novice
1,840 Views

Hi Varsha,

 

I found the issue, and it was at my end. I had a fork of LAMMPS with some modifications, and that seems to have cause some issues.

 

Thanks for looking into this.

0 Kudos
VarshaS_Intel
Moderator
1,824 Views

Hi Vishnu,


Glad to know that your issue is resolved. Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Have a good day!


Thanks & Regards,

Varsha


0 Kudos
Reply