Open Foadsf opened 4 years ago
Homebrew has no openmp on MacOS Ventura 14.2, as of December 8, 2023. Was trying to build elmer, but the instructions are incomplete. To be fair, the instructions said there were issues, on the other hand, it has been 3.5 years.
I'd like to do some acoustic simulations in FreeCAD using elmer, but have been having trouble getting elmer to compile. I can try anything out you suggest as a beta tester. I've recently converted to Mac from Linux so I am familiar with the build process, but not so familiar with massaging homebrew into doing the right thing... Would appreciate any pointers you can provide.
I tried compiling with cmake .. -D WITH_OpenMP:BOOLEAN=FALSE -D WITH_MPI:BOOLEAN=TRUE $ make -j9 But it failed. Could not find FORTRAN sgemm, but did find dgemm.
But the major error is this build seemingly pointing to amd or intel libraries not the appropriate M3 libraries. `In file included from /Users/me/myApps/elmerfem/umfpack/src/amd/amd_valid.c:28: /Users/me/myApps/elmerfem/umfpack/src/amd/amd_internal.h:72:10: fatal error: 'stdlib.h' file not found
^~~~~~~~~~
1 error generated.` Are you assuming that Rosetta 2 is installed?
There were lots of warnings in the code, but, let's deal with the errors first. Failed at 8% build.
ElmerFEM builds with OpenMP on macOS in the CI. But users on macOS need to provide special flags because Apples compiler don't support OpenMP out of the box.
In CI using libomp
from Hombrew the following flags are used:
https://github.com/ElmerCSC/elmerfem/actions/runs/10283579126/job/28458520918#step:5:12
-DWITH_OpenMP=ON \
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_Fortran_FLAGS="-fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
Additionally, LDFLAGS
is set to -L${HOMEBREW_PREFIX}/opt/libomp/lib -lomp
.
With MacPorts or yet another implementation of OpenMP the flags might need to be set differently.
The situation might be entirely different when building with GCC on macOS.
The necessary configuration very much depends on the build environment that a mac user is intending to use. So, they should be responsible to set the necessary flags correctly.
All in all: It looks like this issue is caused by incomplete configuration flags. Nothing needs to be changed in the build system of ElmerFEM.
Is this issue about updating the Wiki page with instructions for building on macOS?
I'm trying to follow these instructions, but I get the error message: