mrklein / openfoam-os-x

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

Problem with surfaceBooleanFeatures #64

Closed BrushXue closed 3 years ago

BrushXue commented 3 years ago

Hello.

I was trying to run the tutorial case in tutorials/mesh/foamyHexMesh/mixerVessel and got the following error when running surfaceBooleanFeatures:

dyld: lazy symbol binding failed: Symbol not found: ___gmpq_init
  Referenced from: /Users/gux215/OpenFOAM/OpenFOAM-v2012/platforms/darwin64ClangDPInt32Opt/lib/libPolyhedronReader.dylib
  Expected in: flat namespace

dyld: Symbol not found: ___gmpq_init
  Referenced from: /Users/gux215/OpenFOAM/OpenFOAM-v2012/platforms/darwin64ClangDPInt32Opt/lib/libPolyhedronReader.dylib
  Expected in: flat namespace

Tested on another Linux computer and didn't receive any error message. I wonder if this issue comes from the homebrew CGAL? Thanks.

mrklein commented 3 years ago

Hi,

In fact, it is missing -lgmp -lmpfr in CGAL_LIBS (in wmake/rules/darwin64Clang/cgal).

So to correct the error, you need to add these flags to CGAL_LIBS and recompile at least applications/utilities/surface and applications/utilities/mesh/generation/foamyMesh.

mrklein commented 3 years ago

Though, after you will get sigFpe during foamyHexMesh run. Yet, this behaviour is identical to Linux.

BrushXue commented 3 years ago

This is weird as it's opposite to https://develop.openfoam.com/Development/openfoam/-/wikis/building#darwin-mac-os

mrklein commented 3 years ago

Guess, Homebrew maintainers of CGAL do not follow OpenFOAM's suggestions:

class Cgal < Formula
...
  depends_on "cmake" => [:build, :test]
  depends_on "qt@5" => [:build, :test]
  depends_on "boost"
  depends_on "eigen"
  depends_on "gmp"
  depends_on "mpfr"
...

And ___gmpq_init, which dynamic linker cannot find, is a function from GMP.

mrklein commented 3 years ago

Guess, the issue became irrelevant.