Skip to content

Commit

Permalink
Small updates (#693)
Browse files Browse the repository at this point in the history
Few changes to the CMake system
  • Loading branch information
mkstoyanov authored Jun 26, 2024
1 parent 8ee010b commit e6d89fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ endforeach()
# https://blog.kitware.com/cmake-and-the-default-build-type/
set (default_build_type "Release")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
set (default_build_type "Debug")
set (default_build_type "RelWithDebInfo")
endif ()

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand All @@ -76,7 +76,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
"Debug" "Release" "RelWithDebInfo")
else ()
message (STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
endif ()
Expand Down Expand Up @@ -234,7 +234,6 @@ but then the appropriate CMAKE_CUDA_FLAGS must be set manually.")
endif()
endif()


enable_language (CUDA)
find_package (CUDAToolkit REQUIRED)

Expand All @@ -256,7 +255,6 @@ foreach(_prec ${ASGARD_PRECISIONS})
endif()
endforeach()


set (ASGARD_NUM_QUADRATURE "10" CACHE STRING "Number of quadrature points to be used in realspace transformations.")

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -555,7 +553,7 @@ if (ASGARD_BUILD_TESTS)
# helps keep track of flags and options and whether things we enabled correctly
message(STATUS "")
message(STATUS "ASGarD build options (summary):")
foreach(_opt CMAKE_CXX_FLAGS ASGARD_PRECISIONS ASGARD_USE_OPENMP ASGARD_USE_MPI ASGARD_USE_MATLAB KRON_MODE_GLOBAL)
foreach(_opt CMAKE_CXX_FLAGS ASGARD_PRECISIONS ASGARD_USE_OPENMP ASGARD_USE_MPI ASGARD_USE_MATLAB KRON_MODE_GLOBAL KRON_MODE_GLOBAL_BLOCK)
message(STATUS " ${_opt}=${${_opt}}")
endforeach()
if (ASGARD_USE_CUDA)
Expand All @@ -567,6 +565,4 @@ if (ASGARD_BUILD_TESTS)
endif()
message(STATUS "")

else ()
message (WARNING "warning: tests will not be built.")
endif ()
31 changes: 1 addition & 30 deletions contrib/FindLINALG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,14 @@ Provides the following variables:

include (FindPackageHandleStandardArgs)

#-------------------------------------------------------------------------------
# Setup a menu of BLAS/LAPACK venders.
#-------------------------------------------------------------------------------
set (BLA_VENDOR All CACHE STRING "BLAS/LAPACK Vendor")
set_property (CACHE BLA_VENDOR PROPERTY STRINGS
All
ACML ACML_MP ACML_GPU
Apple NAS
Arm Arm_mp Arm_ilp64 Arm_ilp64_mp
ATLAS
FLAME
FlexiBLAS
Fujitsu_SSL2 Fujitsu_SSL2BLAMP
IBMESSL
Intel10_32 Intel10_64lp Intel10_64lp_seq Intel10_64ilp Intel10_64ilp_seq Intel10_64_dyn
NVHPC
OpenBLAS
SCSL
)

# Check for platform provided BLAS and LAPACK libaries. If these were not found
# then build the openblas library.
if (NOT ${ASGARD_BUILD_OPENBLAS})
find_package (BLAS)
find_package (LAPACK)

if (NOT ${BLAS_FOUND} OR NOT ${LAPACK_FOUND})

if (ASGARD_RECOMMENDED_DEFAULTS)
# Set the ASGARD_BUILD_OPENBLAS option to true in cmake since we now
# need to build OpenBLAS.
set (ASGARD_BUILD_OPENBLAS ON CACHE BOOL "Download and build our own OpenBLAS" FORCE)
else()
# without ASGARD_RECOMMENDED_DEFAULTS, assume that the user has
# system BLAS/LAPACK that the user wants to utilize
message(FATAL_ERROR "Could not find system BLAS or LAPACK, use -DASGARD_BUILD_OPENBLAS=ON to download/compile OpenBLAS")
endif ()
message(FATAL_ERROR "Could not find system BLAS or LAPACK, use -DASGARD_BUILD_OPENBLAS=ON to download/compile OpenBLAS, or load/install the appropriate package and set BLA_VENDOR (see cmake documentation)")
endif ()
endif ()

Expand Down

0 comments on commit e6d89fa

Please sign in to comment.