OpenCAEPlus / OpenCAEPoro_ASC2024

OpenCAEPoro for ASC 2024
GNU Lesser General Public License v3.0
35 stars 14 forks source link

CMake Could NOT find BLAS (missing: BLAS_LIBRARIES) #2

Open COOk921 opened 10 months ago

COOk921 commented 10 months ago

I have a problem that has been bothering me for a long time. The problem occurs when building OpenCAEporo,I modify mpi-build-petsc.sh as follows

#!/bin/bash

# source /es01/paratera/parasoft/module.sh  
# source /es01/paratera/parasoft/oneAPI/2022.1/setvars.sh
# module load cmake/3.17.1 gcc/7.3.0-para 

export CC=mpicc
export CXX=mpic++

# users specific directory paths
export PARMETIS_DIR=/root/OpenCAEPoro_ASC2024/parmetis-4.0.3
export PARMETIS_BUILD_DIR=/root/OpenCAEPoro_ASC2024/parmetis-4.0.3/build/Linux-x86_64
export METIS_DIR=/root/OpenCAEPoro_ASC2024/parmetis-4.0.3/metis
export METIS_BUILD_DIR=/root/OpenCAEPoro_ASC2024/parmetis-4.0.3/build/Linux-x86_64
export PETSC_DIR=/root/OpenCAEPoro_ASC2024/petsc-3.19.3
export PETSC_ARCH=petsc_install
export PETSCSOLVER_DIR=/root/OpenCAEPoro_ASC2024/petsc_solver

export CPATH=/root/OpenCAEPoro_ASC2024/petsc-3.19.3/include/:$CPATH
export CPATH=/root/OpenCAEPoro_ASC2024/petsc-3.19.3/petsc_install/include/:/root/OpenCAEPoro_ASC2024/parmetis-4.0.3/metis/include:/root/OpenCAEPoro_ASC2024/parmetis-4.0.3/include:$CPATH
export CPATH=/root/OpenCAEPoro_ASC2024/lapack-3.11/CBLAS/include/:$CPATH

# install
rm -fr build; mkdir build; cd build;

echo "cmake -DUSE_PETSCSOLVER=ON -DUSE_PARMETIS=ON -DUSE_METIS=ON -DCMAKE_VERBOSE_MAKEFILE=OFF -DCMAKE_BUILD_TYPE=Release .."
cmake -DUSE_PETSCSOLVER=ON -DUSE_PARMETIS=ON -DUSE_METIS=ON -DCMAKE_VERBOSE_MAKEFILE=OFF -DCMAKE_BUILD_TYPE=Release  ..
echo "make -j 32"
make -j 32

echo "make install"
make install

When I use the command 'sh mpi-build-petsc.sh', I get an error:

cmake -DUSE_PETSCSOLVER=ON -DUSE_PARMETIS=ON -DUSE_METIS=ON -DCMAKE_VERBOSE_MAKEFILE=OFF -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/user/mpich-install/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/user/mpich-install/bin/mpic++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - not found
CMake Error at /root/miniconda3/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  /root/miniconda3/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /root/miniconda3/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake:1346 (find_package_handle_standard_args)
  modules/RequiredBLAS.cmake:5 (find_package)
  external/CMakeLists.txt:13 (include)

It tells CMake Could NOT find BLAS ,but I have BLAS installed and environment variables added in ~/.bashrc:

export LIBRARY_PATH="$LIBRARY_PATH:/home/user/OpenCAEPoro_ASC2024/lapack-3.11"
export C_INCLUDE_PATH="$C_INCLUDE_PATH:/home/user/OpenCAEPoro_ASC2024/lapack-3.11/LAPACKE/include:/home/user/OpenCAEPoro_ASC2024/lapack-3.11/CBLAS/include"
-- Configuring incomplete, errors occurred!

My software version is as follows:

Any help with this would be greatly appreciated !!! 🫡🫡🫡

sethome2 commented 10 months ago

Do you try to inactivate the conda environment? Also, try to modify the CMakeList.txt in petsc_solver folder like this set(PETSC_DIR "{ROOT_PETSC}/petsc-3.19.3/") set(PETSC_ARCH "petsc_install")

spadesw commented 10 months ago

I also met the same error,but i try to add: -DBLAS_LIBRARIES=/home/asc24/OpenCAEPoro_ASC2024-main/lapack-3.11.0/libcblas.a and -DLAPACK_LIBRARIES=/home/asc24/OpenCAEPoro_ASC2024-main/lapack-3.11.0/liblapacke.a New problems have arisen:

[ 98%] Linking CXX executable testOpenCAEPoro
../libOpenCAEPoroX.a(DenseMat.cpp.o): In function `SYSSolve(int const&, char const*, int const&, double*, double*, int*, double*, int const&)':
DenseMat.cpp:(.text+0x18c): undefined reference to `dsysv_'
make[2]: *** [main/testOpenCAEPoro] Error 1
make[1]: *** [main/CMakeFiles/testOpenCAEPoro.dir/all] Error 2
make: *** [all] Error 2