Skip to content

Commit

Permalink
Misc cleanup Windows, my laptop config-site and bv_mfem. (#19289) (#1…
Browse files Browse the repository at this point in the history
…9292)

* Fix error comment, reference MFEM instead of FMS.

* Remove old logic replacing CMake debug flags.

There is a newer way to handle this, and VisIt uses it by setting
CMAKE_MSVC_RUNTIME_LIBRARY.

* Add shortcut for specifying a build needed for testing on my laptop.
  • Loading branch information
biagas committed Feb 6, 2024
1 parent b938d6f commit f9dfefa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
37 changes: 4 additions & 33 deletions src/CMake/VisItMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,17 @@
# Change VISIT_PLUGIN_TARGET_RTOD to VISIT_PLUGIN_TARGET_OUTPUT_DIR and
# added support for non windows (moved from <plugintype>/CMakeLists.txt).
#
# Kathleen Biagas, Mon Dec 11, 2023
# Remove replacement of debug flags. Now handled by setting of
# CMAKE_MSVC_RUNTIME_LIBRARY to "MultiThreadedDLL" in root CMakeLists.txt.
#
#*****************************************************************************

if(WIN32)
add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_SCL_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

# cmake automatically uses _DEBUG and MDd for Debug flags, but our
# third-party libs are NOT debug versions, so we won't be able to
# link against them if those defines are used. Replace those flags:
# When we allow users to supply their own third-party libs, then
# this will have to be rethought -- they may want to be able to c
# change them and this currently forces.

macro(REPLACE_FLAG OLD_FLAG NEW_FLAG FLAG_TYPE FLAG_STRING)
string(REPLACE "${OLD_FLAG}" "${NEW_FLAG}" TMP "${${FLAG_TYPE}}")
set(${FLAG_TYPE} "${TMP}" CACHE STRING "${FLAG_STRING}" FORCE)
endmacro()

# Remove /_DEBUG From debug builds
if(VISIT_REPLACE_DEBUG_FLAGS)
REPLACE_FLAG("/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG
"Flags used by the compiler during debug builds")
REPLACE_FLAG("/D_DEBUG" "" CMAKE_C_FLAGS_DEBUG
"Flags used by the compiler during debug builds")
REPLACE_FLAG("/D_DEBUG" "" CMAKE_EXE_LINKER_FLAGS_DEBUG
"Flags used by the linker during debug builds")
REPLACE_FLAG("/D_DEBUG" "" CMAKE_MODULE_LINKER_FLAGS_DEBUG
"Flags used by the linker during debug builds")
# Change /MDd to /MD for debug builds
REPLACE_FLAG("/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG
"Flags used by the compiler during debug builds")
REPLACE_FLAG("/MDd" "/MD" CMAKE_C_FLAGS_DEBUG
"Flags used by the compiler during debug builds")
REPLACE_FLAG("/MDd" "/MD" CMAKE_EXE_LINKER_FLAGS_DEBUG
"Flags used by the linker during debug builds")
REPLACE_FLAG("/MDd" "/MD" CMAKE_MODULE_LINKER_FLAGS_DEBUG
"Flags used by the linker during debug builds")
endif()
endif()

function(ADD_TARGET_INCLUDE target)
Expand Down
15 changes: 11 additions & 4 deletions src/config-site/steppenwolf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ ADD_DEFINITIONS(/wd4244 /wd4305 /wd4800)

VISIT_OPTION_DEFAULT(VISIT_INSTALL_PROFILES_TO_HOSTS "llnl" TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_INSTALL_THIRD_PARTY ON TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_PARALLEL OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_WINDOWS_APPLICATION OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_NO_ALLBUILD ON TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_CREATE_XMLTOOLS_GEN_TARGETS OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_ENABLE_UNIT_TESTS OFF TYPE BOOL)
if(BUILD_FOR_TESTS) # this is a var I create when I need it
VISIT_OPTION_DEFAULT(VISIT_ENABLE_UNIT_TESTS ON TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_ENABLE_DATA_MANUAL_EXAMPLES ON TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_BUILD_ALL_PLUGINS ON TYPE BOOL)
else()
VISIT_OPTION_DEFAULT(VISIT_PARALLEL OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_ENABLE_UNIT_TESTS OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(VISIT_BUILD_ALL_PLUGINS OFF TYPE BOOL)
endif()

SET(CMAKE_SUPPRESS_REGENERATION TRUE)
SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
Expand All @@ -41,10 +48,10 @@ if(USE_REDUCED_BUILD) # this is just a var I create when I need it

endif()

if(USE_DEBUG_VTK)
if(USE_DEBUG_VTK) # this is a var I create when I need it
if(MSVC_TOOLSET_VERSION LESS "143")
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR C:/A_VisIt/TPForDebugging/vtk-debug/8.1.0)
else()
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR C:/A_VisIt/TPForDebugging/vtk-debug/MSVC2022/9.1.0)
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR C:/A_VisIt/TPForDebugging/vtk-debug/9.2.6)
endif()
endif()
2 changes: 1 addition & 1 deletion src/tools/dev/scripts/bv_support/bv_mfem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function build_mfem
fi
echo "\"${CMAKE_BIN}\" ${vopts} .." >> $CMS
cat $CMS
issue_command bash $CMS || error "FMS configuration failed."
issue_command bash $CMS || error "MFEM configuration failed."

#
# Build mfem
Expand Down

0 comments on commit f9dfefa

Please sign in to comment.