Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update world builder to version 0.5.0. #5164

Merged
merged 4 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
109 changes: 60 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,65 +136,70 @@ if(ASPECT_WITH_WORLD_BUILDER)
SET(WORLD_BUILDER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/contrib/world_builder/" CACHE PATH "" FORCE)
ENDIF()

# Always include the header files.
# add source and include dirs:
INCLUDE_DIRECTORIES("${WORLD_BUILDER_SOURCE_DIR}/include/")

INCLUDE("${WORLD_BUILDER_SOURCE_DIR}/cmake/version.cmake")
MESSAGE(STATUS "Using World Builder version ${WORLD_BUILDER_VERSION} found at ${WORLD_BUILDER_SOURCE_DIR}.")

# add source and include dirs:
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
FILE(GLOB_RECURSE wb_files "${WORLD_BUILDER_SOURCE_DIR}/source/*.cc")
ELSE()
FILE(GLOB_RECURSE wb_files "${WORLD_BUILDER_SOURCE_DIR}/source/world_builder/*.cc")
ENDIF()
LIST(APPEND TARGET_SRC ${wb_files})
ADD_DEFINITIONS(-DWB_WITH_MPI)

# generate config.cc and include it:
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
CONFIGURE_FILE("${WORLD_BUILDER_SOURCE_DIR}/source/config.cc.in" "${CMAKE_BINARY_DIR}/source/world_builder/config.cc" @ONLY)
LIST(INSERT TARGET_SRC 0 "${CMAKE_BINARY_DIR}/source/world_builder/config.cc")
FILE(REMOVE "${CMAKE_BINARY_DIR}/include/world_builder/config.h")
ELSE()
CONFIGURE_FILE("${WORLD_BUILDER_SOURCE_DIR}/include/world_builder/config.h.in" "${CMAKE_BINARY_DIR}/include/world_builder/config.h" @ONLY)
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/include/")
FILE(REMOVE "${CMAKE_BINARY_DIR}/source/world_builder/config.cc")
ENDIF()
MESSAGE(STATUS "Using World Builder version ${WORLD_BUILDER_VERSION} found at ${WORLD_BUILDER_SOURCE_DIR}.")

# Move some file to the end for unity builds to make sure other file come
# "before". Note: The current design keeps all ASPECT files (including
# ASPECT_UNITY_LAST files) before all GWB files. Mixing them will causes
# many issues with non-unique namespace names like Utilities.
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
SET(UNITY_WB_LAST_FILES
"${WORLD_BUILDER_SOURCE_DIR}/source/parameters.cc")
IF(WORLD_BUILDER_VERSION VERSION_GREATER_EQUAL 0.6.0)
ADD_SUBDIRECTORY("${WORLD_BUILDER_SOURCE_DIR}" ${CMAKE_BINARY_DIR}/world_builder/)
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/world_builder/include/")
ELSE()
SET(UNITY_WB_LAST_FILES
"${WORLD_BUILDER_SOURCE_DIR}/source/world_builder/parameters.cc")
ENDIF()
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we bundle 0.5, we might as well set the minimum supported version to 0.5.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there may be a lot of users out there with custom world builder files and versions below 0.5 release (us for example). World builder files for version 0.4 do not work with 0.5, and requiring 0.5 forces a lot of people to upgrade their workflow immediately after release of world builder 0.5. I would rather wait until the next ASPECT release before we do that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's worth it for us to be forward and backward compatible? If a user updates to a new aspect release we can also expect that they are willing to upgrade WB. There is value in bundling the oldest supported version to improve test coverage.

Anyways, not a big deal if you feel confident this will still work..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well we bundled 0.4.0 up to now, so we are sure it works at the moment. I am ok dropping support for World Builder 0.4.0 right after ASPECT's release, but I would like to keep it for the release. Mostly, to not surprise users who are currently using ASPECT's development environment and WB 0.4.0, then update the ASPECT version by a few days and suddenly need to use the bundled WB 0.5.0 immediately at the time of the WB release.

FILE(GLOB_RECURSE wb_files "${WORLD_BUILDER_SOURCE_DIR}/source/*.cc")
ELSE()
FILE(GLOB_RECURSE wb_files "${WORLD_BUILDER_SOURCE_DIR}/source/world_builder/*.cc")
ENDIF()
LIST(APPEND TARGET_SRC ${wb_files})
ADD_DEFINITIONS(-DWB_WITH_MPI)

# generate config.cc and include it:
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
CONFIGURE_FILE("${WORLD_BUILDER_SOURCE_DIR}/source/config.cc.in" "${CMAKE_BINARY_DIR}/source/world_builder/config.cc" @ONLY)
LIST(INSERT TARGET_SRC 0 "${CMAKE_BINARY_DIR}/source/world_builder/config.cc")
FILE(REMOVE "${CMAKE_BINARY_DIR}/include/world_builder/config.h")
ELSE()
Message(STATUS "C ${CMAKE_BINARY_DIR}")
CONFIGURE_FILE("${WORLD_BUILDER_SOURCE_DIR}/include/world_builder/config.h.in" "${CMAKE_BINARY_DIR}/include/world_builder/config.h" @ONLY)
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/include/")
FILE(REMOVE "${CMAKE_BINARY_DIR}/source/world_builder/config.cc")
ENDIF()

FOREACH(_source_file ${UNITY_WB_LAST_FILES})
LIST(FIND TARGET_SRC ${_source_file} _index)
IF(_index EQUAL -1)
MESSAGE(FATAL_ERROR "could not find ${_source_file}.")
# Move some file to the end for unity builds to make sure other file come
# "before". Note: The current design keeps all ASPECT files (including
# ASPECT_UNITY_LAST files) before all GWB files. Mixing them will causes
# many issues with non-unique namespace names like Utilities.
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0)
SET(UNITY_WB_LAST_FILES
"${WORLD_BUILDER_SOURCE_DIR}/source/parameters.cc")
ELSE()
SET(UNITY_WB_LAST_FILES
"${WORLD_BUILDER_SOURCE_DIR}/source/world_builder/parameters.cc")
ENDIF()

LIST(REMOVE_ITEM TARGET_SRC ${_source_file})
LIST(APPEND TARGET_SRC ${_source_file})
ENDFOREACH()
FOREACH(_source_file ${UNITY_WB_LAST_FILES})
LIST(FIND TARGET_SRC ${_source_file} _index)
IF(_index EQUAL -1)
MESSAGE(FATAL_ERROR "could not find ${_source_file}.")
ENDIF()

FOREACH(_source_file ${wb_files})
# exclude the world builder files from including precompiled headers, they
# do not include ASPECT's dependencies at all.
SET_PROPERTY(SOURCE ${_source_file} PROPERTY COTIRE_EXCLUDED TRUE )
SET_PROPERTY(SOURCE ${_source_file} PROPERTY SKIP_PRECOMPILE_HEADERS TRUE )
# Temporarily disable world builder unity builds:
SET_PROPERTY(SOURCE ${_source_file} PROPERTY SKIP_UNITY_BUILD_INCLUSION TRUE )
ENDFOREACH()
LIST(REMOVE_ITEM TARGET_SRC ${_source_file})
LIST(APPEND TARGET_SRC ${_source_file})
ENDFOREACH()

FOREACH(_source_file ${wb_files})
# exclude the world builder files from including precompiled headers, they
# do not include ASPECT's dependencies at all.
SET_PROPERTY(SOURCE ${_source_file} PROPERTY COTIRE_EXCLUDED TRUE )
SET_PROPERTY(SOURCE ${_source_file} PROPERTY SKIP_PRECOMPILE_HEADERS TRUE )
# Temporarily disable world builder unity builds:
SET_PROPERTY(SOURCE ${_source_file} PROPERTY SKIP_UNITY_BUILD_INCLUSION TRUE )
ENDFOREACH()

SET_PROPERTY(SOURCE "${CMAKE_BINARY_DIR}/world_builder_config.cc" PROPERTY COTIRE_EXCLUDED TRUE )
SET_PROPERTY(SOURCE "${CMAKE_BINARY_DIR}/world_builder_config.cc" PROPERTY SKIP_PRECOMPILE_HEADERS TRUE )
SET_PROPERTY(SOURCE "${CMAKE_BINARY_DIR}/world_builder_config.cc" PROPERTY COTIRE_EXCLUDED TRUE )
SET_PROPERTY(SOURCE "${CMAKE_BINARY_DIR}/world_builder_config.cc" PROPERTY SKIP_PRECOMPILE_HEADERS TRUE )
ENDIF()
ENDIF()


Expand Down Expand Up @@ -599,6 +604,12 @@ IF(ASPECT_WITH_NETCDF)
ENDIF()
ENDIF()

IF(WORLD_BUILDER_VERSION VERSION_GREATER_EQUAL 0.6.0 AND ASPECT_WITH_WORLD_BUILDER)
FOREACH(_T ${TARGETS})
TARGET_LINK_LIBRARIES(${_T} WorldBuilder)
ENDFOREACH()
ENDIF()


IF (ASPECT_USE_SHARED_LIBS)
# some systems need to explicitly link to some libraries to use dlopen
Expand Down
14 changes: 10 additions & 4 deletions contrib/world_builder/AUTHORS
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
The Geodynamic World Builder is currently maintained and developed by Menno Fraters.

There have been contributions on the development from:
Wolfgang Bangerth
Rene Gassmoeller
Timo Heister
Cedric Thieulot
Wolfgang Bangerth,
Magali Billen,
Rebecca Fildes,
Rene Gassmoeller,
Timo Heister,
Haoyuan Li,
Chris Mills,
Arushi Saxena,
Wim Spakman
and
Cedric Thieulot