-
Notifications
You must be signed in to change notification settings - Fork 73
Integrate external project zlib, libxml2 and sundials build into main cmake build #640
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
Open
benstonezhang
wants to merge
11
commits into
modelica:main
Choose a base branch
from
benstonezhang:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
829e17a
support build on macOS with Apple Silicon
benstonezhang 7d9099a
integration dependence libs build. Bump cmake minimum required to 3.1…
benstonezhang 729c919
split external build into module file; always build with Release conf…
benstonezhang 1cddde7
add fmusim-gui cmake build; also fix parallel build issue
benstonezhang 1f95d8c
move common code of fmusim and fmusim-gui to sim_common.cmake
benstonezhang ca34fa5
support separate build of fmusim-gui
benstonezhang f48466d
rename external base folder name to prevent possible path limitation …
benstonezhang c206388
fix libxml2 link error on windows platform
benstonezhang 94a3279
combine external.cmake and sim_common.cmake as fmusim.cmake
benstonezhang 2f978ba
fix typo of cvode
benstonezhang 63959d2
Merge branch 'main' into main
benstonezhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| include(ExternalProject) | ||
| set(EXTERNAL_BASE_DIR ${CMAKE_BINARY_DIR}/external CACHE STRING "External base directory") | ||
|
|
||
| ExternalProject_Add( | ||
| zlib_src | ||
| PREFIX ${EXTERNAL_BASE_DIR} | ||
| GIT_REPOSITORY https://github.com/madler/zlib.git | ||
| GIT_TAG 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf # v1.3.1 | ||
| GIT_SHALLOW True | ||
| UPDATE_DISCONNECTED True | ||
| CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DZLIB_BUILD_MINIZIP=1 | ||
| BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||
| BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libz.a | ||
| INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||
| ) | ||
| add_library(zlib STATIC IMPORTED) | ||
| set_target_properties(zlib PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libz.a) | ||
| add_dependencies(zlib zlib_src) | ||
|
|
||
| set(ZLIB_SRC_DIR ${EXTERNAL_BASE_DIR}/src/zlib_src) | ||
| set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/ioapi.c PROPERTIES GENERATED 1) | ||
| set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/unzip.c PROPERTIES GENERATED 1) | ||
| set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/iowin32.c PROPERTIES GENERATED 1) | ||
|
|
||
| ExternalProject_Add( | ||
| xml2_src | ||
| PREFIX ${EXTERNAL_BASE_DIR} | ||
| GIT_REPOSITORY https://github.com/GNOME/libxml2.git | ||
| GIT_TAG 60d3056c97067e6cb2125284878ed7c99c90ed81 # v2.13.4 | ||
benstonezhang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| GIT_SHALLOW True | ||
| UPDATE_DISCONNECTED True | ||
| CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -DLIBXML2_WITH_TESTS=OFF | ||
| BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||
| BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libxml2.a | ||
| INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||
| ) | ||
| add_library(xml2 STATIC IMPORTED) | ||
| set_target_properties(xml2 PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libxml2.a) | ||
| add_dependencies(xml2 xml2_src) | ||
|
|
||
| ExternalProject_Add( | ||
| cvcode_src | ||
| PREFIX ${EXTERNAL_BASE_DIR} | ||
| GIT_REPOSITORY https://github.com/LLNL/sundials.git | ||
| GIT_TAG c28eaa3764a03705d61decb6025b409360e9d53f # v7.1.1 | ||
benstonezhang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| GIT_SHALLOW True | ||
| UPDATE_DISCONNECTED True | ||
| CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DEXAMPLES_INSTALL=OFF -DSUNDIALS_ENABLE_ERROR_CHECKS=OFF | ||
| BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||
| BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libsundials_cvode.a ${EXTERNAL_BASE_DIR}/lib/libsundials_core.a | ||
| INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||
| ) | ||
| add_library(cvcode STATIC IMPORTED) | ||
| set_target_properties(cvcode PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libsundials_core.a) | ||
| add_dependencies(cvcode cvcode_src) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.