Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake install does not find MKL blas #68

Open
VictorEijkhout opened this issue Nov 11, 2022 · 7 comments
Open

cmake install does not find MKL blas #68

VictorEijkhout opened this issue Nov 11, 2022 · 7 comments

Comments

@VictorEijkhout
Copy link

My PKG_CONFIG_PATH contains the .pc files for Intel MKL, but superlu_seq keeps reporting

-- Did not find or specify BLAS so configure to build internal CBLAS ...

Specifying blas libraries explicitly also fails:

cmake -D CMAKE_INSTALL_PREFIX=/work2/00434/eijkhout/superluseq/installation-5.3.0-stampede2-intel-impi '-DTPL_BLAS_LIBRARIES=/opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/mkl_intel_lp64;/opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/mkl_sequential;/opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/mkl_core;/opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/pthread' /work2/00434/eijkhout/superluseq/superluseq-5.3.0

which makes sense because:

CMake Warning:
  Manually-specified variables were not used by the project:

    TPL_BLAS_LIBRARIES

Finally, in a slightly different configuration:

-- Did not find or specify BLAS so configure to build internal CBLAS ...
CMake Error at CBLAS/CMakeLists.txt:95 (export):
  export Unknown arguments.


CMake Error at /usr/share/cmake/Modules/WriteBasicConfigVersionFile.cmake:39 (message):
  No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakePackageConfigHelpers.cmake:152 (write_basic_config_version_file)
  SRC/CMakeLists.txt:263 (write_basic_package_version_file)
@xiaoyeli
Copy link
Owner

Are you using an older version of SuperLU?
The newer version has some name changes in CMakeLists.txt.

If you look at the BLAS set up here, it appears to be correct:

if(NOT enable_internal_blaslib)

@VictorEijkhout
Copy link
Author

I'm using 5.3.0

What options do you propose for finding MKL?

@xiaoyeli
Copy link
Owner

There was a slight confusion, you needed both:

-Denable_internal_blaslib=OFF
-DTPL_BLAS_LIBRARIES="-mkl"

Now I updated CMakeLists.txt, so that you only need one line:
-DTPL_BLAS_LIBRARIES="-mkl"

Please try the master branch.

@tcaduser
Copy link

tcaduser commented Nov 15, 2022

I build a static archive when building the superlu library. I specifically avoid linking against any math library by using on the command line:

${CMAKE} -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_COMPILER=${CC} -Denable_complex=OFF -Denable_single=OFF -Denable_doc=OFF -Denable_tests=OFF -DXSDK_ENABLE_Fortran=OFF -DBLAS_FOUND=ON -DCMAKE_C_FLAGS="-fpic" ..

where the BLAS_FOUND definition is used to prevent any linking of a math library. The CMAKE_C_FLAGS argument is used to make the archive linkable into another shared library.

@VictorEijkhout
Copy link
Author

Thanks. On one system I'm now all set.

On the other:

+ cmake -D CMAKE_INSTALL_PREFIX:PATH=/home1/apps/intel19/superluseq/git20221116 -D TPL_BLAS_LIBRARIES=-mkl /tmp/superlu-build
Re-run cmake no build system arguments

Process XSDK defaults ...
USE_XSDK_DEFAULTS = 'TRUE'
-- XSDK: Setting CMAKE_C_COMPILER from env var CC='icc'!
-- XSDK: Setting CMAKE_C_FLAGS from env var CFLAGS='-mkl -O2 -fPIC'!
-- XSDK: Setting CMAKE_CXX_COMPILER from env var CXX='icpc'!
-- XSDK: Setting CMAKE_Fortran_COMPILER from env var FC='ifort'!
-- XSDK: Setting default BUILD_SHARED_LIBS=TRUE
-- XSDK: Setting default CMAKE_BUILD_TYPE=DEBUG
-- SuperLU will be built as a shared library.
-- The C compiler identification is Intel 19.1.0.20200306
-- Check for working C compiler: /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/icc
-- Check for working C compiler: /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/icc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- The Fortran compiler identification is Intel
-- Check for working Fortran compiler: /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/ifort
-- Check for working Fortran compiler: /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/ifort  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/compilers_and_libraries_2020.1.217/linux/bin/intel64/ifort supports Fortran 90 -- yes
-- Using TPL_BLAS_LIBRARIES='-mkl'
CMake Error at /usr/share/cmake/Modules/WriteBasicConfigVersionFile.cmake:39 (message):
  No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakePackageConfigHelpers.cmake:152 (write_basic_config_version_file)
  SRC/CMakeLists.txt:264 (write_basic_package_version_file)

@xiaoyeli
Copy link
Owner

It's probably because your cmake is old.

Can you try replace SRC/CMakeLlists.txt: line 266:
VERSION ${PACKAGE_VERSION}
by
VERSION ${PROJECT_VERSION}

@VictorEijkhout
Copy link
Author

VictorEijkhout commented Nov 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants