1

Can anyone give instructions that work? There have been various posts on this but nothing that works for me. My attempt below is the best I can do.

Trying to install OpenFoam v1606+ on OS X El Capitan.

  1. I downloaded Docker and successfully ran their toy example.

  2. The OpenFoam instructions say After installing, open the Launchpad and locate the ‘Docker Quickstart Terminal’ icon There is no such icon. There is a Docker icon which I click, and it confirms that Docker is running. Click the icon to launch a Docker Quickstart Terminal window. Cannot find such a terminal, so I guess that a standard Mac terminal shell will do.

  3. Make sure the Docker daemon is running: “docker info” I get : Containers: 3 Running: 0 Paused: 0 Stopped: 3 Images: 2 Server Version: 1.12.1 … Is this correct?

  4. Download the following scripts from the release instructions and put them in a local directory (e.g. home directory) installMacOpenFOAM+ startMacOpenFOAM+” I downloaded both.

  5. Download and create the Docker container … docker-machine ssh default $HOME/installMacOpenFOAM+ $HOME I get Host does not exist: “default"

  6. So instead I ran installMacOpenFOAM+ directly. (Forgot to chmod initially) chmod a+x installMacOpenFOAM+ ./installMacOpenFOAM+ I get a download of the required file, but then docker: Error response from daemon: Mounts denied: The path /etc/sudoers.d is not shared from OS X and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> File Sharing. See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info. There is no file or directory /etc/suders.d . Tried adding /etc via Docker->Preferences but this did not work.

Not enough room to complete this saga.

tcp
  • 31
  • 3
  • This has been solved very recently using Docker: https://twitter.com/CFDdirect/status/821692602172981248 I really advice using this workflow as it really speed-up development time for me. – Francesco Contino Jan 22 '17 at 08:33
  • Please check https://www.scibyte.cn/products/openfoam-macos/index_en.html – pengfei_guo Mar 17 '22 at 06:39

1 Answers1

0

OpenFOAM v2112 works out of the box (tested on Mac OS 12.1).

Use command line tools and brew to install dependencies.

brew install boost
brew install cgal
brew install open-mpi
brew install metis
brew install scotch

Create a case sensitive volume

diskutil ap addVolume disk1 'Case-sensitive APFS' OpenFOAM -role D

Make a symbolic link to the new volume

ln -s /Volumes/OpenFOAM $HOME/OpenFOAM

Download the OpenFOAM sources in the new case sensitive volume

cd /Volumes/OpenFOAM
curl -L   https://dl.openfoam.com/source/v2112/OpenFOAM-v2112.tgz > OpenFOAM-v2112.tgz
tar xzf OpenFOAM-v2112.tgz

Combine preferences in ~/.OpenFOAM/prefs.sh

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 the settings and install OpenFOAM

source etc/bashrc
./Allwmake > log.Allwmake 2>&1

For additional info: https://www.researchgate.net/publication/357395955_OpenFOAM_installation_on_Mac?utm_source=twitter&rgutm_meta1=eHNsLS9NZktnbTVhZ0cxbmpONUgrNzd1dlgxem5abHNvTHd1bVI3RlhhMk9aYUk3aXNkNC9ERVdIeFBGY3VLZ3g0WkU2N1F4WHRuTjlnTE92YTVERzlqaG83TT0%3D

aqeel
  • 11
  • 2
  • Can other versions of OpenFOAM be installed in the same way? Does this method have the same spirit as the way in this link? https://www.scibyte.cn/products/openfoam-macos/index_en.html – pengfei_guo Mar 17 '22 at 06:41
  • The idea here is to build the OpenFOAM from sources directly on Mac OS. – aqeel Mar 18 '22 at 09:23