|
[Sponsors] |
[OpenFOAM.com] Installing OpenFOAM on MacOS with Apple Silicon |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#21 |
New Member
Gabriel Gerlero
Join Date: Jan 2022
Posts: 22
Rep Power: 5 ![]() |
cfMesh is included with v2312 and before. With v2406, cfMesh was removed from the default install, so it's not included anymore (I do not know the reason for its removal).
|
|
![]() |
![]() |
![]() |
![]() |
#22 | |
New Member
Join Date: Jun 2013
Posts: 6
Rep Power: 13 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#23 |
New Member
Gabriel Gerlero
Join Date: Jan 2022
Posts: 22
Rep Power: 5 ![]() |
Have you managed to fix/work around your issues? Usually, (1) using the bundled Bash session (i.e., using the 'openfoam' command) and (2) using the tutorial RunFunctions in any run scripts keeps most SIP-related problems at bay...
|
|
![]() |
![]() |
![]() |
![]() |
#24 |
New Member
Kevin Nolan
Join Date: Nov 2012
Posts: 18
Rep Power: 14 ![]() |
I've now built OpenFOAM v2214 on a Mac mini with an M4 Pro (12 core, 48 GB of RAM). Below I will update the text from my original post.
--------------------------------------------------------------------- OpenFOAM v2412 builds on MacOS without the need for a patch. I will assume a clean install of MacOS. I'm on 15.3 (24D60) on an M4 Pro (12 Core) First install Xcode and the Xcode command line tools. You can do this from the app store. Check the command line tools are installed: Code:
$ xcode-select --install https://brew.sh Install the following with homebrew: Code:
$ brew install --cask paraview $ brew install open-mpi $ brew install boost $ brew install cgal $ brew install metis $ brew install libomp $ brew install scotch $ brew install mrklein/foam/parmgridgen Code:
$ diskutil ap list I created a case-sensitive volume called OpenFOAM in /Volumes rather than clutter $HOME. (I can add the Volume to the sidebar in Finder for example.) Code:
$ diskutil ap addVolume disk3 'Case-sensitive APFS' OpenFOAM -role D Code:
$ curl -L https://dl.openfoam.com/source/v2412/OpenFOAM-v2412.tgz > OpenFOAM-v2412.tgz $ curl -L https://dl.openfoam.com/source/v2412/ThirdParty-v2412.tgz > ThirdParty-v2412.tgz Next extract the tarballs into the new OpenFOAM volume. Code:
$ cd /Volumes/OpenFOAM/ $ tar xzf $HOME/OpenFOAM-v2206.tgz $ tar xzf $HOME/ThirdParty-v2206.tgz Before we go and build OpenFOAM we need to fix how scotch is linked. Looking at our scotch install info: Code:
brew info scotch Code:
==> scotch: stable 7.0.6 (bottled), HEAD Package for graph partitioning, graph clustering, and sparse matrix ordering https://gitlab.inria.fr/scotch/scotch Installed /opt/homebrew/Cellar/scotch/7.0.6 (237 files, 11.4MB) * Poured from bottle using the formulae.brew.sh API on 2025-01-29 at 10:26:59 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/scotch.rb License: CECILL-C ==> Dependencies Build: bison ✘ Required: open-mpi ✔ ==> Options --HEAD Install HEAD version ==> Analytics install: 36 (30 days), 134 (90 days), 508 (365 days) install-on-request: 36 (30 days), 131 (90 days), 496 (365 days) build-error: 0 (30 days) Code:
export SCOTCH_VERSION=scotch-system export SCOTCH_ARCH_PATH=/opt/homebrew/Cellar/scotch/7.0.6 Next run these commands to update some necessary preferences which will be stored in a ~/OpenFOAM/prefs.sh: Code:
$ mkdir -p $HOME/.OpenFOAM $ echo 'WM_COMPILER=Clang' > $HOME/.OpenFOAM/prefs.sh $ echo 'WM_COMPILE_OPTION=Opt' >> $HOME/.OpenFOAM/prefs.sh $ echo 'WM_MPLIB=SYSTEMOPENMPI' >> $HOME/.OpenFOAM/prefs.sh $ echo 'export WM_NCOMPPROCS=$(sysctl -n hw.ncpu)' >> $HOME/.OpenFOAM/prefs.sh $ echo 'WM_LABEL_SIZE=32' >> $HOME/.OpenFOAM/prefs.sh $ source etc/bashrc $ [ "$(ulimit -n)" -lt "4096" ] && ulimit -n 4096 Now we can build OpenFOAM Code:
$ cd /Volumes/OpenFOAM/OpenFOAM-v2412/ $ ./Allwmake > log.Allwmake 2>&1 Code:
$ tail -f /Volumes/OpenFOAM/OpenFOAM-v2412/log.Allwmake Code:
$ mkdir -p $HOME/.OpenFOAM $ echo 'v2412' > $HOME/.OpenFOAM/OpenFOAM-release Code:
$ source "/Volumes/OpenFOAM/OpenFOAM-v2412/etc/bashrc" Code:
$ mkdir -p /Volumes/OpenFOAM/$USER-$WM_PROJECT_VERSION $ mkdir -p /Volumes/OpenFOAM/$USER-$WM_PROJECT_VERSION/run Code:
export WM_PROJECT_USER_DIR="/Volumes/OpenFOAM/${USER:-user}-$WM_PROJECT_VERSION" Code:
cores MeshTime(s) RunTime(s) ----------------------------------- 1 407.23 334.47 2 292.06 196.36 4 181.5 101.12 6 135.4 79.75 8 128.51 62.74 12 162.66 95.73 Last edited by Kolan; January 29, 2025 at 09:49. |
|
![]() |
![]() |
![]() |
![]() |
#25 |
New Member
Kevin Nolan
Join Date: Nov 2012
Posts: 18
Rep Power: 14 ![]() |
I've now installed v2412 on my 16" M3 Max MBP (4E+12P) which I had benched previously with OpenFOAM running in a sparse bundle.
Now using v2412 with an APFS volume I get: Code:
cores MeshTime(s) RunTime(s) ----------------------------------- 1 433.06 338.44 2 301.92 193.1 4 208.73 106.67 6 158.28 73.87 8 121.56 62.14 12 106.8 53.07 |
|
![]() |
![]() |
![]() |
![]() |
#26 |
Senior Member
Join Date: May 2012
Posts: 562
Rep Power: 16 ![]() |
Thank you Kolan for this update. Very nice that ESI have made it possible to easily compile from source on MacOS.
Have you by any chance tested to build cfMesh with apple silicon, as it is no longer bundled with ESI OpenFOAM? |
|
![]() |
![]() |
![]() |
![]() |
#27 |
New Member
Kevin Nolan
Join Date: Nov 2012
Posts: 18
Rep Power: 14 ![]() |
I havent but I can try. Im a blockMesh masochist.
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.com] Native OpenFOAM for macOS: OpenFOAM-v2112.app (install instructions and GitHub link) | gerlero | OpenFOAM Installation | 32 | November 21, 2024 03:20 |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 12:58 |
[Other] Basic questions about OpenFOAM cluster running and installing | Fauster | OpenFOAM Installation | 0 | May 25, 2018 16:00 |
[OpenFOAM.com] Issues with installing v1712 on MacOS | Spacegirl1923 | OpenFOAM Installation | 8 | April 12, 2018 18:44 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 10:04 |