mrklein / openfoam-os-x

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

clang: error when allmake #80

Closed Boris3305 closed 2 years ago

Boris3305 commented 2 years ago

when I run the Allwmake , it doesnt work at final. In log.Al, it say this: clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple clang version 13.1.6 (clang-1316.0.21.2.3) Target: x86_64-apple-darwin21.4.0 Thread model: posix ..... make: *** [/Users/boris/OpenFOAM/OpenFOAM-v2112/build/darwin64ClangDPInt32Opt/src/meshTools/triSurface/triSurfaceTools/geompack/geompack.o] Error 254

mrklein commented 2 years ago

Hi,

I can confirm, the error. It happens during compilation of geompack.C. And it seems, there is a problem with compiler flags, as without flags file is compiled without problem.

mrklein commented 2 years ago

Possible work-around is to add #pragma clang fp exceptions(ignore) at the top of triSurface/triSurfaceTools/geompack/geompack.C. This will switch off trapping math for this file.

Boris3305 commented 2 years ago

Thank u for your advice! It's not cause by the goepack.c . It's problem of the Xcode. After I change the Xcode 13.x to 12.5, everything is done. :)

mrklein commented 2 years ago

It is a problem of clang 13.1.6 not being able to compile geompack.C with -O3 and -ftrapping-math flags. So, using #pragma clang fp exceptions(ignore), I switch off -ftrapping-math flag for geompack.C, which fixes the problem of compilation.

Yes, you can also switch compilers. Though, adding a line to a file seems to be simpler, than downgrading of Xcode.

Boris3305 commented 2 years ago

OK. I got it. THANKS!