Skip to content

Commit

Permalink
resolve strumpack issues on tioga, fix cmake var naming
Browse files Browse the repository at this point in the history
  • Loading branch information
chapman39 committed Oct 1, 2024
1 parent eb1f8fa commit 9fa9527
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ if(NOT DEFINED SERAC_SOURCE_DIR)
endif()
message(STATUS "Serac Source Dir: ${SERAC_SOURCE_DIR}")

if(SERAC_ENABLE_CODEVELOP)
# For HIP case, this flag prevents the following Strumpack linker error:
# undefined symbol: mpi_abort_
if(SERAC_ENABLE_CODEVELOP OR (ENABLE_HIP AND STRUMPACK_DIR))
set(ENABLE_FORTRAN ON CACHE BOOL "")
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/SeracConfigHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ endif()
# General Build Info
#------------------------------------------------------------------------------
serac_convert_to_native_escaped_file_path(${PROJECT_SOURCE_DIR} SERAC_REPO_DIR)
serac_convert_to_native_escaped_file_path(${CMAKE_BINARY_DIR} SERAC_BIN_DIR)
serac_convert_to_native_escaped_file_path(${CMAKE_BINARY_DIR} SERAC_BINARY_DIR)

#------------------------------------------------------------------------------
# Create Config Header
Expand Down
9 changes: 6 additions & 3 deletions scripts/spack/packages/serac/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def initconfig_hardware_entries(self):
entries.append(
cmake_cache_option("gtest_disable_pthreads", True))

if "+rocm" in spec:
if spec.satisfies("+rocm"):
entries.append(cmake_cache_option("ENABLE_HIP", True))

hip_root = spec["hip"].prefix
Expand All @@ -398,10 +398,13 @@ def initconfig_hardware_entries(self):
hip_link_flags += "-L{0}/../llvm/lib -L{0}/lib ".format(hip_root)
hip_link_flags += "-Wl,-rpath,{0}/../llvm/lib:{0}/lib ".format(hip_root)
hip_link_flags += "-lpgmath -lflang -lflangrti -lompstub -lamdhip64 "
hip_link_flags += " -L{0}/../lib64 -Wl,-rpath,{0}/../lib64 ".format(hip_root)
hip_link_flags += " -L{0}/../lib -Wl,-rpath,{0}/../lib ".format(hip_root)
hip_link_flags += "-L{0}/../lib64 -Wl,-rpath,{0}/../lib64 ".format(hip_root)
hip_link_flags += "-L{0}/../lib -Wl,-rpath,{0}/../lib ".format(hip_root)
hip_link_flags += "-lamd_comgr -lhsa-runtime64 "

if spec.satisfies("+strumpack"):
hip_link_flags += "-lhipblas -lrocsolver "

entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", hip_link_flags))

if spec.satisfies("target=ppc64le:"):
Expand Down
2 changes: 1 addition & 1 deletion scripts/spack/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"clang@14.0.6+devtools+profiling" ],

"toss_4_x86_64_ib_cray":
[ "clang@17.0.0~openmp+profiling+rocm+raja+umpire~strumpack~petsc amdgpu_target=gfx90a ^hdf5 cflags=-Wno-int-conversion"],
[ "clang@17.0.0~openmp+profiling+rocm+raja+umpire+strumpack~petsc amdgpu_target=gfx90a ^hdf5 cflags=-Wno-int-conversion"],

"blueos_3_ppc64le_ib_p9":
[ "clang@10.0.1+devtools+cuda+raja+umpire+profiling~strumpack cuda_arch=70" ]
Expand Down
2 changes: 1 addition & 1 deletion scripts/testing/ats.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# WSL: ./ats.sh

# Variables used inside of the base test.ats and this script
export ATS_SERAC_BIN_DIR=@SERAC_BIN_DIR@/bin
export ATS_SERAC_BIN_DIR=@SERAC_BINARY_DIR@/bin
export ATS_SERAC_REPO_DIR=@SERAC_REPO_DIR@
export ATS_EXECUTABLE=@ATS_EXECUTABLE@
export ATS_SERAC_BASELINE="none"
Expand Down
4 changes: 3 additions & 1 deletion src/serac/serac_config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// Serac Locations
#define SERAC_REPO_DIR "@SERAC_REPO_DIR@"
#define SERAC_BIN_DIR "@SERAC_BIN_DIR@"
#define SERAC_BINARY_DIR "@SERAC_BINARY_DIR@"

// Compiler Information
#define SERAC_COMPILER_NAME "@CMAKE_CXX_COMPILER_ID@"
Expand All @@ -31,6 +31,8 @@

#cmakedefine SERAC_USE_CUDA
#cmakedefine SERAC_USE_HIP
#cmakedefine SERAC_USE_OPENMP
#cmakedefine SERAC_USE_MPI

// Compiler defines for TPLs
#cmakedefine SERAC_USE_ADIAK
Expand Down

0 comments on commit 9fa9527

Please sign in to comment.