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

cant find BLAS during cmake Trilinos #13802

Open
SunnyQbang opened this issue Feb 11, 2025 · 19 comments
Open

cant find BLAS during cmake Trilinos #13802

SunnyQbang opened this issue Feb 11, 2025 · 19 comments

Comments

@SunnyQbang
Copy link

Hi,
I encountered an issue while installing Trilinos. It cannot find the BLAS library, even though I have already installed BLAS on my server and set the path. This is the partial CMake log

Probing the environment ...

-- USE_XSDK_DEFAULTS='FALSE'
-- BUILD_SHARED_LIBS='ON'
-- CMAKE_BUILD_TYPE='RELEASE'
-- MPI_USE_COMPILER_WRAPPERS='ON'
-- Leaving current CMAKE_C_COMPILER=mpicc since it is already set!
-- Leaving current CMAKE_CXX_COMPILER=mpicxx since it is already set!
-- Leaving current CMAKE_Fortran_COMPILER=mpif90 since it is already set!
-- MPI_EXEC='/public/software/mpi/openmpi/gnu/4.1.4/bin/mpiexec'
-- The C compiler identification is GNU 14.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /public/software/mpi/openmpi/gnu/4.1.4/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_C_COMPILER_ID='GNU'
-- CMAKE_C_COMPILER_VERSION='14.1.0'
-- The CXX compiler identification is GNU 14.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /public/software/mpi/openmpi/gnu/4.1.4/bin/mpicxx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CXX_COMPILER_ID='GNU'
-- CMAKE_CXX_COMPILER_VERSION='14.1.0'
-- The Fortran compiler identification is GNU 14.1.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /public/software/mpi/openmpi/gnu/4.1.4/bin/mpif90 - skipped
-- Skip adding flags for OpenMP because Kokkos flags does that ...
-- Trilinos_SET_INSTALL_RPATH='TRUE'
-- CMAKE_INSTALL_RPATH_USE_LINK_PATH='TRUE'
-- Setting default for CMAKE_INSTALL_RPATH pointing to Trilinos_INSTALL_LIB_DIR
-- CMAKE_INSTALL_RPATH='/public/home/jshhuang03/bin/dealii/trilinos-release-14-4-0/lib'
-- Looking for C++ include sys/time.h
-- Looking for C++ include sys/time.h - found
-- Looking for C++ include time.h
-- Looking for C++ include time.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include inttypes.h
-- Looking for C++ include inttypes.h - found
-- Found Perl: /usr/bin/perl (found version "5.16.3")
-- Fortran name mangling: LOWER UNDER
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Verifying Fortran/CXX Compiler Compatibility
-- Verifying Fortran/CXX Compiler Compatibility - Success
-- Performing Test MATH_LIBRARY_IS_SUPPLIED
-- Performing Test MATH_LIBRARY_IS_SUPPLIED - Success
-- Performing Test FINITE_VALUE_HAVE_GLOBAL_ISNAN
-- Performing Test FINITE_VALUE_HAVE_GLOBAL_ISNAN - Success
-- Performing Test FINITE_VALUE_HAVE_STD_ISNAN
-- Performing Test FINITE_VALUE_HAVE_STD_ISNAN - Failed
-- Performing Test FINITE_VALUE_HAVE_GLOBAL_ISINF
-- Performing Test FINITE_VALUE_HAVE_GLOBAL_ISINF - Success
-- Performing Test FINITE_VALUE_HAVE_STD_ISINF
-- Performing Test FINITE_VALUE_HAVE_STD_ISINF - Failed
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen dot

Getting information for all enabled external packages/TPLs ...

Processing enabled external package/TPL: MPI (enabled explicitly, disable with -DTPL_ENABLE_MPI=OFF)
-- MPI_LIBRARY_NAMES=''
Processing enabled external package/TPL: BLAS (enabled by MueLu, disable with -DTPL_ENABLE_BLAS=OFF)
-- BLAS_LIBRARY_NAMES='blas blas_win32'
-- Searching for libs in BLAS_LIBRARY_DIRS='/public/home/jshhuang03/lib'
-- Searching for a lib in the set "blas blas_win32":
-- Searching for lib 'blas' ...
-- Searching for lib 'blas_win32' ...
-- NOTE: Did not find a lib in the lib set "blas blas_win32" for the TPL 'BLAS'!
-- ERROR: Could not find the libraries for the TPL 'BLAS'!
-- TIP: If the TPL 'BLAS' is on your system then you can set:
-DBLAS_LIBRARY_DIRS=';;...'
to point to the directories where these libraries may be found.
Or, just set:
-DTPL_BLAS_LIBRARIES=';;...'
to point to the full paths for the libraries which will
bypass any search for libraries and these libraries will be used without
question in the build. (But this will result in a build-time error
if not all of the necessary symbols are found.)
-- ERROR: Failed finding all of the parts of TPL 'BLAS' (see above), Aborting!

-- NOTE: The find module file for this failed TPL 'BLAS' is:
/public/home/jshhuang03/bin/dealii/tmp/unpack/Trilinos-trilinos-release-14-4-0/cmake/TPLs/FindTPLBLAS.cmake
which is pointed to in the file:
/public/home/jshhuang03/bin/dealii/tmp/unpack/Trilinos-trilinos-release-14-4-0/TPLsList.cmake

TIP: One way to get past the configure failure for the
TPL 'BLAS' is to simply disable it with:
-DTPL_ENABLE_BLAS=OFF
which will disable it and will recursively disable all of the
downstream packages that have required dependencies on it, including
the package 'MueLu' which triggered its enable.
When you reconfigure, just grep the cmake stdout for 'BLAS'
and then follow the disables that occur as a result to see what impact
this TPL disable has on the configuration of Trilinos.

CMake Error at cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake:278 (message):
ERROR: TPL_BLAS_NOT_FOUND=TRUE, aborting!
Call Stack (most recent call first):
cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake:171 (tribits_address_failed_tpl_find)
cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake:105 (tribits_process_enabled_standard_tpl)
cmake/tribits/core/package_arch/TribitsProjectImpl.cmake:197 (tribits_process_enabled_tpls)
cmake/tribits/core/package_arch/TribitsProject.cmake:92 (tribits_project_impl)
CMakeLists.txt:101 (TRIBITS_PROJECT)

-- Configuring incomplete, errors occurred!
Failure with exit status: 1
Exit message: There was a problem configuring trilinos 14-4-0.

And this partial trilinos.package

BLAS_DIR="/public/home/jshhuang03/lib"
LAPACK_DIR="/public/software/mathlib/libs-gcc/lapack/3.9.1"

if [ ! -z "${BLAS_DIR}" ]; then
cecho ${INFO} "trilinos: configuration with BLAS_DIR=${BLAS_DIR}"
CONFOPTS="${CONFOPTS}
-D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR}"
fi

if [ ! -z "${LAPACK_DIR}" ]; then
cecho ${INFO} "trilinos: configuration with LAPACK_DIR=${LAPACK_DIR}"
CONFOPTS="${CONFOPTS}
-D LAPACK_LIBRARY_DIRS:STRING=${LAPACK_DIR}"
fi

if [ ! -z "${SCALAPACK_DIR}" ]; then
cecho ${INFO} "trilinos: configuration with SCALAPACK_DIR=${SCALAPACK_DIR}"
CONFOPTS="
${CONFOPTS}
-D TPL_ENABLE_SCALAPACK:BOOL=ON
-D SCALAPACK_LIBRARY_DIRS=${SCALAPACK_DIR}/lib"
fi

this two raws which i add is the path where BLAS install in my cluster
BLAS_DIR="/public/home/jshhuang03/lib"
LAPACK_DIR="/public/software/mathlib/libs-gcc/lapack/3.9.1"

but it cant find BLAS .....

Any help would be very much appreciated.Thank you!!

Cheers

@jhux2
Copy link
Member

jhux2 commented Feb 11, 2025

@SunnyQbang Have you checked whether the libraries blas and/or blas_win32are present in /public/home/jshhuang03/lib?

@SunnyQbang
Copy link
Author

yep i module load apps/BLAS/3.10.0, and in its path ,i find the

Image

and i also complie a new BLAS

Image

but it doesnt work yet

i also use ln -s librefblas.a blas and ln -s librefblas.a blas.a
but it doesnt work
@jhux2

@jhux2
Copy link
Member

jhux2 commented Feb 11, 2025

Please post the cmake configure line you're using. I suspect a mistake there. Also see https://docs.trilinos.org/files/TrilinosBuildReference.html#specifying-the-location-of-the-parts-of-an-enabled-external-package-tpl for an example of specifying blas/lapack locations.

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 11, 2025

Neither blas_LINUX nor librefblas are recognized library names. You should be able to convince cmake to use them by passing

-D BLAS_LIBRARY_NAMES="blas_LINUX"

or

-D BLAS_LIBRARY_NAMES="refblas"

@SunnyQbang
Copy link
Author

SunnyQbang commented Feb 12, 2025

Please post the cmake configure line you're using. I suspect a mistake there. Also see https://docs.trilinos.org/files/TrilinosBuildReference.html#specifying-the-location-of-the-parts-of-an-enabled-external-package-tpl for an example of specifying blas/lapack locations.

Thank you sir!I am new with C/C++,so i cant tell what u meaning...
cmake configure line?
i just run a candi.sh, i dont use cmake configure
show what for u
can u please tell me more simplely?
Image
@jhux2

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

Looking at this file
https://github.com/dealii/candi/blob/33f3c4be63bf8e755ffc6036cce07aa9a045a63d/deal.II-toolchain/packages/trilinos.package
you might want to try to also set BLAS_LIB="refblas".

@SunnyQbang
Copy link
Author

thank you! i follow u suggestion #13802 (comment)
so i modify the trilinos.packages

Image

I add the -D BLAS_LIBRARY_NAMES="blas_LINUX"
but i doesnt work,
am i misunderstand your meaning?
Thank you for your reply sir! @cgcgcg

@SunnyQbang
Copy link
Author

Looking at this file https://github.com/dealii/candi/blob/33f3c4be63bf8e755ffc6036cce07aa9a045a63d/deal.II-toolchain/packages/trilinos.package you might want to try to also set BLAS_LIB="refblas".

so i should add a new row BLAS_LIB="refblas" or BLAS_LIB="blas_LINUX"? @cgcgcg

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

I don't know what they are. "refblas" could suggest that it's a reference implementation. So that could be slow. But they might also just be symlinked to each other.

@SunnyQbang
Copy link
Author

but i still very confused why i have already finished compiling the BLAS and i have librefblas.a ,but the cmake cant find it... @cgcgcg

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

Did you use candi to compile blas? The names of those libraries look somewhat non-standard.

EDIT: Just checked, candi uses openblas. So you must have installed something else.

EDIT2: Reread the thread. Go with the system package, even if the name is weird.

@SunnyQbang
Copy link
Author

no sir, i just trynna use candi.sh to insatall aspect,the trilinos is the must,this is a specific link https://community.geodynamics.org/t/installation-without-internet-access-using-candi/3928
@cgcgcg

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

Can you share the output of the script?

@SunnyQbang
Copy link
Author

you mean the candi.sh output? @cgcgcg

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

What I would like to see is the error message with -D BLAS_LIBRARY_NAMES="blas_LINUX".

@SunnyQbang
Copy link
Author

SunnyQbang commented Feb 12, 2025

Image
line132:-D BLAS_LIBRARY_NAMES="blas_LINUX"

Image @cgcgcg

is correct to add -D BLAS_LIBRARY_NAMES="blas_LINUX" to trilinos.package or not? thank u sir

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

Sorry, but no.

CONFOPTS="${CONFOPTS} \
      -D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR} \
      -D BLAS_LIBRARY_NAMES=blas_LINUX"

@SunnyQbang
Copy link
Author

SunnyQbang commented Feb 12, 2025

sorry ..my bad

Image

still cant find blas_LINUX sir @cgcgcg

and this FindTPLBLAS.cmake

Image

@cgcgcg
Copy link
Contributor

cgcgcg commented Feb 12, 2025

Ok. Let's try this:

CONFOPTS="${CONFOPTS} \
      -D BLAS_LIBRARIES=/public/software/apps/BLAS/3.10.0/lib/libblas_LINUX.a"

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

No branches or pull requests

3 participants