Skip to content

Commit 428306d

Browse files
committed
Allow passing additional flags to obara saika host compilation
Helps with NVHPC segfault
1 parent af72d05 commit 428306d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/xc_integrator/local_work_driver/host/obara_saika/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ set( GAUXC_OBARA_SAIKA_HOST_SRC
2929
src/obara_saika_integrals.cxx
3030
src/chebyshev_boys_computation.cxx
3131
)
32+
33+
# This is required for compilation with NVHPC as it crashes with the O3 optimization flag
34+
if (DEFINED GAUXC_OBARA_SAIKA_COMPILE_OPTIMIZATION_OPTIONS)
35+
get_property(temp TARGET gauxc PROPERTY COMPILE_OPTIONS)
36+
foreach (flag "[\\/\\-]O3" "[\\/\\-]Ofast" "[\\/\\-]fast")
37+
string(REGEX REPLACE ${flag} ${GAUXC_OBARA_SAIKA_COMPILE_OPTIMIZATION_OPTIONS} temp "${temp}")
38+
endforeach()
39+
message("Setting Obara-Saika COMPILE_OPTIONS to: ${temp}")
40+
set_property(TARGET gauxc PROPERTY COMPILE_OPTIONS ${temp})
41+
endif()
42+
3243
target_sources( gauxc PRIVATE ${GAUXC_OBARA_SAIKA_HOST_SRC} )
3344
target_include_directories( gauxc PUBLIC
3445
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>

0 commit comments

Comments
 (0)