Skip to content

Commit 7c26939

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

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ 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+
foreach (flag "[\\/\\-]O3" "[\\/\\-]Ofast" "[\\/\\-]fast")
36+
string(REGEX REPLACE ${flag} ${GAUXC_OBARA_SAIKA_COMPILE_OPTIMIZATION_OPTIONS} CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
37+
endforeach()
38+
message("Setting Obara-Saika CMAKE_CXX_FLAGS_RELEASE to: ${CMAKE_CXX_FLAGS_RELEASE}")
39+
endif()
40+
41+
3242
target_sources( gauxc PRIVATE ${GAUXC_OBARA_SAIKA_HOST_SRC} )
3343
target_include_directories( gauxc PUBLIC
3444
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>

0 commit comments

Comments
 (0)