diff --git a/.gitignore b/.gitignore index b0decb2aa4b117cf8cac3569140c693fe78773ea..14140a23bf24c01df069e7251eeae28ff0834364 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,10 @@ -/nbproject -/Debug -/Release -/RelWithDebInfo -/Testing +# build/output directories +/builddir /Documentation/html/ /Documentation/output_snippets/ -/CMakeLists.txt.user -/Build -/coverage_report + +# Netbeans project stuff +/nbproject # Eclipse project stuff /.settings @@ -25,3 +22,10 @@ # GDB .gdb_history + +# old/deprecated directories (can be removed later, they are not used anymore) +/Debug +/Release +/RelWithDebInfo +/Testing +/Build diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad6baa05ffa7267bd11aad0aead25861aa2bc520..85b56388bd14774a3d6942407e92703b6ddd307a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,13 +36,6 @@ stages: WITH_OPENMP: "yes" WITH_MPI: "yes" -.cuda_openmp_mpi: - extends: .openmp_mpi - # tags are overridden, not merged... - tags: - - docker - - nvidia - # base for Clang builds .clang: stage: build:clang @@ -71,12 +64,13 @@ stages: # running as root does not matter inside Docker containers - export OMPI_ALLOW_RUN_AS_ROOT=1 - export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - - mkdir -p "./builddir/$CI_JOB_NAME" - - pushd "./builddir/$CI_JOB_NAME" - - cmake ../.. - -G Ninja + # fall back to arch 7.0 when the builder has no GPU to avoid building for all GPU architectures + - if ! nvidia-smi --list-gpus > /dev/null; then + WITH_CUDA_ARCH=7.0; + fi + - cmake -B "./builddir/$CI_JOB_NAME" -S . -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX="$(pwd)/${BUILD_TYPE}_install_prefix" + -DCMAKE_INSTALL_PREFIX="$(pwd)/install_prefix/$CI_JOB_NAME" -DWITH_OPENMP=${WITH_OPENMP} -DWITH_MPI=${WITH_MPI} -DWITH_CUDA=${WITH_CUDA} @@ -91,11 +85,10 @@ stages: -DBUILD_PYTHON=${BUILD_PYTHON} -DWITH_CI_FLAGS=yes # "install" implies the "all" target - - ninja ${NINJAFLAGS} install + - ninja -C "./builddir/$CI_JOB_NAME" ${NINJAFLAGS} install - if [[ ${BUILD_TESTS} == "yes" ]] || [[ ${BUILD_MATRIX_TESTS} == "yes" ]]; then - ninja test; + ninja -C "./builddir/$CI_JOB_NAME" test; fi - - popd variables: <<: *default_cmake_flags BUILD_TYPE: Debug @@ -180,9 +173,6 @@ cuda_matrix_tests_Release: cuda_nontests_Debug: extends: .build_template stage: build:cuda - tags: - - docker - - nvidia variables: <<: *default_cmake_flags WITH_CUDA: "yes" @@ -195,9 +185,6 @@ cuda_nontests_Debug: cuda_nontests_Release: extends: .build_template stage: build:cuda - tags: - - docker - - nvidia variables: <<: *default_cmake_flags WITH_CUDA: "yes" @@ -211,32 +198,32 @@ cuda_nontests_Release: cuda_mpi_tests_Debug: extends: - cuda_tests_Debug - - .cuda_openmp_mpi + - .openmp_mpi cuda_mpi_tests_Release: extends: - cuda_tests_Release - - .cuda_openmp_mpi + - .openmp_mpi cuda_mpi_matrix_tests_Debug: extends: - cuda_matrix_tests_Debug - - .cuda_openmp_mpi + - .openmp_mpi cuda_mpi_matrix_tests_Release: extends: - cuda_matrix_tests_Release - - .cuda_openmp_mpi + - .openmp_mpi cuda_mpi_nontests_Debug: extends: - cuda_nontests_Debug - - .cuda_openmp_mpi + - .openmp_mpi cuda_mpi_nontests_Release: extends: - cuda_nontests_Release - - .cuda_openmp_mpi + - .openmp_mpi diff --git a/Documentation/fetch-outputs b/Documentation/fetch-outputs deleted file mode 100755 index bb1a669b54686dbee4d0d9b8b17c1bc66d5b8383..0000000000000000000000000000000000000000 --- a/Documentation/fetch-outputs +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -OUTPUTS_PATH=../Release/src/Examples - -DOC_ROOT_DIR=`pwd` - -echo $DOC_ROOT_DIR - -mkdir Outputs - -find $OUTPUTS_PATH -name "*.out" -exec echo '{}' Outputs/'{}' \; - diff --git a/build b/build index aa764ae81a5b1d413e1b2320ea53f42025c02988..1850c17583c21a41a102533f698f2cec6db715c6 100755 --- a/build +++ b/build @@ -145,10 +145,6 @@ if [[ ! "Release Debug RelWithDebInfo" =~ "$BUILD" ]]; then echo "Unknown build type: $BUILD. The available build types are: Release, Debug, RelWithDebInfo." >&2 exit 1 fi -if [[ ! -d "$BUILD" ]]; then - mkdir "$BUILD" -fi -pushd "$BUILD" >/dev/null # handle targets for target in "$@"; do @@ -209,9 +205,13 @@ else check_file="Makefile" fi +# remove old build directories that were used before the unified top-level "builddir" +# (TODO: this code be removed later) +rm -rf ./Release ./Debug ./RelWithDebInfo ./Testing ./Build + +BUILD_DIR="builddir/$BUILD" cmake_command=( - ${CMAKE} ${ROOT_DIR} - -G "${generator}" + ${CMAKE} -B "$BUILD_DIR" -S "$ROOT_DIR" -G "$generator" -DCMAKE_BUILD_TYPE=${BUILD} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DDCMTK_DIR=${DCMTK_DIR} @@ -238,14 +238,14 @@ cmake_command=( # The build system (e.g. make) will call it automatically if necessary (e.g. # when some CMakeLists.txt changes). if [[ -f ".cmake_command" ]]; then - last_cmake_command=$(cat ".cmake_command" 2>/dev/null) + last_cmake_command=$(cat "$BUILD_DIR/.cmake_command" 2>/dev/null) else last_cmake_command="" fi if [[ ! -f "$check_file" ]] || [[ "$last_cmake_command" != "${cmake_command[@]}" ]]; then echo "Configuring ${BUILD} TNL ..." "${cmake_command[@]}" - echo -n "${cmake_command[@]}" > ".cmake_command" + echo -n "${cmake_command[@]}" > "$BUILD_DIR/.cmake_command" fi if [[ ${CMAKE_ONLY} == "yes" ]]; then @@ -294,7 +294,7 @@ if [[ "$make" != "make" ]] && [[ "$VERBOSE" ]]; then VERBOSE="-v" fi -if ! $make ${VERBOSE} $make_target; then +if ! $make -C "$BUILD_DIR" ${VERBOSE} $make_target; then exit 1 fi @@ -304,6 +304,6 @@ fi if [[ ${BUILD_TESTS} == "yes" ]] || [[ ${BUILD_MATRIX_TESTS} == "yes" ]]; then if [[ ${RUN_TESTS} == "yes" ]]; then - OMP_NUM_THREADS=${TESTS_JOBS} CTEST_PARALLEL_LEVEL=${TESTS_JOBS} CTEST_OUTPUT_ON_FAILURE=1 $make test + OMP_NUM_THREADS=${TESTS_JOBS} CTEST_PARALLEL_LEVEL=${TESTS_JOBS} CTEST_OUTPUT_ON_FAILURE=1 $make -C "$BUILD_DIR" test fi fi diff --git a/scripts/make_coverage_report b/scripts/make_coverage_report index e0c9f1820b900decc218fbdfc555b776e7452fda..645158a302012f92c9c31c7bf9d06b53fca0c62b 100755 --- a/scripts/make_coverage_report +++ b/scripts/make_coverage_report @@ -80,4 +80,4 @@ tests=( ) # run the programs and create coverage reports -./scripts/code_coverage/coverage.py -b Debug -o coverage_report/ --ignore-filename-regex="^\/tmp\/tmpxft_.*" "${tests[@]}" +./scripts/code_coverage/coverage.py -b builddir/Debug -o builddir/coverage_report/ --ignore-filename-regex="^\/tmp\/tmpxft_.*" "${tests[@]}"