From 7292f668c1d2f30e801a42d65d23a2a25e546453 Mon Sep 17 00:00:00 2001 From: Jean-Luc Fattebert Date: Fri, 24 Mar 2023 10:17:06 -0400 Subject: [PATCH] Add BML_PREFIX_PATH build variable Clean up the build system a little bit --- CMakeLists.txt | 27 +++++-------------- build.sh | 6 ++--- scripts/build_crusher_magma_gcc.sh | 11 +++----- .../build_olcf_summit_gnu_mgma_openblas.sh | 19 +++++++------ scripts/setenv_crusher_magma_gcc.sh | 4 +-- 5 files changed, 25 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 256cc6ed..7f7cb968 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,10 @@ else() message(STATUS "Will not build with OpenMP") endif() -include(FindPkgConfig) +set(BML_PREFIX_PATH "" CACHE STRING "Path to BML installation") +message(STATUS "BML_PREFIX_PATH: ${BML_PREFIX_PATH}") +list(APPEND CMAKE_PREFIX_PATH ${BML_PREFIX_PATH}) +message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}") if(NOT TARGET BML::bml) find_package(BML CONFIG QUIET) endif() @@ -118,8 +121,9 @@ if(TARGET BML::bml) list(APPEND LINK_LIBRARIES BML::bml) list(APPEND LINK_LIBRARIES BML::bml) else() + include(FindPkgConfig) pkg_check_modules(BML REQUIRED bml) - message(STATUS "Found bml: ${BML_LDFLAGS}") + message(STATUS "Found bml with pkg_check_modules: ${BML_LDFLAGS}") list(APPEND LINK_LIBRARIES ${BML_LDFLAGS}) list(APPEND LINK_LIBRARIES ${BML_LDFLAGS}) endif() @@ -177,25 +181,6 @@ if(PROGRESS_MPI) # add_definitions(-DDO_MPI_BLOCK) endif() -set(BLAS_VENDOR "" - CACHE STRING "If set, the preferred BLAS/LAPACK vendor. Possible choices: {OpenBLAS,Intel,ACML,IBMESSL,...}") - -if(BLAS_VENDOR STREQUAL "None") - set(NOBLAS TRUE) - add_definitions(-DNOBLAS) -elseif(NOT BLAS_LIBRARIES) - set(BLA_VENDOR ${BLAS_VENDOR}) - message(STATUS "BLA_VENDOR=${BLA_VENDOR}") - include(FindBLAS) - if(NOT BLAS_FOUND) - message(FATAL_ERROR "Can not find suitable BLAS library") - endif() -endif() -message(STATUS "BLAS_LIBRARIES=${BLAS_LIBRARIES}") -if(BLAS_LIBRARIES) - set(BLAS_FOUND TRUE) -endif() - find_package(Threads REQUIRED) set(SANITY_CHECK FALSE CACHE BOOL "Additional sanity checks") diff --git a/build.sh b/build.sh index 72ca3c23..1173a0ea 100755 --- a/build.sh +++ b/build.sh @@ -31,12 +31,11 @@ step and the build: EOF set_defaults echo "CMAKE_BUILD_TYPE {Release,Debug} (default is ${CMAKE_BUILD_TYPE})" - echo "CMAKE_PREFIX_PATH Path to include (default is '${CMAKE_PREFIX_PATH}')" + echo "BML_PREFIX_PATH Path to include (default is ${BML_PREFIX_PATH})" echo "CC Path to C compiler (default is ${CC})" echo "CXX Path to C++ compiler (default is ${CXX})" echo "FC Path to Fortran compiler (default is ${FC})" echo "PROGRESS_OPENMP {yes,no} (default is ${PROGRESS_OPENMP})" - echo "BLAS_VENDOR {Default} (default is ${BLAS_VENDOR})" echo "PROGRESS_MPI {yes,no} (default is ${PROGRESS_MPI})" echo "PROGRESS_TESTING {yes,no} (default is ${PROGRESS_TESTING})" echo "PROGRESS_EXAMPLES {yes,no} (default is ${PROGRESS_EXAMPLES})" @@ -55,6 +54,7 @@ EOF set_defaults() { : ${CMAKE_BUILD_TYPE:=Release} : ${CMAKE_PREFIX_PATH:=""} + : ${BML_PREFIX_PATH:=""} : ${CC:=gcc} : ${CXX:=g++} : ${FC:=gfortran} @@ -112,6 +112,7 @@ configure() { ${CMAKE:=cmake} .. \ -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \ ${CMAKE_PREFIX_PATH:+-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}"} \ + -DBML_PREFIX_PATH="${BML_PREFIX_PATH}" \ -DCMAKE_C_COMPILER="${CC}" \ -DCMAKE_CXX_COMPILER="${CXX}" \ -DCMAKE_Fortran_COMPILER="${FC}" \ @@ -123,7 +124,6 @@ configure() { -DPROGRESS_MPI="${PROGRESS_MPI}" \ -DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:=no}" \ -DPROGRESS_TESTING="${PROGRESS_TESTING}" \ - -DBLAS_VENDOR="${BLAS_VENDOR}" \ -DPROGRESS_EXAMPLES="${PROGRESS_EXAMPLES}" \ -DPROGRESS_BENCHMARKS="${PROGRESS_BENCHMARKS}" \ -DPROGRESS_GRAPHLIB="${PROGRESS_GRAPHLIB}" \ diff --git a/scripts/build_crusher_magma_gcc.sh b/scripts/build_crusher_magma_gcc.sh index 8990e745..5685daa3 100755 --- a/scripts/build_crusher_magma_gcc.sh +++ b/scripts/build_crusher_magma_gcc.sh @@ -1,13 +1,11 @@ #!/bin/bash - rm -r build rm -r install # Set BML Library location MY_PATH=`pwd` -export BML_DIR=${MY_PATH}/../bml/install -# Configuring PROGRESS with OpenMP -export MAGMA_PATH=${MAGMA_PATH:=${OLCF_MAGMA_ROOT}} +export BML_DIR=/autofs/nccs-svm1_proj/csc304/bml/crusher/install + export CC=${CC:=gcc} export FC=${FC:=gfortran} export CXX=${CXX:=g++} @@ -18,8 +16,7 @@ export PROGRESS_TESTING=${PROGRESS_TESTING:=yes} export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=RelWithDebInfo} export PROGRESS_EXAMPLES=${PROGRESS_EXAMPLES:=yes} export PROGRESS_BENCHMARKS=${PROGRESS_BENCHMARKS:=yes} -export PKG_CONFIG_PATH=${BML_LIB}/lib64/pkgconfig -export EXTRA_FCFLAGS="" -export EXTRA_LINK_FLAGS="" +export BML_PREFIX_PATH=${BML_PREFIX_PATH:=$BML_DIR} + ./build.sh configure diff --git a/scripts/build_olcf_summit_gnu_mgma_openblas.sh b/scripts/build_olcf_summit_gnu_mgma_openblas.sh index c8fd65f7..a55c9b03 100755 --- a/scripts/build_olcf_summit_gnu_mgma_openblas.sh +++ b/scripts/build_olcf_summit_gnu_mgma_openblas.sh @@ -1,21 +1,20 @@ #!/bin/bash module load cmake -module load cuda -module load gcc/8.1.1 -module load netlib-lapack -module load openblas -module load magma +module load gcc/9.1.0 rm -r build rm -r install # Set BML Library location -BML_LIB=/gpfs/alpine/csc304/proj-shared/bml +BML_LIB=/autofs/nccs-svm1_proj/csc304/bml/summit_gcc_magma MY_PATH=`pwd` +#get jsrun with full path +JSRUN=$(which jsrun) +echo ${JSRUN} + # Configuring PROGRESS with OpenMP -export MAGMA_PATH=${MAGMA_PATH:=${OLCF_MAGMA_ROOT}} export CC=${CC:=gcc} export FC=${FC:=gfortran} export CXX=${CXX:=g++} @@ -25,6 +24,10 @@ export PROGRESS_GRAPHLIB=${PROGRESS_GRAPHLIB:=no} export PROGRESS_TESTING=${PROGRESS_TESTING:=yes} export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=RelWithDebInfo} export PROGRESS_EXAMPLES=${PROGRESS_EXAMPLES:=yes} -export PKG_CONFIG_PATH=${BML_LIB}/lib64/pkgconfig +export PROGRESS_BENCHMARKS=${PROGRESS_BENCHMARKS:=yes} +export BML_PREFIX_PATH=${BML_PREFIX_PATH:=$BML_LIB} + +export PROGRESS_NONMPI_PRECOMMAND=${PROGRESS_NONMPI_PRECOMMAND:=${JSRUN}} +export PROGRESS_NONMPI_PRECOMMAND_ARGS=${PROGRESS_NONMPI_PRECOMMAND_ARGS:="-n1;-a1;-g1;-c7;--smpiargs=off"} ./build.sh install diff --git a/scripts/setenv_crusher_magma_gcc.sh b/scripts/setenv_crusher_magma_gcc.sh index 5a6a94d2..94a6e60f 100644 --- a/scripts/setenv_crusher_magma_gcc.sh +++ b/scripts/setenv_crusher_magma_gcc.sh @@ -1,6 +1,4 @@ #!/bin/bash - module load PrgEnv-gnu -module load magma module load cmake -module load openblas +module load rocm