diff --git a/.github/workflows/centos-ci.yml b/.github/workflows/centos-ci.yml index 091924130..14755f2c5 100644 --- a/.github/workflows/centos-ci.yml +++ b/.github/workflows/centos-ci.yml @@ -22,7 +22,7 @@ jobs: yum -y update yum -y install centos-release-scl epel-release yum -y install man wget environment-modules libXt-devel libXext-devel ninja-build make \ - devtoolset-8-gcc* numactl-devel openmpi3-devel freeglut-devel \ + devtoolset-10-gcc* numactl-devel openmpi3-devel freeglut-devel \ scl-utils which xorg-x11-server-Xvfb fontconfig mesa-dri-drivers yum -y install @development zlib-devel bzip2 bzip2-devel readline-devel sqlite \ sqlite-devel openssl-devel xz xz-devel libffi-devel findutils lapack-devel blas-devel @@ -85,7 +85,7 @@ jobs: eval "$(pyenv init --path)" eval "$(pyenv init -)" pyenv shell 3.9.1 - . scl_source enable devtoolset-8 || true + . scl_source enable devtoolset-10 || true . /etc/profile.d/modules.sh || true module load mpi cmake -G Ninja \ diff --git a/.github/workflows/centos-system-ci.yml b/.github/workflows/centos-system-ci.yml index 4d63b0156..3677a714b 100644 --- a/.github/workflows/centos-system-ci.yml +++ b/.github/workflows/centos-system-ci.yml @@ -118,7 +118,7 @@ jobs: eval "$(pyenv init --path)" eval "$(pyenv init -)" pyenv shell 3.9.1 - . scl_source enable devtoolset-8 || true + . scl_source enable devtoolset-10 || true . /etc/profile.d/modules.sh || true module load mpi cmake \ @@ -140,7 +140,7 @@ jobs: # eval "$(pyenv init --path)" # eval "$(pyenv init -)" # pyenv shell 3.9.1 - # . scl_source enable devtoolset-8 || true + # . scl_source enable devtoolset-10 || true # . /etc/profile.d/modules.sh || true # module load mpi # cmake \ diff --git a/.github/workflows/gitpod.yml b/.github/workflows/gitpod.yml index 4b459e701..54a7885e2 100644 --- a/.github/workflows/gitpod.yml +++ b/.github/workflows/gitpod.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'LukasBreitwieser/gitpod-vnc' ref: master diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index b161116b4..4a99484a4 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -14,38 +14,39 @@ jobs: build: strategy: matrix: - os: [macos-12, macos-13] + os: [macos-12, macos-13, macos-14] runs-on: ${{ matrix.os }} steps: - - name: Make sure Xcode 14.1 is used on macOS 12 as the default /Application/Xcode.app + - name: Make sure Xcode 14.2 is used on macOS 12 as the default /Application/Xcode.app shell: bash run: | sudo mv /Applications/Xcode.app /Applications/Xcode.app- - sudo ln -s /Applications/Xcode_14.1.app /Applications/Xcode.app + sudo ln -s /Applications/Xcode_14.2.app /Applications/Xcode.app sudo xcode-select -s /Applications/Xcode.app/Contents/Developer if: matrix.os == 'macos-12' - - name: Make sure Xcode 13.1 is used on macOS 11 as the default /Application/Xcode.app + - name: Make sure Xcode 15.2 is used on macOS 13 as the default /Application/Xcode.app shell: bash run: | sudo mv /Applications/Xcode.app /Applications/Xcode.app- - sudo ln -s /Applications/Xcode_13.1.app /Applications/Xcode.app + sudo ln -s /Applications/Xcode_15.2.app /Applications/Xcode.app sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-13' - name: Install dependencies run: | + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install libomp open-mpi python@3.9 wget cmake ninja qt@5 libgit2 - name: Checkout BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # - name: Cache Third Party Packages - # uses: actions/cache@v2 + # uses: actions/cache@v4 # with: # path: build/third_party # key: ${{ runner.os }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} diff --git a/.github/workflows/macos-system-ci.yml b/.github/workflows/macos-system-ci.yml index 2d6ba7b5b..4ab5e8336 100644 --- a/.github/workflows/macos-system-ci.yml +++ b/.github/workflows/macos-system-ci.yml @@ -21,26 +21,26 @@ jobs: build: strategy: matrix: - os: [macos-12, macos-13] + os: [macos-12, macos-13, macos-14] runs-on: ${{ matrix.os }} steps: - - name: Make sure Xcode 14.1 is used on macOS 12 as the default /Application/Xcode.app + - name: Make sure Xcode 14.2 is used on macOS 12 as the default /Application/Xcode.app shell: zsh {0} run: | sudo mv /Applications/Xcode.app /Applications/Xcode.app- - sudo ln -s /Applications/Xcode_14.1.app /Applications/Xcode.app + sudo ln -s /Applications/Xcode_14.2.app /Applications/Xcode.app sudo xcode-select -s /Applications/Xcode.app/Contents/Developer if: matrix.os == 'macos-12' - - - name: Make sure Xcode 13.1 is used on macOS 11 as the default /Application/Xcode.app + + - name: Make sure Xcode 15.2 is used on macOS 13 as the default /Application/Xcode.app shell: bash run: | sudo mv /Applications/Xcode.app /Applications/Xcode.app- - sudo ln -s /Applications/Xcode_13.1.app /Applications/Xcode.app + sudo ln -s /Applications/Xcode_15.2.app /Applications/Xcode.app sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-13' - name: Set GHA_BRANCH_NAME run: | @@ -67,7 +67,7 @@ jobs: find /tmp -iname biodynamo -type d || true - name: Checkout BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -84,7 +84,7 @@ jobs: fi # - name: Cache Third Party Packages - # uses: actions/cache@v2 + # uses: actions/cache@v4 # with: # path: build/third_party # key: ${{ runner.os }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} diff --git a/.github/workflows/repository-checks.yml b/.github/workflows/repository-checks.yml index cb21e15eb..0771c9b99 100644 --- a/.github/workflows/repository-checks.yml +++ b/.github/workflows/repository-checks.yml @@ -19,7 +19,7 @@ jobs: sudo apt install clang-format - name: Checkout BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run clang-format code style check run: | diff --git a/.github/workflows/singularity-integration.yml b/.github/workflows/singularity-integration.yml index e86b6ceb6..9e2ae0fd1 100644 --- a/.github/workflows/singularity-integration.yml +++ b/.github/workflows/singularity-integration.yml @@ -19,7 +19,7 @@ jobs: image: quay.io/singularity/singularity:v3.9.0 options: "--privileged --workdir /data" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Add root user to subuid and subgid... run: | diff --git a/.github/workflows/sonar-source.yml b/.github/workflows/sonar-source.yml index e8cd3c320..818a2c0e7 100644 --- a/.github/workflows/sonar-source.yml +++ b/.github/workflows/sonar-source.yml @@ -19,7 +19,7 @@ jobs: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: - name: Download BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install sonar-scanner and build-wrapper diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index cda354bb6..eb4f1880c 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -52,7 +52,7 @@ jobs: echo "OSVERS=$ID-$VERSION" >> $GITHUB_ENV - name: Cache pyenv - uses: actions/cache@v2 + uses: actions/cache@v4 id: pyenv-cache with: path: ~/.pyenv @@ -71,12 +71,12 @@ jobs: pyenv shell 3.9.1 - name: Checkout BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Cache Third Party Packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: build/third_party key: ${{ env.OSVERS }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} diff --git a/.github/workflows/ubuntu-system-ci.yml b/.github/workflows/ubuntu-system-ci.yml index 08f7c9097..10e946ccc 100644 --- a/.github/workflows/ubuntu-system-ci.yml +++ b/.github/workflows/ubuntu-system-ci.yml @@ -64,7 +64,7 @@ jobs: find /tmp -iname biodynamo -type d || true - name: Checkout BioDynaMo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -78,7 +78,7 @@ jobs: fi - name: Cache pyenv - uses: actions/cache@v2 + uses: actions/cache@v4 id: pyenv-cache with: path: ~/.pyenv @@ -99,7 +99,7 @@ jobs: pyenv shell 3.9.1 - name: Cache Third Party Packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: build/third_party key: ${{ env.OSVERS }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} @@ -115,7 +115,8 @@ jobs: fi # Don't do this in the `Build BioDynaMo step`, because notebooks might time out in GHA - # runners, while waiting for other targets to be compiled + # runners, while waiting for other targets to be compiled. Run notebooks only + # if the event is a pull request, and on ubuntu-22.04. - name: Run notebooks shell: bash run: | @@ -126,11 +127,13 @@ jobs: cmake \ -Dnotebooks=ON \ -Dsbml=OFF \ + -Dnuma=OFF \ -DCMAKE_BUILD_TYPE=Release \ -Dreal_t=${{ env.REALT }} \ -B build cmake --build build --parallel --config Release --target notebooks -- -j1 - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-22.04' + - name: Build BioDynaMo shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index e53b7e31e..737cc26da 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,10 +148,6 @@ if(APPLE) foreach(_prefix /sw /opt/local) list(APPEND CMAKE_IGNORE_PATH ${_prefix}/bin ${_prefix}/include ${_prefix}/lib) endforeach() - - # Silence std::experimental::filesystem warning on MacOS. - # Remove after update to c++17 - add_definitions("-D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM") endif() if(UNIX AND NOT APPLE) @@ -167,6 +163,12 @@ if(real_t) add_definitions("-DBDM_REALT=${real_t}") add_definitions("-DBDM_CL_REALT=cl_${real_t}") set(BDM_CONFIG_REALT "${real_t}") + if(notebooks AND real_t STREQUAL "float") + # This if statement turns of the notebooks when we run with real_t=float. + # Currently, the notebooks do not support BDM with float for unknown reasons. + message(WARNING "Notebooks are not supported with real_t=float. Disabling notebooks.") + set(notebooks OFF) + endif() else() message(STATUS "Using default real_t (double)") set(BDM_CONFIG_REALT "float") @@ -580,15 +582,12 @@ file(GLOB_RECURSE KERNELS "${CMAKE_SOURCE_DIR}/src/*.cu") filter_list(LIB_SOURCES "${LIB_SOURCES}" "paraview/*") filter_list(HEADERS "${HEADERS}" "paraview/*") -# NB: Remove stdc++fs after switching to c++17 -if (LINUX) - set(FS_LIB stdc++fs) -endif() build_shared_library(biodynamo SELECTION selection-libbiodynamo.xml SOURCES ${LIB_SOURCES} HEADERS ${HEADERS} - LIBRARIES ${BDM_REQUIRED_LIBRARIES} ${ROOT_LIBRARIES} ${FS_LIB}) + LIBRARIES ${BDM_REQUIRED_LIBRARIES} ${ROOT_LIBRARIES}) + # libbiodynamo must be built before optimlib; otherwise optimlib could be missing during # the linking stage of libbiodynamo add_dependencies(biodynamo optim) @@ -651,7 +650,7 @@ if (CUDA_FOUND) message("CUDA Debug mode") set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -g -G -O0" ) endif() - set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11") + set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++17") target_link_libraries(biodynamo ${CUDA_LIBRARIES}) cuda_include_directories(${CUDA_INCLUDE_DIRS} ${CUDA_TOOLKIT_ROOT_DIR}) @@ -714,11 +713,12 @@ if (test) ${CMAKE_SOURCE_DIR}/test/unit/core/visualization/*.h ${CMAKE_SOURCE_DIR}/test/unit/core/visualization/paraview/*.h ${CMAKE_SOURCE_DIR}/test/unit/neuroscience/*.h) - # NB: Remove stdc++fs after switching to c++17 + bdm_add_test_executable(biodynamo-unit-tests SOURCES ${TEST_SOURCES} HEADERS ${TEST_HEADERS} - LIBRARIES ${REQUIRED_PARAVIEW_LIBRARIES} ${FS_LIB}) + LIBRARIES ${REQUIRED_PARAVIEW_LIBRARIES}) + # separate test binaries - each source file is compiled into a separate binary # file(GLOB TEST_SOURCES ${CMAKE_SOURCE_DIR}/test/unit/separate_binary/*.cc) # file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/empty_header.h "") diff --git a/cmake/CheckCompiler.cmake b/cmake/CheckCompiler.cmake index 8ab43655f..23764f6c8 100644 --- a/cmake/CheckCompiler.cmake +++ b/cmake/CheckCompiler.cmake @@ -25,15 +25,15 @@ else() IF(${DETECTED_OS} MATCHES "centos.*") if (NOT DEFINED ENV{CXX}) UNSET(CMAKE_CXX_COMPILER CACHE) - SET(CMAKE_CXX_COMPILER "/opt/rh/devtoolset-8/root/usr/bin/g++") - link_directories(/opt/rh/devtoolset-8/root/usr/lib) - link_directories(/opt/rh/devtoolset-8/root/usr/lib/dyninst) - link_directories(/opt/rh/devtoolset-8/root/usr/lib64) - link_directories(/opt/rh/devtoolset-8/root/usr/lib64/dyninst) + SET(CMAKE_CXX_COMPILER "/opt/rh/devtoolset-10/root/usr/bin/g++") + link_directories(/opt/rh/devtoolset-10/root/usr/lib) + link_directories(/opt/rh/devtoolset-10/root/usr/lib/dyninst) + link_directories(/opt/rh/devtoolset-10/root/usr/lib64) + link_directories(/opt/rh/devtoolset-10/root/usr/lib64/dyninst) endif() if (NOT DEFINED ENV{CC}) UNSET(CMAKE_C_COMPILER CACHE) - SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-8/root/usr/bin/gcc") + SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-10/root/usr/bin/gcc") endif() enable_language(CXX) endif() @@ -47,7 +47,7 @@ else() IF(${DETECTED_OS} MATCHES "centos.*") if (NOT DEFINED ENV{CC}) UNSET(CMAKE_C_COMPILER CACHE) - SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-8/root/usr/bin/gcc") + SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-10/root/usr/bin/gcc") endif() endif() enable_language(C) diff --git a/cmake/SetCompilerFlags.cmake b/cmake/SetCompilerFlags.cmake index 66100d603..b8038b6b7 100644 --- a/cmake/SetCompilerFlags.cmake +++ b/cmake/SetCompilerFlags.cmake @@ -14,20 +14,31 @@ # This file sets all compiler flags -# check if compiler supports C++14 +# check if compiler supports C++17 include(CheckCXXCompilerFlag) -check_cxx_compiler_flag("-std=c++14" COMPILER_SUPPORTS_CXX14) -if(NOT COMPILER_SUPPORTS_CXX14) - message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.") +check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17) +if(NOT COMPILER_SUPPORTS_CXX17) + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.") endif() -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# turn off compiler specific extensions e.g. gnu++14 +# turn off compiler specific extensions e.g. gnu++17 set(CMAKE_CXX_EXTENSIONS OFF) +# get machine architecture +execute_process(COMMAND arch OUTPUT_VARIABLE DISTRO_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + # general flags -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -m64 -fPIC ${OpenMP_CXX_FLAGS}") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-missing-braces -m64 -fPIC ${OpenMP_C_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -fPIC ${OpenMP_CXX_FLAGS}") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-missing-braces -fPIC ${OpenMP_C_FLAGS}") +if(${DISTRO_ARCH} STREQUAL "x86_64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") +endif() +if(${DISTRO_ARCH} STREQUAL "aarch64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=native") +endif() # suppress OpenCL-generated warnings if (OPENCL_FOUND) diff --git a/cmake/env/thisbdm.fish b/cmake/env/thisbdm.fish index e89938353..e8d65814f 100755 --- a/cmake/env/thisbdm.fish +++ b/cmake/env/thisbdm.fish @@ -426,7 +426,7 @@ function source_thisbdm if test "$os_id" = 'centos' set -gx MESA_GL_VERSION_OVERRIDE "3.3" if test -z "$CXX"; and test -z "$CC" - . scl_source enable devtoolset-8; or return 1 + . scl_source enable devtoolset-10; or return 1 end . /etc/profile.d/modules.sh; or return 1 diff --git a/cmake/env/thisbdm.sh b/cmake/env/thisbdm.sh index e6cbe23b2..7f2db183c 100755 --- a/cmake/env/thisbdm.sh +++ b/cmake/env/thisbdm.sh @@ -554,7 +554,7 @@ _source_thisbdm() if [ "$os_id" = 'centos' ]; then export MESA_GL_VERSION_OVERRIDE=3.3 if [ -z "${CXX}" ] && [ -z "${CC}" ] ; then - . scl_source enable devtoolset-8 || return 1 + . scl_source enable devtoolset-10 || return 1 fi . /etc/profile.d/modules.sh || return 1 module load mpi || return 1 diff --git a/cmake/external/ROOT.cmake b/cmake/external/ROOT.cmake index a4c8d2a43..4be6d2b11 100644 --- a/cmake/external/ROOT.cmake +++ b/cmake/external/ROOT.cmake @@ -3,7 +3,7 @@ include(utils) # Directory in which ROOT will be downloaded SET(ROOT_SOURCE_DIR "${CMAKE_THIRD_PARTY_DIR}/root") -set(ROOT_TAR_FILE root_v6.22.06_python3.9_${DETECTED_OS_VERS}.tar.gz) +set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_${DETECTED_OS_VERS}.tar.gz) set(ROOT_SHA_KEY ${DETECTED_OS_VERS}-ROOT) if(APPLE) if("${DETECTED_OS_VERS}" MATCHES "^osx-14" OR @@ -14,29 +14,35 @@ if(APPLE) execute_process(COMMAND bash "-c" "xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p'" OUTPUT_VARIABLE XCODE_VERS) message(STATUS "##### XCODE version: ${XCODE_VERS}") if("${XCODE_VERS}" GREATER_EQUAL "15.0") - message(STATUS "##### Using ROOT builds for XCODE 15.0.1") - set(ROOT_TAR_FILE root_v6.28.10_cxx14_python3.9_osx-xcode-15.0.1-${DETECTED_ARCH}.tar.gz) - set(ROOT_SHA_KEY osx-xcode-15.0.1-${DETECTED_ARCH}-ROOT) + message(STATUS "##### Using ROOT builds for XCODE 15.2") + set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_osx-xcode-15.2-${DETECTED_ARCH}.tar.gz) + set(ROOT_SHA_KEY osx-xcode-15.2-${DETECTED_ARCH}-ROOT) elseif("${XCODE_VERS}" GREATER_EQUAL "14.3") message(STATUS "##### Using ROOT builds for XCODE 14.3") - set(ROOT_TAR_FILE root_v6.29.01_cxx14_python3.9_osx-xcode-14.3-${DETECTED_ARCH}.tar.gz) + set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_osx-xcode-14.3-${DETECTED_ARCH}.tar.gz) set(ROOT_SHA_KEY osx-xcode-14.3-${DETECTED_ARCH}-ROOT) + elseif("${XCODE_VERS}" GREATER_EQUAL "14.2") + message(STATUS "##### Using ROOT builds for XCODE 14.2") + set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_osx-xcode-14.2-${DETECTED_ARCH}.tar.gz) + set(ROOT_SHA_KEY osx-xcode-14.2-${DETECTED_ARCH}-ROOT) elseif("${XCODE_VERS}" GREATER_EQUAL "14.1") message(STATUS "##### Using ROOT builds for XCODE 14.1") - set(ROOT_TAR_FILE root_v6.26.06_cxx14_python3.9_osx-xcode-14.1-${DETECTED_ARCH}.tar.gz) + set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_osx-xcode-14.1-${DETECTED_ARCH}.tar.gz) set(ROOT_SHA_KEY osx-xcode-14.1-${DETECTED_ARCH}-ROOT) else() message(STATUS "##### Using ROOT builds for XCODE 13.1") - set(ROOT_TAR_FILE root_v6.25.01_cxx14_python3.9_osx-xcode-13.1-${DETECTED_ARCH}.tar.gz) + set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_osx-xcode-13.1-${DETECTED_ARCH}.tar.gz) set(ROOT_SHA_KEY osx-xcode-13.1-${DETECTED_ARCH}-ROOT) endif() elseif("${DETECTED_OS_VERS}" MATCHES "^osx-11") message(FATAL_ERROR "We officially only support the latest macOS 11 versions 11.6, 11.7.") endif() -else() - if("${DETECTED_OS_VERS}" MATCHES "^ubuntu-22") - set(ROOT_TAR_FILE root_v6.28.02_python3.9_${DETECTED_OS_VERS}.tar.gz) - endif() +#else() + #if("${DETECTED_OS_VERS}" MATCHES "^ubuntu-23" AND + #"${DETECTED_ARCH}" STREQUAL "aarch64") + #set(ROOT_SHA_KEY ubuntu-23.04-${DETECTED_ARCH}-ROOT) + #set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_ubuntu-23.04-${DETECTED_ARCH}.tar.gz) +# endif() endif() set(ROOT_SHA ${${ROOT_SHA_KEY}}) diff --git a/cmake/external/SHA256Digests.cmake b/cmake/external/SHA256Digests.cmake index 3a862724b..a9274759c 100644 --- a/cmake/external/SHA256Digests.cmake +++ b/cmake/external/SHA256Digests.cmake @@ -56,14 +56,18 @@ SET(osx-14.1-i386-ParaView d2e89df30ab0e2729b28539de37753e09c061b4c434b0a68e8055 SET(osx-14.1-arm64-ParaView 5e89b785ac0c56bbca31e2ae101a8986953e90227fe42a1ef7adcc70a0ff6fc4) SET(osx-14.2-i386-ParaView d2e89df30ab0e2729b28539de37753e09c061b4c434b0a68e80554f7fa617ccb) SET(osx-14.2-arm64-ParaView 5e89b785ac0c56bbca31e2ae101a8986953e90227fe42a1ef7adcc70a0ff6fc4) +SET(osx-14.3-i386-ParaView d2e89df30ab0e2729b28539de37753e09c061b4c434b0a68e80554f7fa617ccb) +SET(osx-14.3-arm64-ParaView 5e89b785ac0c56bbca31e2ae101a8986953e90227fe42a1ef7adcc70a0ff6fc4) SET(osx-xcode-13.1-i386-ROOT be97dd72022c8d082fbe4394f18b55c4920f20b138cfff1b5fc2b41d397ac203) SET(osx-xcode-13.1-arm64-ROOT 0a55b91c6df42d152b7943912e134f05c3872a73e73fcc129ee87fd847240ec8) SET(osx-xcode-14.1-i386-ROOT 001311608512b24535bb9710b8baf006bd00e9b0595fd6bdf900d28b1e22c395) -SET(osx-xcode-14.1-arm64-ROOT 12ad32f7d49e2c5dfd4124923bd87f49a31a670d99e390b0a9b71a8ff2f2f035) +SET(osx-xcode-14.1-arm64-ROOT fcbc0e4cdf49b8fd320f168461f8094464a1053c16a466d48aea7163686f01cb) +SET(osx-xcode-14.2-i386-ROOT db040341c9ab59d911c6e90110879495e7a9d089b41f1f52f1f56d5703d8d29a) +SET(osx-xcode-14.2-arm64-ROOT fcbc0e4cdf49b8fd320f168461f8094464a1053c16a466d48aea7163686f01cb) SET(osx-xcode-14.3-i386-ROOT c4f4c7a9848121ae19f3fe3c40c5812813ed42d9dfa7f1948f67907ed47fa083) SET(osx-xcode-14.3-arm64-ROOT 6ffcfaadd4de627cffde2e42fded9175b730769071396d7abdabeefc2714839a) -SET(osx-xcode-15.0.1-i386-ROOT a88b770a1848f41be23a6cfe166d9e4da6c73f985865fb96d473dba966fee3b4) -SET(osx-xcode-15.0.1-arm64-ROOT de60b679f09e7ccde3f5d117e728ffb28d705196935ada5b29f5cc27f2c03091) +SET(osx-xcode-15.2-i386-ROOT 3dea500451dc2c84d150a7d5f4b27d2cba3e867d7c775b744ac898f9f6e51249) +SET(osx-xcode-15.2-arm64-ROOT 677429937f13a44a088b71851f0af111509bf81a9a25a299c905b6c9f7249587) SET(ubuntu-18.04-Libroadrunner bf9293c1c95d0b65227bd7e08c0048116ba851bcec5028ef72ea13762ef79276) SET(ubuntu-18.04-ParaView e3fd74b13e9a4086988c5104c6b8d95c56365d25b491706a8e72018d0e5c76f1) @@ -73,15 +77,18 @@ SET(ubuntu-18.04-ROOT 9f5ff80c871839188cd17e5ac6227b3e55eb37a3064fecb6740afec176 SET(ubuntu-20.04-Libroadrunner bdf92f30d49f332ec5a15b53fe04c0f8ffb518db62010ee1269ba55698e1b651) SET(ubuntu-20.04-ParaView 0b87c6c79eb13b3c485a366509cf9deba06731b591f6e54b134d45afc95c8276) SET(ubuntu-20.04-Qt b2388d1bcca4e3741ab5b2b0fb95395aeb6c448951a0d3cdeb6db33b64a7d41c) -SET(ubuntu-20.04-ROOT 4bbdd467c834a3ef9f005ca351a948452a9b34c08c34f89a1bf03a6ffa1db657) +SET(ubuntu-20.04-ROOT a1654cefce7b61fcfb4ae8057296fab9166d5f8bc135891b45dff899e877742b) SET(ubuntu-22.04-Libroadrunner bdf92f30d49f332ec5a15b53fe04c0f8ffb518db62010ee1269ba55698e1b651) SET(ubuntu-22.04-ParaView afc803835973fdb8b963fe10eaf1103f2e1650e4573141964c1322053ec852cc) SET(ubuntu-22.04-Qt b2388d1bcca4e3741ab5b2b0fb95395aeb6c448951a0d3cdeb6db33b64a7d41c) -SET(ubuntu-22.04-ROOT 787d5d33654c2b316ad87d55e90198785e4b3615e9f36bb4ee66ac72a839b753) +SET(ubuntu-22.04-ROOT 24921a85b53c5cfbe9f192e523263781d595c59c9c553818349992e61efc64ac) + +SET(ubuntu-23.04-aarch64-ROOT 7d2fcaaeb1e452c38c1d8436288e3171d1b6935f5b6f25d5df16b21e00ca45d8) +SET(ubuntu-23.10-aarch64-ROOT 8f6fa9db579e011ef4ae7e96830d8ab1284b6df95a1b2f46e6a1cea56fd4626f) SET(centos-7-Libroadrunner a0b49487a28aedc4b909a71c66263d4a388964008e2b23073dd744231251470c) SET(centos-7-ParaView 45d545e75baf32c9fe30944781b4f6b172d4efd7d6cd794dcd19ec671cc5ead0) SET(centos-7-Qt 4308621ff9ec84585c3aead92a9d2de787b3c700323333b6e78ed45d04a0d2a4) -SET(centos-7-ROOT bc7c850834755896d0d669ab45caf59bdd8357284946a5d6ac7179278f6a26af) +SET(centos-7-ROOT 54298aa5f13dc2942925c10d755768f81f53d7135ac1a3e698e9b7ef1a3dfd1e) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index ba1fa5d84..9ab61f8b0 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -15,6 +15,9 @@ # Detect the system flavour and version. Generate variables # called DETECTED_OS (ubuntu-18.04, ubuntu-20.04, centos-7, osx) # and DETECTED_OS_VERS (ubuntu-18.04, ubuntu-20.04, centos-7 or osx-11.2-i386). +# In case the Linux arch is aarch64, the DETECTED_OS_VERS ends in -aarch64, +# like ubuntu-23.10-aarch64. For backward compatibility reasons we don't +# add -x86_64. function(detect_os) if(APPLE) execute_process(COMMAND sw_vers "-productVersion" @@ -40,7 +43,11 @@ function(detect_os) set(BDM_OS "${DISTRO_NAME}-${DISTRO_VERSION}") set(DETECTED_OS "${BDM_OS}" PARENT_SCOPE) set(DETECTED_ARCH "${DISTRO_ARCH}" PARENT_SCOPE) - set(DETECTED_OS_VERS "${BDM_OS}" PARENT_SCOPE) + if("${DISTRO_ARCH}" STREQUAL "aarch64") + set(DETECTED_OS_VERS "${BDM_OS}-${DISTRO_ARCH}" PARENT_SCOPE) + else() + set(DETECTED_OS_VERS "${BDM_OS}" PARENT_SCOPE) + endif() endif() endfunction() @@ -50,7 +57,7 @@ endfunction() # version (SHA256 check with builtin expected SHA256) then # a new version will be downloaded. # If a user installed ROOT is found we will check if ROOT -# was compiled using c++14. +# was compiled using c++17. function(verify_ROOT) if(ROOT_FOUND AND CMAKE_THIRD_PARTY_DIR) # check if found ROOT is BDM installed (matchres > -1) @@ -104,11 +111,11 @@ function(verify_ROOT) SET(ROOTCLING_EXECUTABLE ${ROOTCLING_EXECUTABLE} PARENT_SCOPE) SET(GENREFLEX_EXECUTABLE ${GENREFLEX_EXECUTABLE} PARENT_SCOPE) else() - # When ROOT is found, but it's not C++14 compliant, we exit the installation, because ROOT needs + # When ROOT is found, but it's not C++17 compliant, we exit the installation, because ROOT needs # to be properly sourced prior to invoking CMake (CMake cannot do this for us, because it requires # reverting the previous find_package() call, which is not possible.) - if(NOT ROOT_cxx14_FOUND) - message(FATAL_ERROR "The ROOT installation found in ${ROOTSYS} is not C++14 compliant. " + if(NOT ROOT_cxx17_FOUND) + message(FATAL_ERROR "The ROOT installation found in ${ROOTSYS} is not C++17 compliant. " "Please unset ROOTSYS and re-run cmake so that a compatible version of ROOT will be downloaded.") endif() diff --git a/demo/analytic_continuum/CMakeLists.txt b/demo/analytic_continuum/CMakeLists.txt index 96bf68475..6880c811b 100644 --- a/demo/analytic_continuum/CMakeLists.txt +++ b/demo/analytic_continuum/CMakeLists.txt @@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.19.3) project(analytic-continuum) -# BioDynaMo currently uses the C++14 standard. -set(CMAKE_CXX_STANDARD 14) +# BioDynaMo currently uses the C++17 standard. +set(CMAKE_CXX_STANDARD 17) # Use BioDynaMo in this project. find_package(BioDynaMo REQUIRED) diff --git a/demo/monolayer_growth/CMakeLists.txt b/demo/monolayer_growth/CMakeLists.txt index 9d3f93178..f0e5b50ec 100644 --- a/demo/monolayer_growth/CMakeLists.txt +++ b/demo/monolayer_growth/CMakeLists.txt @@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.19.3) project(monolayer_growth) -# BioDynaMo currently uses the C++14 standard. -set(CMAKE_CXX_STANDARD 14) +# BioDynaMo currently uses the C++17 standard. +set(CMAKE_CXX_STANDARD 17) # Use BioDynaMo in this project. find_package(BioDynaMo REQUIRED) @@ -32,4 +32,4 @@ file(GLOB_RECURSE PROJECT_SOURCES src/*.cc) bdm_add_executable(${CMAKE_PROJECT_NAME} HEADERS ${PROJECT_HEADERS} SOURCES ${PROJECT_SOURCES} - LIBRARIES ${BDM_REQUIRED_LIBRARIES}) \ No newline at end of file + LIBRARIES ${BDM_REQUIRED_LIBRARIES}) diff --git a/doc/dev_guide/build.md b/doc/dev_guide/build.md index 2f5dc6663..48fc23bf3 100644 --- a/doc/dev_guide/build.md +++ b/doc/dev_guide/build.md @@ -95,7 +95,7 @@ You will not need them in order to run the program. ```bash export MESA_GL_VERSION_OVERRIDE=3.3 -. scl_source enable devtoolset-8 +. scl_source enable devtoolset-10 . /etc/profile.d/modules.sh module load mpi @@ -113,41 +113,41 @@ cmake -Doption=value .. The value for binary options is `on` or `off`. If you change the value of these switches, you might have to delete `CMakeCache.txt` beforehand. -| Option | Default Value | Description | -| --------------- | ------------- | ------------ | -| `test` | `on` | build the test executables; precondition for e.g. `valgrind` and `coverage` | -| `dict` | `on` | build ROOT dictionaries. These are compulsory to use backups. Turning them off reduces compilation time. | -| `paraview` | `on` | Enable visualization using ParaView. Visualization cannot be used if this switch is turned off. | -| `libgit2` | `off` | Enable automatic git tracking for executed simulations (e.g. last commits and `git diff` outputs; not available on `CentOS`.). | -| `cuda` | `off` | enable CUDA code generation for GPU acceleration | -| `opencl` | `off` | enable OpenCL code generation for GPU acceleration | -| `valgrind` | `on` | enable memory leak checks | -| `coverage` | `off` | creates a make target to generate a html report indicating which parts of the code are tested by automatic tests | -| `jemalloc` | `off` | use `jemalloc` for memory allocations | -| `tcmalloc` | `off` | use `tcmalloc` for memory allocations | -| `website` | `off` | enable website generation (`make website<-live>` target (see below for more information)) | +| Option | Default Value | Description | +| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `test` | `on` | build the test executables; precondition for e.g. `valgrind` and `coverage` | +| `dict` | `on` | build ROOT dictionaries. These are compulsory to use backups. Turning them off reduces compilation time. | +| `paraview` | `on` | Enable visualization using ParaView. Visualization cannot be used if this switch is turned off. | +| `libgit2` | `off` | Enable automatic git tracking for executed simulations (e.g. last commits and `git diff` outputs; not available on `CentOS`.). | +| `cuda` | `off` | enable CUDA code generation for GPU acceleration | +| `opencl` | `off` | enable OpenCL code generation for GPU acceleration | +| `valgrind` | `on` | enable memory leak checks | +| `coverage` | `off` | creates a make target to generate a html report indicating which parts of the code are tested by automatic tests | +| `jemalloc` | `off` | use `jemalloc` for memory allocations | +| `tcmalloc` | `off` | use `tcmalloc` for memory allocations | +| `website` | `off` | enable website generation (`make website<-live>` target (see below for more information)) | ### Further CMake command line parameters -| Option | Description | -| --------------- | ------------ | -| `CMAKE_CXX_FLAGS` | specify additional compiler flags - e.g. `"-mavx"` | -| `CMAKE_BUILD_TYPE` | specify the build type. Possible values are `Debug, Release, RelWithDebInfo, MinSizeRel` | +| Option | Description | +| ------------------ | ---------------------------------------------------------------------------------------- | +| `CMAKE_CXX_FLAGS` | specify additional compiler flags - e.g. `"-mavx"` | +| `CMAKE_BUILD_TYPE` | specify the build type. Possible values are `Debug, Release, RelWithDebInfo, MinSizeRel` | ## Build Targets -| Target | Description | -| --------------- | ------------ | -| `run-unit-tests` | executes all BioDynaMo unit tests | -| `run-valgrind` | executes BioDynaMo valgrind tests | -| `run-check` | executes both unit and valgrind tests | -| `run-demos` | executes all demos and integration tests | -| `clean` | will clean all targets, also the external projects | -| `cleanbuild` | will clean everything in the build directory, except for third_party (useful for avoiding downloading third party software) | -| `bdmclean` | will only clean the `biodynamo` and `runBiodynamoTests*` targets | -| `testbdmclean` | will only clean the `runBiodynamoTests*` target | -| `doc` | will generate the API, user and developer documentation in directory `build/doc`. | -| `coverage` | will execute the test target and generate a coverage report in `build/coverage`. Make sure that `kcov` are installed and configure cmake with `cmake -Dcoverage=on ..` | +| Target | Description | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `run-unit-tests` | executes all BioDynaMo unit tests | +| `run-valgrind` | executes BioDynaMo valgrind tests | +| `run-check` | executes both unit and valgrind tests | +| `run-demos` | executes all demos and integration tests | +| `clean` | will clean all targets, also the external projects | +| `cleanbuild` | will clean everything in the build directory, except for third_party (useful for avoiding downloading third party software) | +| `bdmclean` | will only clean the `biodynamo` and `runBiodynamoTests*` targets | +| `testbdmclean` | will only clean the `runBiodynamoTests*` target | +| `doc` | will generate the API, user and developer documentation in directory `build/doc`. | +| `coverage` | will execute the test target and generate a coverage report in `build/coverage`. Make sure that `kcov` are installed and configure cmake with `cmake -Dcoverage=on ..` | | `coverage-build` | same as `make coverage`, but builds it in a separate directory (`build/coverage`). Since building the coverage report requires different compiler flags, building it in a separate directory keeps the current build directory in good order. | ### C++ Code Style Related Build Targets @@ -160,30 +160,30 @@ Build targets indicated with `*` always come in three different flavors. * `-staged`: executes the target on source files that have been staged -- e.g. `make check-format-staged` * `-all`: executes the target on all source files in the project -- e.g. `make check-format-all` -| Target | Description | -| --------------- | ------------ | -| `check-format*` | run clang-format on selected files. Fails if any file needs to be reformatted | -| `show-format*` | run clang-format on selected files and display differences | -| `format*` | run clang-format on selected files and update them in-place | -| `check-tidy*` | run clang-tidy on selected files. Fails if errors are found | -| `show-tidy*` | run clang-tidy on selected files and display errors. | -| `tidy*` | run clang-tidy on selected files and attempt to fix any warning automatically | -| `check-cpplint*` | run cpplint on selected files. Fails if errors are found and displays them. | -| `check-submission` | will build, run all tests, check formatting, code style, and generate documentation and coverage report | -| `fix-submission` | will attempt to fix the reported issues using `clang-format` and `clang-tidy`. Failing build, tests, compiler warnings, issues from cpplint and warnings from doxygen must be fixed manually. Also some `clang-tidy` issues cannot be resolved automatically | +| Target | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `check-format*` | run clang-format on selected files. Fails if any file needs to be reformatted | +| `show-format*` | run clang-format on selected files and display differences | +| `format*` | run clang-format on selected files and update them in-place | +| `check-tidy*` | run clang-tidy on selected files. Fails if errors are found | +| `show-tidy*` | run clang-tidy on selected files and display errors. | +| `tidy*` | run clang-tidy on selected files and attempt to fix any warning automatically | +| `check-cpplint*` | run cpplint on selected files. Fails if errors are found and displays them. | +| `check-submission` | will build, run all tests, check formatting, code style, and generate documentation and coverage report | +| `fix-submission` | will attempt to fix the reported issues using `clang-format` and `clang-tidy`. Failing build, tests, compiler warnings, issues from cpplint and warnings from doxygen must be fixed manually. Also some `clang-tidy` issues cannot be resolved automatically | ### Website Related Build Targets -| Target | Description | -| --------------- | ------------ | -| `website` | will generate the static files used for biodynamo.org | +| Target | Description | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `website` | will generate the static files used for biodynamo.org | | `website-live` | starts a local web server so you can immediately view the website in the browser. The website is automatically reloaded if you change a source file. | ## Advanced Build Options #### Use a Custom Compiler If you need to user a custom compilers (instead of the one automatically detected by BioDynaMo) you will need to set the variables: `CXX` for the C++ compiler and `CC` for the C compiler. -Please not that your custom compiler must support the C++14 standard and must be compatible with OpenMP. +Please not that your custom compiler must support the C++17 standard and must be compatible with OpenMP. The complete procedure will become: ```bash diff --git a/doc/user_guide/prerequisites.md b/doc/user_guide/prerequisites.md index a612595ff..f8619a80e 100644 --- a/doc/user_guide/prerequisites.md +++ b/doc/user_guide/prerequisites.md @@ -127,7 +127,7 @@ sudo apt-get install -y kcov * **cmake**: Set of tools for automate building, testing of software * **libXt-devel**: Basic library for developing X11 * **libXext-devel**: Library which contains a handful of X11 extensions - * **devtoolset-8-gcc**: Compiler suite for C and C++ + * **devtoolset-10-gcc**: Compiler suite for C and C++ * **numactl-devel**: Development files for NUMA (simple programming interface to the policy supported by the Linux kernel) * **freeglut-devel**: Development files for GLUT (OpenGL Utility Toolkit) * **openmpi3-devel**: Development files for OpenMP (API for multiprocessor programming) @@ -170,7 +170,7 @@ sudo yum update -y sudo yum -y install centos-release-scl epel-release sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm sudo yum -y install wget libXt-devel libXext-devel \ - devtoolset-8-gcc* numactl-devel \ + devtoolset-10-gcc* numactl-devel \ openmpi3-devel freeglut-devel git curl -L -O https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh diff --git a/src/core/agent/agent_pointer.h b/src/core/agent/agent_pointer.h index 107739b2c..f94a198a3 100644 --- a/src/core/agent/agent_pointer.h +++ b/src/core/agent/agent_pointer.h @@ -233,7 +233,7 @@ class AgentPointer { } } - /// Replace with std::variant once we move to >= c++17 + /// TODO. Replace with std::variant once we move to >= c++17 union Data { AgentUid uid; TAgent* agent; diff --git a/src/core/container/shared_data.h b/src/core/container/shared_data.h index 129f2f06d..45943b54c 100644 --- a/src/core/container/shared_data.h +++ b/src/core/container/shared_data.h @@ -17,15 +17,29 @@ #include <array> #include <cstdint> +#include <new> #include <vector> #include "core/util/root.h" -/// This is BioDynaMo's default cacheline size. If you system has a different -/// cacheline size, consider changing the value accordingly. When BioDynaMo -/// moves to the C++17 standard, this choice will be automated. See : -/// en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size -#define BDM_CACHE_LINE_SIZE 64u +/// This is BioDynaMo's cacheline size. If you system has a different +/// cacheline size, consider changing the value accordingly. In particular, +/// this value is used to align the data in the SharedData class to avoid false +/// sharing between threads. From C++17 on, the standard library provides +/// hardware_constructive_interference_size and +/// hardware_destructive_interference_size, which can be used instead of this +/// constant. If the standard library does not provide these constants, the +/// default value for x86-64 is used. +#ifdef __cpp_lib_hardware_interference_size +using std::hardware_constructive_interference_size; +using std::hardware_destructive_interference_size; +#else +// Default values for x86-64 +// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ +// ... +constexpr std::size_t hardware_constructive_interference_size = 64u; +constexpr std::size_t hardware_destructive_interference_size = 64u; +#endif namespace bdm { @@ -34,13 +48,13 @@ template <typename T> class SharedData { public: /// Wrapper for a chacheline-size aligned T. - struct alignas(BDM_CACHE_LINE_SIZE) AlignedT { + struct alignas(hardware_destructive_interference_size) AlignedT { T data; }; /// Data type definition for a vector whose entries fill full cache lines. /// A vector whose components' sizes are a multiple of the cacheline size, - /// e.g sizeof(Data[i]) = N*BDM_CACHE_LINE_SIZE. + /// e.g sizeof(Data[i]) = N*hardware_destructive_interference_size. using Data = std::vector<AlignedT>; SharedData() = default; diff --git a/src/core/diffusion/diffusion_grid.cc b/src/core/diffusion/diffusion_grid.cc index 2ddf6254b..272bb9f54 100644 --- a/src/core/diffusion/diffusion_grid.cc +++ b/src/core/diffusion/diffusion_grid.cc @@ -12,8 +12,10 @@ // // ----------------------------------------------------------------------------- -#include "core/diffusion/diffusion_grid.h" +#include <algorithm> #include <mutex> + +#include "core/diffusion/diffusion_grid.h" #include "core/environment/environment.h" #include "core/simulation.h" #include "core/util/log.h" @@ -385,14 +387,8 @@ void DiffusionGrid::ChangeConcentrationBy(size_t idx, real_t amount, "Unknown interaction mode!"); } - // Enforce upper and lower bounds. (use std::clamp() when moving to C++17) - if (c1_[idx] > upper_threshold_) { - c1_[idx] = upper_threshold_; - } else if (c1_[idx] < lower_threshold_) { - c1_[idx] = lower_threshold_; - } else { - // c1_[idx] is bounded by the thresholds and does not need to be modified - } + // Enforce upper and lower bounds. + c1_[idx] = std::clamp(c1_[idx], lower_threshold_, upper_threshold_); } /// Get the concentration at specified position diff --git a/src/core/operation/operation.h b/src/core/operation/operation.h index 256aca967..b5da3f78e 100644 --- a/src/core/operation/operation.h +++ b/src/core/operation/operation.h @@ -15,6 +15,7 @@ #ifndef CORE_OPERATION_OPERATION_H_ #define CORE_OPERATION_OPERATION_H_ +#include <cstdint> #include <functional> #include <set> #include <string> diff --git a/src/core/simulation.cc b/src/core/simulation.cc index c77c5d999..3eab3bd9a 100644 --- a/src/core/simulation.cc +++ b/src/core/simulation.cc @@ -19,6 +19,7 @@ #include <algorithm> #include <cmath> #include <cstdlib> +#include <filesystem> #include <fstream> #include <memory> #include <ostream> @@ -40,7 +41,6 @@ #include "core/param/param.h" #include "core/resource_manager.h" #include "core/scheduler.h" -#include "core/stdfilesystem.h" #include "core/util/filesystem.h" #include "core/util/io.h" #include "core/util/log.h" @@ -559,7 +559,7 @@ void Simulation::InitializeOutputDir() { Log::Fatal("Simulation::InitializeOutputDir", "Failed to make output directory ", output_dir_); } - if (!fs::is_empty(output_dir_)) { + if (!std::filesystem::is_empty(output_dir_)) { if (param_->remove_output_dir_contents) { RemoveDirectoryContents(output_dir_); } else { diff --git a/src/core/stdfilesystem.h b/src/core/stdfilesystem.h deleted file mode 100644 index ffa506b45..000000000 --- a/src/core/stdfilesystem.h +++ /dev/null @@ -1,37 +0,0 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (C) 2021 CERN & University of Surrey for the benefit of the -// BioDynaMo collaboration. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// -// See the LICENSE file distributed with this work for details. -// See the NOTICE file distributed with this work for additional information -// regarding copyright ownership. -// -// ----------------------------------------------------------------------------- -#ifndef CORE_STDFILESYSTEM_H_ -#define CORE_STDFILESYSTEM_H_ - -// Use this header only in source files, not other headers - -// Hide headers from Cling -#if (!defined(__CLING__) && !defined(__ROOTCLING__)) - -#ifdef __APPLE__ -#ifdef _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM -#include <experimental/filesystem> -namespace fs = std::experimental::filesystem; -#else -#include <filesystem> -namespace fs = std::__fs::filesystem; -#endif -#else -#include <experimental/filesystem> -namespace fs = std::experimental::filesystem; -#endif - -#endif // (!defined(__CLING__) && !defined(__ROOTCLING__)) - -#endif // CORE_STDFILESYSTEM_H_ diff --git a/src/core/util/filesystem.cc b/src/core/util/filesystem.cc index 8362451c2..8262bc04a 100644 --- a/src/core/util/filesystem.cc +++ b/src/core/util/filesystem.cc @@ -13,18 +13,18 @@ // ----------------------------------------------------------------------------- #include "core/util/filesystem.h" +#include <filesystem> #include <string> -#include "core/stdfilesystem.h" namespace bdm { uint64_t RemoveDirectoryContents(const std::string& directory) { - fs::path dir = directory; - if (!fs::is_directory(dir) || fs::is_empty(dir)) { + std::filesystem::path dir = directory; + if (!std::filesystem::is_directory(dir) || std::filesystem::is_empty(dir)) { return 0; } - auto files_removed = fs::remove_all(directory); - fs::create_directory(directory); + auto files_removed = std::filesystem::remove_all(directory); + std::filesystem::create_directory(directory); // subtract 1 because we don't count the removal of `directory` // itself. return files_removed - 1; diff --git a/src/core/util/filesystem.h b/src/core/util/filesystem.h index fd3ad0e29..1a462a41f 100644 --- a/src/core/util/filesystem.h +++ b/src/core/util/filesystem.h @@ -15,6 +15,7 @@ #ifndef CORE_UTIL_FILESYSTEM_H_ #define CORE_UTIL_FILESYSTEM_H_ +#include <cstdint> #include <string> namespace bdm { diff --git a/src/core/util/git_tracker.cc b/src/core/util/git_tracker.cc index 8f8ea7ad6..ac6f5c8d1 100644 --- a/src/core/util/git_tracker.cc +++ b/src/core/util/git_tracker.cc @@ -15,7 +15,7 @@ #ifdef USE_LIBGIT2 #include "git_tracker.h" -#include "core/stdfilesystem.h" +#include <filesystem> #include "core/util/log.h" #include "fstream" #include "git2.h" @@ -164,12 +164,12 @@ void GitTracker::SaveGitDiff(const std::string& file, std::string GitTracker::GetAbsolutePath(const std::string& path) const { // Get absolute path via filesystem - return fs::absolute(path).string(); + return std::filesystem::absolute(path).string(); }; void GitTracker::ConstructFolderNames() { // Determine the current working directory via filesystem - cwd_ = fs::current_path(); + cwd_ = std::filesystem::current_path(); // Trim the build directory from the current working directory if the string // ends with build if (cwd_.substr(cwd_.size() - 5, 5) == "build") { @@ -180,7 +180,8 @@ void GitTracker::ConstructFolderNames() { // Determine the absolute path to the BioDynaMo installation bdm_installation_ = GetAbsolutePath(bdm_installation_); // Trim the build directory from the BDMSYS environment variable - bdm_installation_ = fs::path(bdm_installation_).parent_path().string(); + bdm_installation_ = + std::filesystem::path(bdm_installation_).parent_path().string(); }; } // namespace bdm diff --git a/src/core/util/jit.cc b/src/core/util/jit.cc index 82f50d9f1..8af8cacbc 100644 --- a/src/core/util/jit.cc +++ b/src/core/util/jit.cc @@ -12,6 +12,7 @@ // // ----------------------------------------------------------------------------- +#include <filesystem> #include <stack> #include <TClass.h> @@ -20,7 +21,6 @@ #include <TInterpreter.h> #include <TList.h> -#include "core/stdfilesystem.h" #include "core/util/jit.h" #include "core/util/log.h" #include "core/util/string.h" @@ -158,9 +158,9 @@ bool ExistsInIncludePath(const std::string& header) { // postprocess std::string slash_header = Concat("/", header); for (auto& dir : include_dirs) { - fs::path hpath = dir; + std::filesystem::path hpath = dir; hpath += slash_header; - if (fs::exists(hpath)) { + if (std::filesystem::exists(hpath)) { return true; } } @@ -183,9 +183,9 @@ std::string GetIncludePaths() { // ----------------------------------------------------------------------------- void JitHeaders::IncludeIntoCling() { for (auto& header : headers_) { - fs::path hpath = header; + std::filesystem::path hpath = header; if (hpath.is_absolute()) { - if (fs::exists(hpath)) { + if (std::filesystem::exists(hpath)) { gInterpreter->Declare(Concat("#include \"", header, "\"").c_str()); } else { Log::Fatal("JitHeaders::Declare", diff --git a/src/core/util/proc.cc b/src/core/util/proc.cc index bb6f15f50..cda231a34 100644 --- a/src/core/util/proc.cc +++ b/src/core/util/proc.cc @@ -14,7 +14,7 @@ #include "core/util/proc.h" #include <unistd.h> -#include "core/stdfilesystem.h" +#include <filesystem> #include "core/util/log.h" #ifdef LINUX @@ -60,12 +60,12 @@ std::string GetExecutablePath() { namespace bdm { std::string GetExecutableDirectory() { - fs::path bin_path = GetExecutablePath(); + std::filesystem::path bin_path = GetExecutablePath(); return bin_path.remove_filename().string(); } std::string GetExecutableName() { - fs::path bin_path = GetExecutablePath(); + std::filesystem::path bin_path = GetExecutablePath(); return bin_path.filename().string(); } diff --git a/src/core/util/string.cc b/src/core/util/string.cc index c4888dbe1..889ac5775 100644 --- a/src/core/util/string.cc +++ b/src/core/util/string.cc @@ -13,7 +13,9 @@ // ----------------------------------------------------------------------------- #include "core/util/string.h" +#include <cstdint> #include <iostream> + namespace bdm { std::vector<std::string> Split(const std::string& s, diff --git a/test/unit/core/container/shared_data_test.h b/test/unit/core/container/shared_data_test.h index a7663eee2..b26ed111a 100644 --- a/test/unit/core/container/shared_data_test.h +++ b/test/unit/core/container/shared_data_test.h @@ -27,66 +27,74 @@ inline void RunCacheLineAlignmentTest() { // Test alignment of int EXPECT_EQ( std::alignment_of<typename SharedData<int>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test alignment of float EXPECT_EQ( std::alignment_of<typename SharedData<float>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test alignment of double EXPECT_EQ( std::alignment_of<typename SharedData<double>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test size of vector components int EXPECT_EQ(sizeof(typename SharedData<int>::Data::value_type), - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test size of vector components float EXPECT_EQ(sizeof(typename SharedData<float>::Data::value_type), - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test size of vector components double EXPECT_EQ(sizeof(typename SharedData<double>::Data::value_type), - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test a cache line fully filled with doubles. // Test alignment of double[max_double], e.g. max cache line capacity EXPECT_EQ( std::alignment_of< - typename SharedData<double[BDM_CACHE_LINE_SIZE / + typename SharedData<double[hardware_destructive_interference_size / sizeof(double)]>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + hardware_destructive_interference_size); // Test size of vector components double[max_double], e.g. max cache line // capacity EXPECT_EQ( - sizeof(typename SharedData< - double[BDM_CACHE_LINE_SIZE / sizeof(double)]>::Data::value_type), - BDM_CACHE_LINE_SIZE); + sizeof(typename SharedData<double[hardware_destructive_interference_size / + sizeof(double)]>::Data::value_type), + hardware_destructive_interference_size); // Test some custom data structures // Test alignment of data that fills 1 cache line - EXPECT_EQ(std::alignment_of<typename SharedData< - char[BDM_CACHE_LINE_SIZE - 1]>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + EXPECT_EQ( + std::alignment_of< + typename SharedData<char[hardware_destructive_interference_size - + 1]>::Data::value_type>::value, + hardware_destructive_interference_size); // Test alignment of data that fills 2 cache lines - EXPECT_EQ(std::alignment_of<typename SharedData< - char[BDM_CACHE_LINE_SIZE + 1]>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + EXPECT_EQ( + std::alignment_of< + typename SharedData<char[hardware_destructive_interference_size + + 1]>::Data::value_type>::value, + hardware_destructive_interference_size); // Test alignment of data that fills 3 cache lines - EXPECT_EQ(std::alignment_of<typename SharedData< - char[2 * BDM_CACHE_LINE_SIZE + 1]>::Data::value_type>::value, - BDM_CACHE_LINE_SIZE); + EXPECT_EQ( + std::alignment_of< + typename SharedData<char[2 * hardware_destructive_interference_size + + 1]>::Data::value_type>::value, + hardware_destructive_interference_size); // Test size of data that fills 1 cache line EXPECT_EQ( - sizeof( - typename SharedData<char[BDM_CACHE_LINE_SIZE - 1]>::Data::value_type), - BDM_CACHE_LINE_SIZE); + sizeof(typename SharedData<char[hardware_destructive_interference_size - + 1]>::Data::value_type), + hardware_destructive_interference_size); // Test size of data that fills 2 cache lines EXPECT_EQ( - sizeof( - typename SharedData<char[BDM_CACHE_LINE_SIZE + 1]>::Data::value_type), - 2 * BDM_CACHE_LINE_SIZE); + sizeof(typename SharedData<char[hardware_destructive_interference_size + + 1]>::Data::value_type), + 2 * hardware_destructive_interference_size); // Test size of data that fills 3 cache lines - EXPECT_EQ(sizeof(typename SharedData< - char[2 * BDM_CACHE_LINE_SIZE + 1]>::Data::value_type), - 3 * BDM_CACHE_LINE_SIZE); + EXPECT_EQ( + sizeof( + typename SharedData<char[2 * hardware_destructive_interference_size + + 1]>::Data::value_type), + 3 * hardware_destructive_interference_size); } #ifdef USE_DICT diff --git a/test/unit/core/simulation_test.cc b/test/unit/core/simulation_test.cc index 885039003..357c39b1a 100644 --- a/test/unit/core/simulation_test.cc +++ b/test/unit/core/simulation_test.cc @@ -14,6 +14,7 @@ #include <gtest/gtest.h> #include <omp.h> +#include <filesystem> #include <fstream> #include <regex> #include <string> @@ -23,7 +24,6 @@ #include "core/environment/environment.h" #include "core/resource_manager.h" #include "core/simulation_backup.h" -#include "core/stdfilesystem.h" #include "core/util/io.h" #include "unit/test_util/io_test.h" #include "unit/test_util/test_util.h" @@ -448,27 +448,27 @@ TEST_F(SimulationTest, InlineConfig) { } TEST_F(SimulationTest, DontRemoveOutputDirContents) { - fs::create_directory(Concat("output/", TEST_NAME)); - fs::create_directory(Concat("output/", TEST_NAME, "/subdir")); - EXPECT_FALSE(fs::is_empty(Concat("output/", TEST_NAME))); + std::filesystem::create_directory(Concat("output/", TEST_NAME)); + std::filesystem::create_directory(Concat("output/", TEST_NAME, "/subdir")); + EXPECT_FALSE(std::filesystem::is_empty(Concat("output/", TEST_NAME))); auto SetParam = [](Param* param) { param->remove_output_dir_contents = false; }; Simulation sim(TEST_NAME, SetParam); - EXPECT_FALSE(fs::is_empty(Concat("output/", TEST_NAME))); + EXPECT_FALSE(std::filesystem::is_empty(Concat("output/", TEST_NAME))); } TEST_F(SimulationTest, RemoveOutputDirContents) { - fs::create_directory(Concat("output/", TEST_NAME)); - fs::create_directory(Concat("output/", TEST_NAME, "/subdir")); - EXPECT_FALSE(fs::is_empty(Concat("output/", TEST_NAME))); + std::filesystem::create_directory(Concat("output/", TEST_NAME)); + std::filesystem::create_directory(Concat("output/", TEST_NAME, "/subdir")); + EXPECT_FALSE(std::filesystem::is_empty(Concat("output/", TEST_NAME))); auto set_param = [](Param* param) { param->remove_output_dir_contents = true; }; Simulation sim(TEST_NAME, set_param); - EXPECT_TRUE(fs::is_empty(Concat("output/", TEST_NAME))); + EXPECT_TRUE(std::filesystem::is_empty(Concat("output/", TEST_NAME))); } #ifdef USE_DICT diff --git a/test/unit/core/util/filesystem_test.cc b/test/unit/core/util/filesystem_test.cc index 4610c2224..242cf5b2f 100644 --- a/test/unit/core/util/filesystem_test.cc +++ b/test/unit/core/util/filesystem_test.cc @@ -14,29 +14,29 @@ #include "core/util/filesystem.h" #include <gtest/gtest.h> +#include <filesystem> #include <fstream> -#include "core/stdfilesystem.h" namespace bdm { TEST(FileSystemTest, RemoveDirectoryContents) { - fs::remove_all("file-system-test"); - fs::create_directory("file-system-test"); + std::filesystem::remove_all("file-system-test"); + std::filesystem::create_directory("file-system-test"); // ignore empty directory check EXPECT_EQ(0u, RemoveDirectoryContents("file-system-test")); - EXPECT_TRUE(fs::exists("file-system-test")); + EXPECT_TRUE(std::filesystem::exists("file-system-test")); // ignore files check std::ofstream ofs("file-system-test/file"); ofs << "This is a test" << std::endl; EXPECT_EQ(0u, RemoveDirectoryContents("file-system-test/file")); - EXPECT_TRUE(fs::exists("file-system-test/file")); + EXPECT_TRUE(std::filesystem::exists("file-system-test/file")); // check if directory is emptied EXPECT_EQ(1u, RemoveDirectoryContents("file-system-test")); - EXPECT_FALSE(fs::exists("file-system-test/file")); + EXPECT_FALSE(std::filesystem::exists("file-system-test/file")); // clean-up - fs::remove_all("file-system-test"); + std::filesystem::remove_all("file-system-test"); } } // namespace bdm diff --git a/test/unit/core/visualization/paraview/adaptor_test.cc b/test/unit/core/visualization/paraview/adaptor_test.cc index 5eae3d974..c9b90ef7c 100644 --- a/test/unit/core/visualization/paraview/adaptor_test.cc +++ b/test/unit/core/visualization/paraview/adaptor_test.cc @@ -14,9 +14,9 @@ #ifdef USE_PARAVIEW #include <gtest/gtest.h> +#include <filesystem> #include "biodynamo.h" -#include "core/stdfilesystem.h" #include "core/util/io.h" #include "core/visualization/paraview/adaptor.h" #include "core/visualization/paraview/helper.h" @@ -200,8 +200,8 @@ TEST_F(ParaviewAdaptorTest, CheckVisualizationSelection) { Simulation sim(TEST_NAME, set_param); sim.GetEnvironment()->Update(); auto output_dir = sim.GetOutputDir(); - fs::remove_all(output_dir); - fs::create_directory(output_dir); + std::filesystem::remove_all(output_dir); + std::filesystem::create_directory(output_dir); auto* rm = sim.GetResourceManager(); @@ -236,7 +236,7 @@ TEST_F(ParaviewAdaptorTest, CheckVisualizationSelection) { "Substance_1-0.pvti", "Substance_1-1.pvti", "Substance_1-2.pvti"}; for (auto& file : required_files) { - EXPECT_TRUE(fs::exists(Concat(sim.GetOutputDir(), "/", file))); + EXPECT_TRUE(std::filesystem::exists(Concat(sim.GetOutputDir(), "/", file))); } } diff --git a/test/unit/core/visualization/paraview/integration_test.cc b/test/unit/core/visualization/paraview/integration_test.cc index d1f61c938..8b6b66d17 100644 --- a/test/unit/core/visualization/paraview/integration_test.cc +++ b/test/unit/core/visualization/paraview/integration_test.cc @@ -14,9 +14,9 @@ #ifdef USE_PARAVIEW #include <gtest/gtest.h> +#include <filesystem> #include "biodynamo.h" -#include "core/stdfilesystem.h" #include "core/visualization/visualization_adaptor.h" #include "neuroscience/neuroscience.h" #include "unit/test_util/test_util.h" @@ -116,7 +116,7 @@ void RunDiffusionGridTest(uint64_t max_bound, uint64_t resolution, Validate("validate_diffusion_grid.py", sim_name, num_diffusion_boxes, use_pvsm); } - ASSERT_TRUE(fs::exists(Concat(output_dir, "/valid"))); + ASSERT_TRUE(std::filesystem::exists(Concat(output_dir, "/valid"))); // Test will run in separate process. exit(0); } @@ -184,8 +184,8 @@ void RunAgentsTest(Param::MappedDataArrayMode mode, uint64_t num_agents, auto* sim = new Simulation(sim_name, set_param); auto output_dir = sim->GetOutputDir(); - fs::remove_all(output_dir); - fs::create_directory(output_dir); + std::filesystem::remove_all(output_dir); + std::filesystem::create_directory(output_dir); using NeuriteElement = neuroscience::NeuriteElement; @@ -215,10 +215,10 @@ void RunAgentsTest(Param::MappedDataArrayMode mode, uint64_t num_agents, // create pvsm file delete sim; Validate("validate_agents.py", sim_name, num_agents, use_pvsm); - ASSERT_TRUE(fs::exists(Concat(output_dir, "/valid"))); + ASSERT_TRUE(std::filesystem::exists(Concat(output_dir, "/valid"))); } else { delete sim; - ASSERT_TRUE(fs::exists(Concat(output_dir, "/valid"))); + ASSERT_TRUE(std::filesystem::exists(Concat(output_dir, "/valid"))); } // Test will run in separate process. exit(0); diff --git a/util/build-third-party/paraview/build.sh b/util/build-third-party/paraview/build.sh index 8d0954bc0..ccd7d0728 100755 --- a/util/build-third-party/paraview/build.sh +++ b/util/build-third-party/paraview/build.sh @@ -33,7 +33,7 @@ if [ "$(uname)" = "Linux" ]; then set +e . /etc/profile.d/modules.sh module load mpi - . scl_source enable devtoolset-8 + . scl_source enable devtoolset-10 set -e fi export PYENV_ROOT="$HOME/.pyenv" diff --git a/util/build-third-party/paraview/prerequisites.sh b/util/build-third-party/paraview/prerequisites.sh index e51389555..cde77981b 100755 --- a/util/build-third-party/paraview/prerequisites.sh +++ b/util/build-third-party/paraview/prerequisites.sh @@ -35,7 +35,7 @@ if [ -z "$SKIP_PACKAGE_MAN" ]; then sudo yum install -y centos-release-scl epel-release sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm || true - sudo yum install -y devtoolset-8-gcc* + sudo yum install -y devtoolset-10-gcc* sudo yum install -y ninja-build sudo yum install -y rsync diff --git a/util/build-third-party/third-party-prerequisites.sh b/util/build-third-party/third-party-prerequisites.sh index 7c4533995..c7fb6893b 100644 --- a/util/build-third-party/third-party-prerequisites.sh +++ b/util/build-third-party/third-party-prerequisites.sh @@ -57,7 +57,7 @@ EOF' sudo yum install -y centos-release-scl epel-release sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm || true - sudo yum install -y devtoolset-8-gcc* + sudo yum install -y devtoolset-10-gcc* sudo yum install -y ninja-build # libroadrunner @@ -73,7 +73,7 @@ EOF' export LLVM_CONFIG="/opt/rh/llvm-toolset-7/root/usr/bin/llvm-config" set +e - . scl_source enable devtoolset-8 + . scl_source enable devtoolset-10 . scl_source enable llvm-toolset-7 set -e CC=gcc diff --git a/util/installation/centos-7/package_list_required b/util/installation/centos-7/package_list_required index df963a96b..830f6cb64 100644 --- a/util/installation/centos-7/package_list_required +++ b/util/installation/centos-7/package_list_required @@ -1,5 +1,5 @@ bzip2-devel -devtoolset-8-gcc* +devtoolset-10-gcc* freeglut-devel git libXext-devel diff --git a/util/installation/common/install.sh b/util/installation/common/install.sh index 05550b882..3a64f00e9 100755 --- a/util/installation/common/install.sh +++ b/util/installation/common/install.sh @@ -44,7 +44,7 @@ if [ $BDM_OS = "centos-7" ]; then fi if [ -z ${CXX} ] && [ -z ${CC} ] ; then - . scl_source enable devtoolset-8 + . scl_source enable devtoolset-10 fi . /etc/profile.d/modules.sh diff --git a/util/simulation-template/CMakeLists.txt b/util/simulation-template/CMakeLists.txt index a9993db92..07961559b 100644 --- a/util/simulation-template/CMakeLists.txt +++ b/util/simulation-template/CMakeLists.txt @@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.19.3) project(my-simulation) -# BioDynaMo curretly uses the C++14 standard. -set(CMAKE_CXX_STANDARD 14) +# BioDynaMo curretly uses the C++17 standard. +set(CMAKE_CXX_STANDARD 17) # Use BioDynaMo in this project. find_package(BioDynaMo REQUIRED)