Linker error with NekMesh executable when using custom built lapack AND Intel compiler
A user has reported an issue when building Nektar++ v5.1.0 and building BLAS/LAPACK from source on a system using Intel compilers. When linking the NekMesh executable, the linking fails with a series of undefined references relating to the lapack library that has been built from source as part of the Nektar++ build.
I have verified this issue and been able to reproduce it seeing the following error:
[ 40%] Linking CXX executable NekMesh
ld: /.../ThirdParty/dist/lib/liblapack.so: undefined reference to `xerblassytrd_sb2st_'
ld: /.../ThirdParty/dist/lib/liblapack.so: undefined reference to `csteqrchetrd_2stage_'
ld: /.../ThirdParty/dist/lib/liblapack.so: undefined reference to `zlatrszgemm_'
ld: /.../ThirdParty/dist/lib/liblapack.so: undefined reference to `zsteqrzhetrd_2stage_'
ld: /.../ThirdParty/dist/lib/liblapack.so: undefined reference to `xerbladsytrd_sb2st_'
make[2]: *** [utilities/NekMesh/CMakeFiles/NekMesh.dir/build.make:106: utilities/NekMesh/NekMesh] Error 1
make[1]: *** [CMakeFiles/Makefile2:1129: utilities/NekMesh/CMakeFiles/NekMesh.dir/all] Error 2
This problem does not occur using GCC. The reporter of this issue is using a platform running Centos 7. I have attempted a build on Centos 7 using GCC and couldn't reproduce the problem - everything builds successfully. I then tried on an Ubuntu 20.04 system with the most recent Intel oneAPI compilers installed and was able to reproduce the problem. This suggests the issue is specific to lapack being built with Intel compilers and is not OS-specific.