File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
xc_integrator/local_work_driver/host/obara_saika Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -224,3 +224,19 @@ install( FILES
224224# Install Custom Find Modules
225225include ( ${linalg-cmake-modules_SOURCE_DIR}/LinAlgModulesMacros.cmake )
226226install_linalg_modules( INSTALL_CONFIGDIR )
227+
228+ # This allows specifying a lower compiler optimization level for NVHPC which fails to compile with the -O3 flag whilst leaving the remaining flags unchanged
229+ if (DEFINED GAUXC_OBARA_SAIKA_COMPILE_OPTIMIZATION_OPTIONS)
230+ get_target_property (default_compile_options gauxc COMPILE_OPTIONS)
231+ get_target_property (gauxc_sources gauxc SOURCES )
232+ set_target_properties (gauxc PROPERTIES COMPILE_OPTIONS "" )
233+ set_source_files_properties (${gauxc_sources} PROPERTIES COMPILE_OPTIONS "${default_compile_options} " )
234+
235+ file (GLOB OB_HOST_SRC_FILES ${CMAKE_CURRENT_LIST_DIR} /xc_integrator/local_work_driver/host/obara_saika/src/*.cxx)
236+ set (adjusted_compile_options ${default_compile_options} )
237+ foreach (flag "[\\ /\\ -]O3" "[\\ /\\ -]Ofast" "[\\ /\\ -]fast" )
238+ string (REGEX REPLACE ${flag} ${GAUXC_OBARA_SAIKA_COMPILE_OPTIMIZATION_OPTIONS} adjusted_compile_options "${adjusted_compile_options} " )
239+ endforeach ()
240+ message ("-- Setting Obara-Saika COMPILE_OPTIONS to: ${adjusted_compile_options} " )
241+ set_source_files_properties (${OB_HOST_SRC_FILES} PROPERTIES COMPILE_OPTIONS "${adjusted_compile_options} " )
242+ endif ()
Original file line number Diff line number Diff line change @@ -30,15 +30,6 @@ set( GAUXC_OBARA_SAIKA_HOST_SRC
3030 src/chebyshev_boys_computation.cxx
3131)
3232
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-
4233target_sources ( gauxc PRIVATE ${GAUXC_OBARA_SAIKA_HOST_SRC} )
4334target_include_directories ( gauxc PUBLIC
4435 $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR} /include >
You can’t perform that action at this time.
0 commit comments