openfoam-app icon indicating copy to clipboard operation
openfoam-app copied to clipboard

Mac ARM64 M2 Building from Source ending with Errors

Open fabgourdon opened this issue 3 months ago • 2 comments

Good Evening and great Kudo to Gabriel for his tremendous work.

No Compilation expert here. I am trying to build OPENFOAM from source using the guidelines:

  • git clone https://github.com/gerlero/openfoam-app.git
  • cd openfoam-app
  • make build

I am having warnings for all Brew packages required:

Warning: Building open-mpi from source as the bottle needs:

  • HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/OpenFOAM-v2312/usr/Cellar)
  • HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/OpenFOAM-v2312/usr)

In the Log file Compilationlog.log I have at the end: Homebrew Bundle failed! 4 Brewfile dependencies failed to install. and a lot of verbose related to issues with the installation of the brew packages along with fatal errors.

Do you have any guidance on how to solve those issues.

Thanks a lot for your support.

fabgourdon avatar Apr 05 '24 21:04 fabgourdon

Thanks. The error is here:

Last 15 lines from /Users/tatayoyo/Library/Logs/Homebrew/gcc/02.make:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__locale:813:5: error: expected expression
    return std::use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c);
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[3]: *** [cp/mapper-resolver.o] Error 1
20 errors generated.
make[3]: *** [cp/module.o] Error 1
rm gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

These open issues may also help:
gcc: error in catching C++ exceptions https://github.com/Homebrew/homebrew-core/issues/162714
Installing open-mpi has failed!

I.e., for some reason the gcc formula required by open-mpi is failing to build from source on Apple silicon using the standalone Homebrew install. I haven't looked into it further. Unfortunately, the app's use of Homebrew is not supported, so that's why we are told not to open an issue in that repo (a pull request would be acceptable though if we can find a fix).

Possible workarounds are to build using DEPS_KIND=homebrew or DEPS_KIND=bundled (e.g. make build DEPS_KIND=homebrew) instead of the default DEPS_KIND=standalone.

EDIT: clarify that it's gcc that's failing the build

gerlero avatar Apr 08 '24 16:04 gerlero

Related: https://github.com/iains/gcc-13-branch/issues/15

gerlero avatar Apr 16 '24 14:04 gerlero