From 639f0d26cd45d55ac40042c90ea50a504944a7dd Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:15:50 +0200 Subject: [PATCH 01/21] First draft of macOS support in CMakeLists and Github Actions recipe for build and test --- .github/workflows/build_and_test-mac.yaml | 71 +++++++++++++++++++++++ CMakeLists.txt | 6 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_and_test-mac.yaml diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml new file mode 100644 index 0000000..8ccb880 --- /dev/null +++ b/.github/workflows/build_and_test-mac.yaml @@ -0,0 +1,71 @@ +name: Build and Test +# Builds FANS for macOS 14 on M1 CPU and runs the tests. + +on: + push: + branches: + - main + - develop + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + +jobs: + build: + name: macOS 14 (M1) + runs-on: macos-14 + env: + FANS_BUILD_DIR: build + strategy: + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install FANS dependencies + run: brew install cmake hdf5-mpi openmpi eigen fttw + + - name: Generate build directory + run: mkdir -p ${{ env.FANS_BUILD_DIR }} + + - name: Configure + working-directory: ${{ env.FANS_BUILD_DIR }} + run: | + cmake --version + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: macOS 14 (M1) CMakeCache + path: ${{ env.FANS_BUILD_DIR }}/CMakeCache.txt + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: macOS 14 (M1) CMakeLogs + path: '${{ env.FANS_BUILD_DIR }}/CMakeFiles/*.log' + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: macOS 14 (M1) CompileCommands + path: ${{ env.FANS_BUILD_DIR }}/compile_commands.json + + - name: Compile + working-directory: ${{ env.FANS_BUILD_DIR }} + run: + cmake --build . -j $(nproc) || cmake --build . -j1 + + - name: Tests + working-directory: ${{ env.FANS_BUILD_DIR }} + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: ctest + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: macOS 14 (M1) CTest logs + path: ${{ env.FANS_BUILD_DIR }}/Testing/Temporary/LastTest.log diff --git a/CMakeLists.txt b/CMakeLists.txt index 1918e68..6bc6f64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,11 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # From https://stackoverflow.com/questions/73248130/how-to-avoid-the-removal-of-the-rpath-during-cmake-install-step # Set RPATH to be relative and honor user overrides, whether at the command line or FetchContent -set(RPATH_BASE "$ORIGIN") +if(APPLE) + set(RPATH_BASE "@loader_path") +else() + set(RPATH_BASE "$ORIGIN") +endif() file(RELATIVE_PATH REL_PATH_LIB "/${CMAKE_INSTALL_BINDIR}/" "/${CMAKE_INSTALL_LIBDIR}/") From 28b16b600c5430b9bbe9ba314f44fcea71ffea1c Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:21:31 +0200 Subject: [PATCH 02/21] fix typo in FFTW package name for brew --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 8ccb880..9477ca1 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install cmake hdf5-mpi openmpi eigen fttw + run: brew install cmake hdf5-mpi openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From 06fed0915a73c88e98107adfbe3f5d3e87d90bd3 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:24:03 +0200 Subject: [PATCH 03/21] Rename macOS workflow to not clash with the Ubuntu workflow --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 9477ca1..fbeb96b 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -1,4 +1,4 @@ -name: Build and Test +name: Build and Test macOS 14 (M1) # Builds FANS for macOS 14 on M1 CPU and runs the tests. on: From 5670265fc3ffe4dbc985cef3dc96c5eba3e1e93c Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:29:04 +0200 Subject: [PATCH 04/21] test if OpenMP is really required at all --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bc6f64..960b42e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ find_package(HDF5 REQUIRED COMPONENTS CXX) find_package(Eigen3 REQUIRED) -find_package(OpenMP REQUIRED) +# find_package(OpenMP REQUIRED) find_package(MPI REQUIRED) From f3e52ea5afecce409d52193bf7380ad9814aa724 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:37:17 +0200 Subject: [PATCH 05/21] Remove not used dependency OpenMP --- CMakeLists.txt | 4 ---- cmake/FANSConfig.cmake.in | 1 - 2 files changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1918e68..828fa8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,8 +81,6 @@ find_package(HDF5 REQUIRED COMPONENTS CXX) find_package(Eigen3 REQUIRED) -find_package(OpenMP REQUIRED) - find_package(MPI REQUIRED) find_package(FFTW3 REQUIRED COMPONENTS DOUBLE MPI) @@ -175,8 +173,6 @@ target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS}) target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen) -target_link_libraries(FANS_FANS PUBLIC OpenMP::OpenMP_CXX) - target_link_libraries(FANS_main PRIVATE FANS::FANS) diff --git a/cmake/FANSConfig.cmake.in b/cmake/FANSConfig.cmake.in index 86ffcbd..1bb55c3 100644 --- a/cmake/FANSConfig.cmake.in +++ b/cmake/FANSConfig.cmake.in @@ -18,7 +18,6 @@ if (NOT HDF5_C_IS_PARALLEL) message(FATAL_ERROR "Parallel HDF5 implementation (mpi) required but not found!") endif() find_dependency(Eigen3) -find_dependency(OpenMP) find_dependency(MPI) find_dependency(FFTW3 COMPONENTS DOUBLE MPI) From 6cfc2a00cde05371f26995ccd82a080d705deab5 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:50:36 +0200 Subject: [PATCH 06/21] Test if setting C++ standard to 11 helps with the whitespace required error --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54f8d8a..3af8034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ include(CMakePackageConfigHelpers) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 11) # with -fno-implicit-templates I get linker errors when using std:: stuff # TODO: should be developer specific, by using e.g. CMake Presets From 9d3970b18654cc5c9e52057d6512634093d72bd2 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:52:51 +0200 Subject: [PATCH 07/21] Test if setting C++ standard to 14 helps with auto not allowed in lambda parameter --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3af8034..0eab86d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ include(CMakePackageConfigHelpers) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) # with -fno-implicit-templates I get linker errors when using std:: stuff # TODO: should be developer specific, by using e.g. CMake Presets From 05272cd9cd0cd1809bf84b75eb32794945ba76a7 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 17:58:50 +0200 Subject: [PATCH 08/21] Test brew hdf5 package without mpi --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index fbeb96b..c90a175 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install cmake hdf5-mpi openmpi eigen fftw + run: brew install cmake hdf5 openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From ffd49559c04003db76cd9a7177cbd85fdb955ed9 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 18:12:41 +0200 Subject: [PATCH 09/21] Add macOS installation instructions --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 2c56764..0d4c0e3 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,17 @@ apt-get install \ libfftw3-mpi-dev ``` +On macOS you can obtain the dependencies using `brew`: + +```zsh +brew install \ + cmake \ + hdf5 \ + openmpi \ + eigen \ + fftw +``` + Also, we recommend to set up a Python virtual environment for the `FANS_Dashboard`: ```bash From 32bd02ac947d8bc878fa1844d9ae8c4ee83cedd7 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 18:17:09 +0200 Subject: [PATCH 10/21] Test both brew packages hdf5 and hdf5-mpi at the same time (conflicting?) --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index c90a175..1d1707c 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install cmake hdf5 openmpi eigen fftw + run: brew install cmake hdf5 hdf5-mpi openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From 8672551f99c03529bfc45fd8f5c30a1a2b5f8479 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Fri, 4 Oct 2024 18:19:04 +0200 Subject: [PATCH 11/21] Revert "Test both brew packages hdf5 and hdf5-mpi at the same time (conflicting?)" This reverts commit 32bd02ac947d8bc878fa1844d9ae8c4ee83cedd7. --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 1d1707c..c90a175 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install cmake hdf5 hdf5-mpi openmpi eigen fftw + run: brew install cmake hdf5 openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From 120f4a4453bff6a65b30bf9e9fcfd5e5ec880956 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:31:04 +0200 Subject: [PATCH 12/21] Add libomp to macOS dependency installation instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d4c0e3..0d8ecd1 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ apt-get install \ libfftw3-mpi-dev ``` -On macOS you can obtain the dependencies using `brew`: +On macOS, you can obtain the dependencies using `brew`. Since Clang is the preferred compiler on macOS, you'll need the `libomp` package to enable OpenMP support: ```zsh brew install \ - cmake \ + libomp \ hdf5 \ openmpi \ eigen \ From 026dffef38e2c74a5dc48de72fb1d202afdf86fb Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:32:13 +0200 Subject: [PATCH 13/21] Revert "Remove not used dependency OpenMP" This reverts commit f3e52ea5afecce409d52193bf7380ad9814aa724. --- CMakeLists.txt | 4 ++++ cmake/FANSConfig.cmake.in | 1 + 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eab86d..ec377ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,8 @@ find_package(HDF5 REQUIRED COMPONENTS CXX) find_package(Eigen3 REQUIRED) +find_package(OpenMP REQUIRED) + find_package(MPI REQUIRED) find_package(FFTW3 REQUIRED COMPONENTS DOUBLE MPI) @@ -178,6 +180,8 @@ target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS}) target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen) +target_link_libraries(FANS_FANS PUBLIC OpenMP::OpenMP_CXX) + target_link_libraries(FANS_main PRIVATE FANS::FANS) diff --git a/cmake/FANSConfig.cmake.in b/cmake/FANSConfig.cmake.in index 1bb55c3..86ffcbd 100644 --- a/cmake/FANSConfig.cmake.in +++ b/cmake/FANSConfig.cmake.in @@ -18,6 +18,7 @@ if (NOT HDF5_C_IS_PARALLEL) message(FATAL_ERROR "Parallel HDF5 implementation (mpi) required but not found!") endif() find_dependency(Eigen3) +find_dependency(OpenMP) find_dependency(MPI) find_dependency(FFTW3 COMPONENTS DOUBLE MPI) From 8e72fd21532c9694cf5882581d4f5d870a0aee4f Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:33:12 +0200 Subject: [PATCH 14/21] Add libomp to github action --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index c90a175..530319d 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install cmake hdf5 openmpi eigen fftw + run: brew install libomp cmake hdf5 openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From ec0c126b75b3d784be06ab5e90d55522670ea659 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:36:14 +0200 Subject: [PATCH 15/21] Set OpenMP_ROOT in github action recipe to enable CMake on macOS to find OpenMP --- .github/workflows/build_and_test-mac.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 530319d..d787c6b 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,9 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install libomp cmake hdf5 openmpi eigen fftw + run: | + brew install libomp cmake hdf5 openmpi eigen fftw + export OpenMP_ROOT=$(brew --prefix)/opt/libomp - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From b82d5d94f9eaa73d13c2d39011f097c1e6ee1729 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:41:29 +0200 Subject: [PATCH 16/21] test explicit path to libomp instead --- .github/workflows/build_and_test-mac.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index d787c6b..0ecf00b 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: ${{github.event_name == 'pull_request'}} jobs: - build: + build-macOS: name: macOS 14 (M1) runs-on: macos-14 env: @@ -28,7 +28,7 @@ jobs: - name: Install FANS dependencies run: | brew install libomp cmake hdf5 openmpi eigen fftw - export OpenMP_ROOT=$(brew --prefix)/opt/libomp + export OpenMP_ROOT=/opt/homebrew/opt/libomp - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From 7164b6e750e647f4436eff028642050daed8ac93 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 12:43:08 +0200 Subject: [PATCH 17/21] Revert "test explicit path to libomp instead" This reverts commit b82d5d94f9eaa73d13c2d39011f097c1e6ee1729. --- .github/workflows/build_and_test-mac.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 0ecf00b..d787c6b 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: ${{github.event_name == 'pull_request'}} jobs: - build-macOS: + build: name: macOS 14 (M1) runs-on: macos-14 env: @@ -28,7 +28,7 @@ jobs: - name: Install FANS dependencies run: | brew install libomp cmake hdf5 openmpi eigen fftw - export OpenMP_ROOT=/opt/homebrew/opt/libomp + export OpenMP_ROOT=$(brew --prefix)/opt/libomp - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From 019fcdeaf3f38959473023c5e6a11a77c50a72de Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 15:05:22 +0200 Subject: [PATCH 18/21] try another fix for OpenMP problem --- .github/workflows/build_and_test-mac.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index d787c6b..01b9cde 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,9 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: | - brew install libomp cmake hdf5 openmpi eigen fftw - export OpenMP_ROOT=$(brew --prefix)/opt/libomp + run: brew install libomp cmake hdf5 openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} @@ -37,7 +35,17 @@ jobs: working-directory: ${{ env.FANS_BUILD_DIR }} run: | cmake --version - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DOpenMP_CXX_FLAG="-Xclang -fopenmp" + -DOpenMP_CXX_INCLUDE_DIR=$(brew --prefix)/opt/libomp/include \ + -DOpenMP_CXX_LIB_NAMES=libomp \ + -DOpenMP_C_FLAG="-Xclang -fopenmp" \ + -DOpenMP_C_INCLUDE_DIR=$(brew --prefix)/opt/libomp/include \ + -DOpenMP_C_LIB_NAMES=libomp \ + -DOpenMP_libomp_LIBRARY=$(brew --prefix)/opt/libomp/lib/libomp.dylib \ + .. - uses: actions/upload-artifact@v4 if: failure() From c8bd9a9ad0430478062526f8443c0999cf82e119 Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 15:06:31 +0200 Subject: [PATCH 19/21] add missing backslash in multiline command --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index 01b9cde..ac730b0 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -38,7 +38,7 @@ jobs: cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DOpenMP_CXX_FLAG="-Xclang -fopenmp" + -DOpenMP_CXX_FLAG="-Xclang -fopenmp" \ -DOpenMP_CXX_INCLUDE_DIR=$(brew --prefix)/opt/libomp/include \ -DOpenMP_CXX_LIB_NAMES=libomp \ -DOpenMP_C_FLAG="-Xclang -fopenmp" \ From f6a550d4f9d5a14c39f821139f24b75f5ddfcb0e Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 15:08:44 +0200 Subject: [PATCH 20/21] remove cmake from brew install commands as it's included in macos-14 runner anyway --- .github/workflows/build_and_test-mac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test-mac.yaml b/.github/workflows/build_and_test-mac.yaml index ac730b0..8966999 100644 --- a/.github/workflows/build_and_test-mac.yaml +++ b/.github/workflows/build_and_test-mac.yaml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install FANS dependencies - run: brew install libomp cmake hdf5 openmpi eigen fftw + run: brew install libomp hdf5 openmpi eigen fftw - name: Generate build directory run: mkdir -p ${{ env.FANS_BUILD_DIR }} From cc551c48efa0e88053d896bd8791d65bee5bf38f Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Wed, 9 Oct 2024 15:13:27 +0200 Subject: [PATCH 21/21] Mention OpenMP macOS issue with CMake in the README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bed645a..0abbd0f 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ brew install \ fftw ``` +If you're facing problems regarding CMake and OpenMP, have a look at this [CMake issue](https://gitlab.kitware.com/cmake/cmake/-/issues/24097) providing a workaround, and this [thread](https://discourse.cmake.org/t/how-to-find-openmp-with-clang-on-macos/8860) in the CMake forums also discussing the issue. + Also, we recommend to set up a Python virtual environment for the `FANS_Dashboard`: ```bash