Loading .gitlab-ci.yml +41 −41 Original line number Diff line number Diff line Loading @@ -20,15 +20,15 @@ stages: WITH_CUDA: "no" WITH_CUDA_ARCH: "auto" WITH_MPI: "no" # configurations WITH_TESTS: "no" WITH_MATRIX_TESTS: "no" # build targets BUILD_TESTS: "no" BUILD_MATRIX_TESTS: "no" WITH_COVERAGE: "no" WITH_DOC: "no" WITH_BENCHMARKS: "no" WITH_EXAMPLES: "no" WITH_TOOLS: "no" WITH_PYTHON: "no" BUILD_DOC: "no" BUILD_BENCHMARKS: "no" BUILD_EXAMPLES: "no" BUILD_TOOLS: "no" BUILD_PYTHON: "no" # base for OpenMP+MPI builds .openmp_mpi: Loading Loading @@ -81,18 +81,18 @@ stages: -DWITH_MPI=${WITH_MPI} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} -DWITH_TESTS=${WITH_TESTS} -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_DOC=${WITH_DOC} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_MATRIX_TESTS=${BUILD_MATRIX_TESTS} -DBUILD_DOC=${BUILD_DOC} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} -DWITH_EXAMPLES=${WITH_EXAMPLES} -DWITH_TOOLS=${WITH_TOOLS} -DWITH_PYTHON=${WITH_PYTHON} -DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_TOOLS=${BUILD_TOOLS} -DBUILD_PYTHON=${BUILD_PYTHON} -DWITH_CI_FLAGS=yes # "install" implies the "all" target - ninja ${NINJAFLAGS} install - if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then - if [[ ${BUILD_TESTS} == "yes" ]] || [[ ${BUILD_MATRIX_TESTS} == "yes" ]]; then ninja test; fi - popd Loading Loading @@ -137,7 +137,7 @@ cuda_tests_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_TESTS: "yes" BUILD_TESTS: "yes" cuda_tests_Release: extends: .build_template Loading @@ -149,7 +149,7 @@ cuda_tests_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_TESTS: "yes" BUILD_TESTS: "yes" cuda_matrix_tests_Debug: Loading @@ -162,7 +162,7 @@ cuda_matrix_tests_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" cuda_matrix_tests_Release: extends: .build_template Loading @@ -174,7 +174,7 @@ cuda_matrix_tests_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" cuda_examples_Debug: Loading @@ -187,7 +187,7 @@ cuda_examples_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" cuda_examples_Release: extends: .build_template Loading @@ -199,7 +199,7 @@ cuda_examples_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" cuda_benchmarks_tools_python_Debug: Loading @@ -212,9 +212,9 @@ cuda_benchmarks_tools_python_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" cuda_benchmarks_tools_python_Release: extends: .build_template Loading @@ -226,9 +226,9 @@ cuda_benchmarks_tools_python_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" cuda_mpi_tests_Debug: Loading Loading @@ -280,60 +280,60 @@ default_tests_Debug: variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_TESTS: "yes" BUILD_TESTS: "yes" default_tests_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_TESTS: "yes" BUILD_TESTS: "yes" default_matrix_tests_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" default_matrix_tests_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" default_examples_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" default_examples_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" default_benchmarks_tools_python_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" default_benchmarks_tools_python_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" mpi_tests_Debug: Loading Loading @@ -472,7 +472,7 @@ documentation examples: WITH_CUDA: "yes" BUILD_TYPE: Debug # build output snippets for documentation WITH_DOC: "yes" BUILD_DOC: "yes" only: changes: - Documentation/**/* Loading CMakeLists.txt +16 −15 Original line number Diff line number Diff line Loading @@ -23,15 +23,15 @@ set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") option(WITH_OPENMP "Build with OpenMP support" ON) option(WITH_MPI "Build with MPI support" ON) option(WITH_GMP "Build with GMP support" OFF) option(WITH_TESTS "Build tests" ON) option(WITH_MATRIX_TESTS "Build tests for matrices" ON) option(WITH_PROFILING "Enable code profiling compiler flags" OFF ) option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF) option(WITH_EXAMPLES "Compile the 'src/Examples' directory" ON) option(WITH_TOOLS "Compile the 'src/Tools' directory" ON) option(WITH_BENCHMARKS "Compile the 'src/Benchmarks' directory" ON) option(WITH_PYTHON "Compile the Python bindings" ON) option(WITH_DOC "Build examples included in the documentation" ON) option(BUILD_BENCHMARKS "Compile the 'src/Benchmarks' directory" OFF) option(BUILD_EXAMPLES "Compile the 'src/Examples' directory" OFF) option(BUILD_TOOLS "Compile the 'src/Tools' directory" OFF) option(BUILD_TESTS "Build tests" OFF) option(BUILD_MATRIX_TESTS "Build tests for matrix formats" OFF) option(BUILD_PYTHON "Compile the Python bindings" OFF) option(BUILD_DOC "Build examples included in the documentation" OFF) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) Loading Loading @@ -155,7 +155,7 @@ endif() link_libraries( stdc++fs ) # gtest has to be built before we add the MPI flags if( ${WITH_TESTS} OR ${WITH_MATRIX_TESTS} ) if( ${BUILD_TESTS} OR ${BUILD_MATRIX_TESTS} ) enable_testing() # build gtest libs Loading Loading @@ -330,7 +330,7 @@ include_directories( src/3rdparty ) add_subdirectory( src ) # Add subdirectories for examples included in the documentation if( ${WITH_DOC} ) if( ${BUILD_DOC} ) set( TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH "${CMAKE_SOURCE_DIR}/Documentation/output_snippets" ) file(MAKE_DIRECTORY ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}) add_subdirectory( Documentation/Examples ) Loading Loading @@ -373,14 +373,15 @@ message( " WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" ) message( " WITH_OPENMP = ${WITH_OPENMP}" ) message( " WITH_MPI = ${WITH_MPI}" ) message( " WITH_GMP = ${WITH_GMP}" ) message( " WITH_TESTS = ${WITH_TESTS}" ) message( " WITH_MATRIX_TESTS = ${WITH_MATRIX_TESTS}" ) message( " WITH_PROFILING = ${WITH_PROFILING}" ) message( " WITH_COVERAGE = ${WITH_COVERAGE}" ) message( " WITH_EXAMPLES = ${WITH_EXAMPLES}" ) message( " WITH_TOOLS = ${WITH_TOOLS}" ) message( " WITH_BENCHMARKS = ${WITH_BENCHMARKS}" ) message( " WITH_PYTHON = ${WITH_PYTHON}" ) message( " BUILD_BENCHMARKS = ${BUILD_BENCHMARKS}" ) message( " BUILD_EXAMPLES = ${BUILD_EXAMPLES}" ) message( " BUILD_TOOLS = ${BUILD_TOOLS}" ) message( " BUILD_TESTS = ${BUILD_TESTS}" ) message( " BUILD_MATRIX_TESTS = ${BUILD_MATRIX_TESTS}" ) message( " BUILD_PYTHON = ${BUILD_PYTHON}" ) message( " BUILD_DOC = ${BUILD_DOC}" ) # Print compiler options message( "-- Compiler options:" ) message( " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" ) Loading build +132 −81 Original line number Diff line number Diff line Loading @@ -22,53 +22,81 @@ WITH_CUDA="yes" WITH_CUDA_ARCH="auto" WITH_OPENMP="yes" WITH_GMP="no" WITH_TESTS="yes" WITH_MATRIX_TESTS="yes" WITH_CI_FLAGS="no" # flags affecting only tests RUN_TESTS="yes" # whether to run tests if they were compiled (coverage script sets it to no) TESTS_JOBS="4" WITH_PROFILING="no" WITH_COVERAGE="no" WITH_DOC="yes" WITH_EXAMPLES="yes" WITH_PYTHON="yes" WITH_TOOLS="yes" WITH_BENCHMARKS="yes" WITH_CI_FLAGS="no" # targets BUILD_BENCHMARKS="no" BUILD_EXAMPLES="no" BUILD_PYTHON="no" BUILD_TOOLS="no" BUILD_TESTS="no" BUILD_MATRIX_TESTS="no" BUILD_DOC="no" function print_usage() { cat << EOF usage: $0 [options] [target ...] By default, the script does not select any target. Build targets available for selection are listed below. If the --install option is used, the TNL header files as well as the selected targets will be installed into the directory specified by the --prefix option. Targets: all Special target which includes all other targets. benchmarks Compile the 'src/Benchmarks' directory. examples Compile the 'src/Examples' directory. tools Compile the 'src/Tools' directory. tests Compile unit tests in the 'src/UnitTests' directory (except tests for matrix formats, which have a separate target). matrix-tests Compile unit tests for matrix formats. python Compile the Python bindings. doc Generate the documentation. General options: --help Write this help list and exit. --verbose Enables verbose build. --install=yes/no Enables the installation of TNL files. '$INSTALL' by default. --prefix=PATH Prefix for the installation directory. '$HOME/local' by default. Options affecting all targets: --offline-build=yes/no Disables online updates during the build. '$OFFLINE_BUILD' by default. --build=Debug/Release Build type. --build-jobs=NUM Number of processes to be used for the build. It is set to the number of available CPU cores by default. --cmake=CMAKE Path to the cmake command. '$CMAKE' by default. --cmake-only=yes/no Run only the cmake command, don't actually build anything. '$CMAKE_ONLY' by default. --compiler=gcc/clang/icc Selects the compiler to use. '$COMPILER' by default. --dcmtk-dir=PATH Path to the DCMTK (Dicom Toolkit) root dir. '$DCMTK_DIR' by default. --with-mpi=yes/no Enables MPI. '$WITH_MPI' by default (OpenMPI required). --with-cuda=yes/no Enables CUDA. '$WITH_CUDA' by default (CUDA Toolkit is required). --with-cuda-arch=all/auto/3.0/3.5/... Chooses CUDA architecture. '$WITH_CUDA_ARCH' by default. --with-openmp=yes/no Enables OpenMP. '$WITH_OPENMP' by default. --with-gmp=yes/no Enables the wrapper for GNU Multiple Precision Arithmetic Library. '$WITH_GMP' by default. --with-profiling=yes/no Enables code profiling compiler flags. '$WITH_PROFILING' by default. Options for the 'tests' and 'matrix-tests' targets: --run-tests=yes/no Runs unit tests if they were compiled. '$RUN_TESTS' by default. --tests-jobs=NUM Number of processes to be used for the unit tests. It is $TEST_JOBS by default. --with-coverage=yes/no Enables code coverage reports for unit tests (lcov is required). '$WITH_COVERAGE' by default. EOF } # handle --help first for option in "$@"; do if [[ "$option" == "--help" ]]; then echo "TNL build options:" echo "" echo " --help Write this help list and exit." echo " --build=Debug/Release Build type." echo " --build-jobs=NUM Number of processes to be used for the build. It is set to the number of available CPU cores by default." echo " --verbose Enables verbose build." echo " --offline-build=yes/no Disables online updates during the build. '$OFFLINE_BUILD' by default." echo " --install=yes/no Enables the installation of TNL files. '$INSTALL' by default." echo " --prefix=PATH Prefix for the installation directory. '$HOME/local' by default." echo " --cmake=CMAKE Path to the cmake command. '$CMAKE' by default." echo " --cmake-only=yes/no Run only the cmake command, don't actually build anything. '$CMAKE_ONLY' by default." echo " --compiler=gcc/clang/icc Selects the compiler to use. '$COMPILER' by default." echo " --dcmtk-dir=PATH Path to the DCMTK (Dicom Toolkit) root dir. '$DCMTK_DIR' by default." echo " --with-mpi=yes/no Enables MPI. '$WITH_MPI' by default (OpenMPI required)." echo " --with-cuda=yes/no Enables CUDA. '$WITH_CUDA' by default (CUDA Toolkit is required)." echo " --with-cuda-arch=all/auto/3.0/3.5/... Chooses CUDA architecture. '$WITH_CUDA_ARCH' by default." echo " --with-openmp=yes/no Enables OpenMP. '$WITH_OPENMP' by default." echo " --with-gmp=yes/no Enables the wrapper for GNU Multiple Precision Arithmetic Library. '$WITH_GMP' by default." echo " --with-tests=yes/no Enables compilation of unit tests. '$WITH_TESTS' by default." echo " --run-tests=yes/no Runs unit tests if they were compiled. '$RUN_TESTS' by default." echo " --tests-jobs=NUM Number of processes to be used for the unit tests. It is $TEST_JOBS by default." echo " --with-profiling=yes/no Enables code profiling compiler flags. '$WITH_PROFILING' by default." echo " --with-coverage=yes/no Enables code coverage reports for unit tests (lcov is required). '$WITH_COVERAGE' by default." echo " --with-doc=yes/no Generate the documentation. '$WITH_DOC' by default." echo " --with-examples=yes/no Compile the 'src/Examples' directory. '$WITH_EXAMPLES' by default." echo " --with-python=yes/no Compile the Python bindings. '$WITH_PYTHON' by default." echo " --with-tools=yes/no Compile the 'src/Tools' directory. '$WITH_TOOLS' by default." echo " --with-benchmarks=yes/no Compile the 'src/Benchmarks' directory. '$WITH_BENCHMARKS' by default." print_usage exit 1 fi done # handle options for option in "$@"; do case "$option" in --build=* ) BUILD="${option#*=}" ;; Loading @@ -86,22 +114,45 @@ for option in "$@"; do --with-cuda-arch=* ) WITH_CUDA_ARCH="${option#*=}";; --with-openmp=* ) WITH_OPENMP="${option#*=}" ;; --with-gmp=* ) WITH_GMP="${option#*=}" ;; --with-tests=* ) WITH_TESTS="${option#*=}" ;; --with-matrix-tests=* ) WITH_MATRIX_TESTS="${option#*=}" ;; --run-tests=* ) RUN_TESTS="${option#*=}" ;; --tests-jobs=* ) TESTS_JOBS="${option#*=}" ;; --with-profiling=* ) WITH_PROFILING="${option#*=}" ;; --with-coverage=* ) WITH_COVERAGE="${option#*=}" ;; --with-doc=* ) WITH_DOC="${option#*=}" ;; --with-examples=* ) WITH_EXAMPLES="${option#*=}" ;; --with-tools=* ) WITH_TOOLS="${option#*=}" ;; --with-benchmarks=* ) WITH_BENCHMARKS="${option#*=}" ;; --with-python=* ) WITH_PYTHON="${option#*=}" ;; --with-ci-flags=* ) WITH_CI_FLAGS="${option#*=}" ;; -* ) echo "Unknown option $option. Use --help for more information." >&2 exit 1 ;; *) break ;; esac shift done # handle targets for target in "$@"; do case "$target" in all) BUILD_BENCHMARKS="yes" BUILD_EXAMPLES="yes" BUILD_TOOLS="yes" BUILD_TESTS="yes" BUILD_MATRIX_TESTS="yes" BUILD_PYTHON="yes" BUILD_DOC="yes" ;; benchmarks) BUILD_BENCHMARKS="yes" ;; examples) BUILD_EXAMPLES="yes" ;; tools) BUILD_TOOLS="yes" ;; tests) BUILD_TESTS="yes" ;; matrix-tests) BUILD_MATRIX_TESTS="yes" ;; python) BUILD_PYTHON="yes" ;; doc) BUILD_DOC="yes" ;; *) echo "Unknown option ${option}. Use --help for more information." >&2 echo "Unknown target $target. The available targets are: all, benchmarks, examples, tools, tests, matrix-tests, python, doc." >&2 echo "Use --help for more information." >&2 exit 1 esac shift done if [[ "$COMPILER" == "gcc" ]]; then Loading Loading @@ -141,23 +192,23 @@ cmake_command=( -G "${generator}" -DCMAKE_BUILD_TYPE=${BUILD} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DDCMTK_DIR=${DCMTK_DIR} -DOFFLINE_BUILD=${OFFLINE_BUILD} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} -DWITH_OPENMP=${WITH_OPENMP} -DWITH_MPI=${WITH_MPI} -DWITH_GMP=${WITH_GMP} -DWITH_TESTS=${WITH_TESTS} -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_PROFILING=${WITH_PROFILING} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_DOC=${WITH_DOC} -DWITH_EXAMPLES=${WITH_EXAMPLES} -DWITH_TOOLS=${WITH_TOOLS} -DWITH_PYTHON=${WITH_PYTHON} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} -DWITH_CI_FLAGS=${WITH_CI_FLAGS} -DDCMTK_DIR=${DCMTK_DIR} -DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_TOOLS=${BUILD_TOOLS} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_MATRIX_TESTS=${BUILD_MATRIX_TESTS} -DBUILD_PYTHON=${BUILD_PYTHON} -DBUILD_DOC=${BUILD_DOC} ) # Skip running cmake if it was already run and the cmake command is the same. Loading Loading @@ -224,11 +275,11 @@ if ! $make ${VERBOSE} $make_target; then exit 1 fi if [[ ${WITH_DOC} == "yes" ]]; then if [[ ${BUILD_DOC} == "yes" ]]; then "$ROOT_DIR/Documentation/build" --prefix="$PREFIX" fi if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then 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 fi Loading src/3rdparty/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ install( DIRECTORY async mpark Leksys TYPE INCLUDE MESSAGE_NEVER FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" ) if( ${WITH_PYTHON} ) if( ${BUILD_PYTHON} ) install( DIRECTORY cctbx TYPE INCLUDE MESSAGE_NEVER FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" ) Loading src/CMakeLists.txt +6 −6 Original line number Diff line number Diff line Loading @@ -11,25 +11,25 @@ add_subdirectory( TNL/Experimental ) # Note that it is important to start building examples as soon as possible, # because they take the longest time and other stuff can be pipelined before # they are finished (at least with Ninja). if( ${WITH_EXAMPLES} ) if( ${BUILD_EXAMPLES} ) add_subdirectory( Examples ) endif() if( ${WITH_BENCHMARKS} ) if( ${BUILD_BENCHMARKS} ) add_subdirectory( Benchmarks ) endif() if( ${WITH_TOOLS} ) if( ${BUILD_TOOLS} ) add_subdirectory( Tools ) endif() if( ${WITH_TESTS} ) if( ${BUILD_TESTS} ) add_subdirectory( UnitTests ) endif() if( ${WITH_MATRIX_TESTS} ) if( ${BUILD_MATRIX_TESTS} ) add_subdirectory( UnitTests/Matrices ) endif() if( ${WITH_PYTHON} ) if( ${BUILD_PYTHON} ) add_subdirectory( Python ) endif() Loading
.gitlab-ci.yml +41 −41 Original line number Diff line number Diff line Loading @@ -20,15 +20,15 @@ stages: WITH_CUDA: "no" WITH_CUDA_ARCH: "auto" WITH_MPI: "no" # configurations WITH_TESTS: "no" WITH_MATRIX_TESTS: "no" # build targets BUILD_TESTS: "no" BUILD_MATRIX_TESTS: "no" WITH_COVERAGE: "no" WITH_DOC: "no" WITH_BENCHMARKS: "no" WITH_EXAMPLES: "no" WITH_TOOLS: "no" WITH_PYTHON: "no" BUILD_DOC: "no" BUILD_BENCHMARKS: "no" BUILD_EXAMPLES: "no" BUILD_TOOLS: "no" BUILD_PYTHON: "no" # base for OpenMP+MPI builds .openmp_mpi: Loading Loading @@ -81,18 +81,18 @@ stages: -DWITH_MPI=${WITH_MPI} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} -DWITH_TESTS=${WITH_TESTS} -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_DOC=${WITH_DOC} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_MATRIX_TESTS=${BUILD_MATRIX_TESTS} -DBUILD_DOC=${BUILD_DOC} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} -DWITH_EXAMPLES=${WITH_EXAMPLES} -DWITH_TOOLS=${WITH_TOOLS} -DWITH_PYTHON=${WITH_PYTHON} -DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_TOOLS=${BUILD_TOOLS} -DBUILD_PYTHON=${BUILD_PYTHON} -DWITH_CI_FLAGS=yes # "install" implies the "all" target - ninja ${NINJAFLAGS} install - if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then - if [[ ${BUILD_TESTS} == "yes" ]] || [[ ${BUILD_MATRIX_TESTS} == "yes" ]]; then ninja test; fi - popd Loading Loading @@ -137,7 +137,7 @@ cuda_tests_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_TESTS: "yes" BUILD_TESTS: "yes" cuda_tests_Release: extends: .build_template Loading @@ -149,7 +149,7 @@ cuda_tests_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_TESTS: "yes" BUILD_TESTS: "yes" cuda_matrix_tests_Debug: Loading @@ -162,7 +162,7 @@ cuda_matrix_tests_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" cuda_matrix_tests_Release: extends: .build_template Loading @@ -174,7 +174,7 @@ cuda_matrix_tests_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" cuda_examples_Debug: Loading @@ -187,7 +187,7 @@ cuda_examples_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" cuda_examples_Release: extends: .build_template Loading @@ -199,7 +199,7 @@ cuda_examples_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" cuda_benchmarks_tools_python_Debug: Loading @@ -212,9 +212,9 @@ cuda_benchmarks_tools_python_Debug: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Debug WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" cuda_benchmarks_tools_python_Release: extends: .build_template Loading @@ -226,9 +226,9 @@ cuda_benchmarks_tools_python_Release: <<: *default_cmake_flags WITH_CUDA: "yes" BUILD_TYPE: Release WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" cuda_mpi_tests_Debug: Loading Loading @@ -280,60 +280,60 @@ default_tests_Debug: variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_TESTS: "yes" BUILD_TESTS: "yes" default_tests_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_TESTS: "yes" BUILD_TESTS: "yes" default_matrix_tests_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" default_matrix_tests_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_MATRIX_TESTS: "yes" BUILD_MATRIX_TESTS: "yes" default_examples_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" default_examples_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_EXAMPLES: "yes" BUILD_EXAMPLES: "yes" default_benchmarks_tools_python_Debug: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Debug WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" default_benchmarks_tools_python_Release: extends: .build_template variables: <<: *default_cmake_flags BUILD_TYPE: Release WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" BUILD_BENCHMARKS: "yes" BUILD_TOOLS: "yes" BUILD_PYTHON: "yes" mpi_tests_Debug: Loading Loading @@ -472,7 +472,7 @@ documentation examples: WITH_CUDA: "yes" BUILD_TYPE: Debug # build output snippets for documentation WITH_DOC: "yes" BUILD_DOC: "yes" only: changes: - Documentation/**/* Loading
CMakeLists.txt +16 −15 Original line number Diff line number Diff line Loading @@ -23,15 +23,15 @@ set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") option(WITH_OPENMP "Build with OpenMP support" ON) option(WITH_MPI "Build with MPI support" ON) option(WITH_GMP "Build with GMP support" OFF) option(WITH_TESTS "Build tests" ON) option(WITH_MATRIX_TESTS "Build tests for matrices" ON) option(WITH_PROFILING "Enable code profiling compiler flags" OFF ) option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF) option(WITH_EXAMPLES "Compile the 'src/Examples' directory" ON) option(WITH_TOOLS "Compile the 'src/Tools' directory" ON) option(WITH_BENCHMARKS "Compile the 'src/Benchmarks' directory" ON) option(WITH_PYTHON "Compile the Python bindings" ON) option(WITH_DOC "Build examples included in the documentation" ON) option(BUILD_BENCHMARKS "Compile the 'src/Benchmarks' directory" OFF) option(BUILD_EXAMPLES "Compile the 'src/Examples' directory" OFF) option(BUILD_TOOLS "Compile the 'src/Tools' directory" OFF) option(BUILD_TESTS "Build tests" OFF) option(BUILD_MATRIX_TESTS "Build tests for matrix formats" OFF) option(BUILD_PYTHON "Compile the Python bindings" OFF) option(BUILD_DOC "Build examples included in the documentation" OFF) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) Loading Loading @@ -155,7 +155,7 @@ endif() link_libraries( stdc++fs ) # gtest has to be built before we add the MPI flags if( ${WITH_TESTS} OR ${WITH_MATRIX_TESTS} ) if( ${BUILD_TESTS} OR ${BUILD_MATRIX_TESTS} ) enable_testing() # build gtest libs Loading Loading @@ -330,7 +330,7 @@ include_directories( src/3rdparty ) add_subdirectory( src ) # Add subdirectories for examples included in the documentation if( ${WITH_DOC} ) if( ${BUILD_DOC} ) set( TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH "${CMAKE_SOURCE_DIR}/Documentation/output_snippets" ) file(MAKE_DIRECTORY ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}) add_subdirectory( Documentation/Examples ) Loading Loading @@ -373,14 +373,15 @@ message( " WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" ) message( " WITH_OPENMP = ${WITH_OPENMP}" ) message( " WITH_MPI = ${WITH_MPI}" ) message( " WITH_GMP = ${WITH_GMP}" ) message( " WITH_TESTS = ${WITH_TESTS}" ) message( " WITH_MATRIX_TESTS = ${WITH_MATRIX_TESTS}" ) message( " WITH_PROFILING = ${WITH_PROFILING}" ) message( " WITH_COVERAGE = ${WITH_COVERAGE}" ) message( " WITH_EXAMPLES = ${WITH_EXAMPLES}" ) message( " WITH_TOOLS = ${WITH_TOOLS}" ) message( " WITH_BENCHMARKS = ${WITH_BENCHMARKS}" ) message( " WITH_PYTHON = ${WITH_PYTHON}" ) message( " BUILD_BENCHMARKS = ${BUILD_BENCHMARKS}" ) message( " BUILD_EXAMPLES = ${BUILD_EXAMPLES}" ) message( " BUILD_TOOLS = ${BUILD_TOOLS}" ) message( " BUILD_TESTS = ${BUILD_TESTS}" ) message( " BUILD_MATRIX_TESTS = ${BUILD_MATRIX_TESTS}" ) message( " BUILD_PYTHON = ${BUILD_PYTHON}" ) message( " BUILD_DOC = ${BUILD_DOC}" ) # Print compiler options message( "-- Compiler options:" ) message( " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" ) Loading
build +132 −81 Original line number Diff line number Diff line Loading @@ -22,53 +22,81 @@ WITH_CUDA="yes" WITH_CUDA_ARCH="auto" WITH_OPENMP="yes" WITH_GMP="no" WITH_TESTS="yes" WITH_MATRIX_TESTS="yes" WITH_CI_FLAGS="no" # flags affecting only tests RUN_TESTS="yes" # whether to run tests if they were compiled (coverage script sets it to no) TESTS_JOBS="4" WITH_PROFILING="no" WITH_COVERAGE="no" WITH_DOC="yes" WITH_EXAMPLES="yes" WITH_PYTHON="yes" WITH_TOOLS="yes" WITH_BENCHMARKS="yes" WITH_CI_FLAGS="no" # targets BUILD_BENCHMARKS="no" BUILD_EXAMPLES="no" BUILD_PYTHON="no" BUILD_TOOLS="no" BUILD_TESTS="no" BUILD_MATRIX_TESTS="no" BUILD_DOC="no" function print_usage() { cat << EOF usage: $0 [options] [target ...] By default, the script does not select any target. Build targets available for selection are listed below. If the --install option is used, the TNL header files as well as the selected targets will be installed into the directory specified by the --prefix option. Targets: all Special target which includes all other targets. benchmarks Compile the 'src/Benchmarks' directory. examples Compile the 'src/Examples' directory. tools Compile the 'src/Tools' directory. tests Compile unit tests in the 'src/UnitTests' directory (except tests for matrix formats, which have a separate target). matrix-tests Compile unit tests for matrix formats. python Compile the Python bindings. doc Generate the documentation. General options: --help Write this help list and exit. --verbose Enables verbose build. --install=yes/no Enables the installation of TNL files. '$INSTALL' by default. --prefix=PATH Prefix for the installation directory. '$HOME/local' by default. Options affecting all targets: --offline-build=yes/no Disables online updates during the build. '$OFFLINE_BUILD' by default. --build=Debug/Release Build type. --build-jobs=NUM Number of processes to be used for the build. It is set to the number of available CPU cores by default. --cmake=CMAKE Path to the cmake command. '$CMAKE' by default. --cmake-only=yes/no Run only the cmake command, don't actually build anything. '$CMAKE_ONLY' by default. --compiler=gcc/clang/icc Selects the compiler to use. '$COMPILER' by default. --dcmtk-dir=PATH Path to the DCMTK (Dicom Toolkit) root dir. '$DCMTK_DIR' by default. --with-mpi=yes/no Enables MPI. '$WITH_MPI' by default (OpenMPI required). --with-cuda=yes/no Enables CUDA. '$WITH_CUDA' by default (CUDA Toolkit is required). --with-cuda-arch=all/auto/3.0/3.5/... Chooses CUDA architecture. '$WITH_CUDA_ARCH' by default. --with-openmp=yes/no Enables OpenMP. '$WITH_OPENMP' by default. --with-gmp=yes/no Enables the wrapper for GNU Multiple Precision Arithmetic Library. '$WITH_GMP' by default. --with-profiling=yes/no Enables code profiling compiler flags. '$WITH_PROFILING' by default. Options for the 'tests' and 'matrix-tests' targets: --run-tests=yes/no Runs unit tests if they were compiled. '$RUN_TESTS' by default. --tests-jobs=NUM Number of processes to be used for the unit tests. It is $TEST_JOBS by default. --with-coverage=yes/no Enables code coverage reports for unit tests (lcov is required). '$WITH_COVERAGE' by default. EOF } # handle --help first for option in "$@"; do if [[ "$option" == "--help" ]]; then echo "TNL build options:" echo "" echo " --help Write this help list and exit." echo " --build=Debug/Release Build type." echo " --build-jobs=NUM Number of processes to be used for the build. It is set to the number of available CPU cores by default." echo " --verbose Enables verbose build." echo " --offline-build=yes/no Disables online updates during the build. '$OFFLINE_BUILD' by default." echo " --install=yes/no Enables the installation of TNL files. '$INSTALL' by default." echo " --prefix=PATH Prefix for the installation directory. '$HOME/local' by default." echo " --cmake=CMAKE Path to the cmake command. '$CMAKE' by default." echo " --cmake-only=yes/no Run only the cmake command, don't actually build anything. '$CMAKE_ONLY' by default." echo " --compiler=gcc/clang/icc Selects the compiler to use. '$COMPILER' by default." echo " --dcmtk-dir=PATH Path to the DCMTK (Dicom Toolkit) root dir. '$DCMTK_DIR' by default." echo " --with-mpi=yes/no Enables MPI. '$WITH_MPI' by default (OpenMPI required)." echo " --with-cuda=yes/no Enables CUDA. '$WITH_CUDA' by default (CUDA Toolkit is required)." echo " --with-cuda-arch=all/auto/3.0/3.5/... Chooses CUDA architecture. '$WITH_CUDA_ARCH' by default." echo " --with-openmp=yes/no Enables OpenMP. '$WITH_OPENMP' by default." echo " --with-gmp=yes/no Enables the wrapper for GNU Multiple Precision Arithmetic Library. '$WITH_GMP' by default." echo " --with-tests=yes/no Enables compilation of unit tests. '$WITH_TESTS' by default." echo " --run-tests=yes/no Runs unit tests if they were compiled. '$RUN_TESTS' by default." echo " --tests-jobs=NUM Number of processes to be used for the unit tests. It is $TEST_JOBS by default." echo " --with-profiling=yes/no Enables code profiling compiler flags. '$WITH_PROFILING' by default." echo " --with-coverage=yes/no Enables code coverage reports for unit tests (lcov is required). '$WITH_COVERAGE' by default." echo " --with-doc=yes/no Generate the documentation. '$WITH_DOC' by default." echo " --with-examples=yes/no Compile the 'src/Examples' directory. '$WITH_EXAMPLES' by default." echo " --with-python=yes/no Compile the Python bindings. '$WITH_PYTHON' by default." echo " --with-tools=yes/no Compile the 'src/Tools' directory. '$WITH_TOOLS' by default." echo " --with-benchmarks=yes/no Compile the 'src/Benchmarks' directory. '$WITH_BENCHMARKS' by default." print_usage exit 1 fi done # handle options for option in "$@"; do case "$option" in --build=* ) BUILD="${option#*=}" ;; Loading @@ -86,22 +114,45 @@ for option in "$@"; do --with-cuda-arch=* ) WITH_CUDA_ARCH="${option#*=}";; --with-openmp=* ) WITH_OPENMP="${option#*=}" ;; --with-gmp=* ) WITH_GMP="${option#*=}" ;; --with-tests=* ) WITH_TESTS="${option#*=}" ;; --with-matrix-tests=* ) WITH_MATRIX_TESTS="${option#*=}" ;; --run-tests=* ) RUN_TESTS="${option#*=}" ;; --tests-jobs=* ) TESTS_JOBS="${option#*=}" ;; --with-profiling=* ) WITH_PROFILING="${option#*=}" ;; --with-coverage=* ) WITH_COVERAGE="${option#*=}" ;; --with-doc=* ) WITH_DOC="${option#*=}" ;; --with-examples=* ) WITH_EXAMPLES="${option#*=}" ;; --with-tools=* ) WITH_TOOLS="${option#*=}" ;; --with-benchmarks=* ) WITH_BENCHMARKS="${option#*=}" ;; --with-python=* ) WITH_PYTHON="${option#*=}" ;; --with-ci-flags=* ) WITH_CI_FLAGS="${option#*=}" ;; -* ) echo "Unknown option $option. Use --help for more information." >&2 exit 1 ;; *) break ;; esac shift done # handle targets for target in "$@"; do case "$target" in all) BUILD_BENCHMARKS="yes" BUILD_EXAMPLES="yes" BUILD_TOOLS="yes" BUILD_TESTS="yes" BUILD_MATRIX_TESTS="yes" BUILD_PYTHON="yes" BUILD_DOC="yes" ;; benchmarks) BUILD_BENCHMARKS="yes" ;; examples) BUILD_EXAMPLES="yes" ;; tools) BUILD_TOOLS="yes" ;; tests) BUILD_TESTS="yes" ;; matrix-tests) BUILD_MATRIX_TESTS="yes" ;; python) BUILD_PYTHON="yes" ;; doc) BUILD_DOC="yes" ;; *) echo "Unknown option ${option}. Use --help for more information." >&2 echo "Unknown target $target. The available targets are: all, benchmarks, examples, tools, tests, matrix-tests, python, doc." >&2 echo "Use --help for more information." >&2 exit 1 esac shift done if [[ "$COMPILER" == "gcc" ]]; then Loading Loading @@ -141,23 +192,23 @@ cmake_command=( -G "${generator}" -DCMAKE_BUILD_TYPE=${BUILD} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DDCMTK_DIR=${DCMTK_DIR} -DOFFLINE_BUILD=${OFFLINE_BUILD} -DWITH_CUDA=${WITH_CUDA} -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} -DWITH_OPENMP=${WITH_OPENMP} -DWITH_MPI=${WITH_MPI} -DWITH_GMP=${WITH_GMP} -DWITH_TESTS=${WITH_TESTS} -DWITH_MATRIX_TESTS=${WITH_MATRIX_TESTS} -DWITH_PROFILING=${WITH_PROFILING} -DWITH_COVERAGE=${WITH_COVERAGE} -DWITH_DOC=${WITH_DOC} -DWITH_EXAMPLES=${WITH_EXAMPLES} -DWITH_TOOLS=${WITH_TOOLS} -DWITH_PYTHON=${WITH_PYTHON} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} -DWITH_CI_FLAGS=${WITH_CI_FLAGS} -DDCMTK_DIR=${DCMTK_DIR} -DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_TOOLS=${BUILD_TOOLS} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_MATRIX_TESTS=${BUILD_MATRIX_TESTS} -DBUILD_PYTHON=${BUILD_PYTHON} -DBUILD_DOC=${BUILD_DOC} ) # Skip running cmake if it was already run and the cmake command is the same. Loading Loading @@ -224,11 +275,11 @@ if ! $make ${VERBOSE} $make_target; then exit 1 fi if [[ ${WITH_DOC} == "yes" ]]; then if [[ ${BUILD_DOC} == "yes" ]]; then "$ROOT_DIR/Documentation/build" --prefix="$PREFIX" fi if [[ ${WITH_TESTS} == "yes" ]] || [[ ${WITH_MATRIX_TESTS} == "yes" ]]; then 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 fi Loading
src/3rdparty/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ install( DIRECTORY async mpark Leksys TYPE INCLUDE MESSAGE_NEVER FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" ) if( ${WITH_PYTHON} ) if( ${BUILD_PYTHON} ) install( DIRECTORY cctbx TYPE INCLUDE MESSAGE_NEVER FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" ) Loading
src/CMakeLists.txt +6 −6 Original line number Diff line number Diff line Loading @@ -11,25 +11,25 @@ add_subdirectory( TNL/Experimental ) # Note that it is important to start building examples as soon as possible, # because they take the longest time and other stuff can be pipelined before # they are finished (at least with Ninja). if( ${WITH_EXAMPLES} ) if( ${BUILD_EXAMPLES} ) add_subdirectory( Examples ) endif() if( ${WITH_BENCHMARKS} ) if( ${BUILD_BENCHMARKS} ) add_subdirectory( Benchmarks ) endif() if( ${WITH_TOOLS} ) if( ${BUILD_TOOLS} ) add_subdirectory( Tools ) endif() if( ${WITH_TESTS} ) if( ${BUILD_TESTS} ) add_subdirectory( UnitTests ) endif() if( ${WITH_MATRIX_TESTS} ) if( ${BUILD_MATRIX_TESTS} ) add_subdirectory( UnitTests/Matrices ) endif() if( ${WITH_PYTHON} ) if( ${BUILD_PYTHON} ) add_subdirectory( Python ) endif()