mrklein / openfoam-os-x

Patches for OpenFOAM(R) to build it on OS X
93 stars 33 forks source link

libomp needs a quick fix #83

Open BrushXue opened 1 year ago

BrushXue commented 1 year ago

Recently libomp has been changed to keg-only https://github.com/Homebrew/homebrew-core/issues/112107

So in /wmake/rules/darwin64Clang/general it should be changed to

LINK_OPENMP = -L/usr/local/opt/libomp/lib -lomp
kazumamatata commented 1 year ago

The above option didn't work for me. However, I could fix it when I added the include directory.

COMP_OPENMP = -DUSE_OMP -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include
LINK_OPENMP = -L/opt/homebrew/opt/libomp/lib -lomp
mrklein commented 1 year ago

I am not sure if this problem should be solved in the rules files because installation prefix can vary from user to user. I solve OpenMP issues with two environment variables:

FOAM_EXTRA_CXXFLAGS=-I/usr/local/opt/libomp/include
FOAM_EXTRA_LDFLAGS=-L/usr/local/opt/libomp/lib

Here libomp is installed with Homebrew on Intel macBook.