-
Notifications
You must be signed in to change notification settings - Fork 89
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
ci: add the possitility to use other build generators than ninja inside the ci #3276
Changes from 10 commits
1157ef5
aaf393c
90ac1f5
93a435b
d59ec1e
077a1c0
87e5dbc
076dd2d
12b8a3f
1ce86d3
5f4c41d
31de8cf
f0d5c55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,12 +38,18 @@ Usage: $0 | |
run a code build and test. | ||
--data-basename output.tar.gz | ||
If some data needs to be extracted from the build, the argument will define the tarball. Has to be a `tar.gz`. | ||
--eclipse | ||
Use "Eclipse CDT4 - Unix Makefiles" as build system generator. | ||
--exchange-dir /path/to/exchange | ||
Folder to share data with outside of the container. | ||
--host-config host-config/my_config.cmake | ||
The host-config. Path is relative to the root of the repository. | ||
--install-dir-basename GEOS-e42ffc1 | ||
GEOS installation basename. | ||
--makefile | ||
Use "Unix Makefiles" as build system generator. | ||
--ninja | ||
Use "Ninja" as build system generator. | ||
--no-install-schema | ||
Do not install the xsd schema. | ||
--no-run-unit-tests | ||
|
@@ -58,6 +64,8 @@ Usage: $0 | |
Basename of the json credentials file to connect to the sccache cloud cache. | ||
--test-code-style | ||
--test-documentation | ||
--xcode | ||
Use "Xcode" as build system generator. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also...why include this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was for genericity purpose. The script can be executed outside the ci by a local |
||
-h | --help | ||
EOF | ||
exit 1 | ||
|
@@ -68,10 +76,11 @@ exit 1 | |
or_die cd $(dirname $0)/.. | ||
|
||
# Parsing using getopt | ||
args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,exchange-dir:,host-config:,install-dir-basename:,no-install-schema,no-run-unit-tests,nproc:,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@") | ||
args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,eclipse,exchange-dir:,host-config:,install-dir-basename:,makefile,ninja,no-install-schema,no-run-unit-tests,nproc:,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,xcode,help -- "$@") | ||
|
||
# Variables with default values | ||
BUILD_EXE_ONLY=false | ||
BUILD_GENERATOR="" | ||
GEOS_INSTALL_SCHEMA=true | ||
HOST_CONFIG="host-configs/environment.cmake" | ||
RUN_UNIT_TESTS=true | ||
|
@@ -91,6 +100,9 @@ do | |
RUN_UNIT_TESTS=false | ||
shift;; | ||
--cmake-build-type) CMAKE_BUILD_TYPE=$2; shift 2;; | ||
--eclipse|--ninja|--xcode) | ||
BUILD_GENERATOR=$1; | ||
shift;; | ||
--data-basename) | ||
DATA_BASENAME=$2 | ||
DATA_BASENAME_WE=${DATA_BASENAME%%.*} | ||
|
@@ -104,6 +116,7 @@ do | |
--exchange-dir) DATA_EXCHANGE_DIR=$2; shift 2;; | ||
--host-config) HOST_CONFIG=$2; shift 2;; | ||
--install-dir-basename) GEOS_DIR=${GEOSX_TPL_DIR}/../$2; shift 2;; | ||
--makefile) BUILD_GENERATOR=""; shift;; | ||
--no-install-schema) GEOS_INSTALL_SCHEMA=false; shift;; | ||
--no-run-unit-tests) RUN_UNIT_TESTS=false; shift;; | ||
--nproc) NPROC=$2; shift 2;; | ||
|
@@ -211,7 +224,7 @@ fi | |
# The option `--oversubscribe` tells OpenMPI to allow more MPI ranks than the node has cores. | ||
# This is needed because our unit test `blt_mpi_smoke` is run in parallel with _hard coded_ 4 ranks. | ||
# While some of our ci nodes may have less cores available. | ||
# | ||
# | ||
# In case we have more powerful nodes, consider removing `--oversubscribe` and use `--use-hwthread-cpus` instead. | ||
# This will tells OpenMPI to discover the number of hardware threads on the node, | ||
# and use that as the number of slots available. (There is a distinction between threads and cores). | ||
|
@@ -221,7 +234,7 @@ or_die python3 scripts/config-build.py \ | |
-bt ${CMAKE_BUILD_TYPE} \ | ||
-bp ${GEOS_BUILD_DIR} \ | ||
-ip ${GEOS_DIR} \ | ||
--ninja \ | ||
${BUILD_GENERATOR} \ | ||
-DBLT_MPI_COMMAND_APPEND='"--allow-run-as-root;--oversubscribe"' \ | ||
-DGEOS_INSTALL_SCHEMA=${GEOS_INSTALL_SCHEMA} \ | ||
-DENABLE_COVERAGE=$([[ "${CODE_COVERAGE}" = true ]] && echo 1 || echo 0) \ | ||
|
@@ -245,10 +258,10 @@ fi | |
|
||
# Performing the requested build. | ||
if [[ "${BUILD_EXE_ONLY}" = true ]]; then | ||
or_die ninja -j $NPROC geosx | ||
or_die cmake --build . -j $NPROC --target geosx | ||
else | ||
or_die ninja -j $NPROC | ||
or_die ninja install | ||
or_die cmake --build . -j $NPROC | ||
or_die cmake --install . | ||
|
||
if [[ ! -z "${DATA_BASENAME_WE}" ]]; then | ||
# Here we pack the installation. | ||
|
@@ -269,7 +282,7 @@ if [[ ! -z "${SCCACHE_CREDS}" ]]; then | |
fi | ||
|
||
if [[ "${CODE_COVERAGE}" = true ]]; then | ||
or_die ninja coreComponents_coverage | ||
or_die cmake --build . --target coreComponents_coverage | ||
cp -r ${GEOS_BUILD_DIR}/coreComponents_coverage.info.cleaned ${GEOS_SRC_DIR}/geos_coverage.info.cleaned | ||
fi | ||
|
||
|
@@ -284,9 +297,11 @@ fi | |
|
||
if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then | ||
# We split the process in two steps. First installing the environment, then running the tests. | ||
or_die ninja ats_environment | ||
|
||
# The tests are not run using ninja (`ninja --verbose ats_run`) because it swallows the output while all the simulations are running. | ||
or_die cmake --build . --target ats_environment | ||
|
||
# The tests are not run using cmake (`cmake --build . --verbose --target ats_run`) | ||
# because with ninja it swallows the output while all the | ||
# simulations are running. | ||
# We directly use the script instead... | ||
echo "Available baselines:" | ||
ls -lR /tmp/geos/baselines | ||
|
@@ -321,7 +336,7 @@ if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then | |
fi | ||
|
||
# Cleaning the build directory. | ||
or_die ninja clean | ||
or_die cmake --build . --target clean | ||
|
||
|
||
# Clean the repository | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we include this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed