Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 14 arm64 missing gcc@11 library #167

Closed
backeb opened this issue May 2, 2024 · 1 comment
Closed

MacOS 14 arm64 missing gcc@11 library #167

backeb opened this issue May 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@backeb
Copy link

backeb commented May 2, 2024

Describe the bug
Follow-up from #162. After upgrading from MacOS 13 to macOS 14 (arm64 architecture) installation now succeeds, but upon initialization of meshkernel a library is missing.

When running

from meshkernel import MeshKernel
MeshKernel()

I get an error indicating

Library not loaded: [/opt/homebrew/opt/gcc](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/opt/gcc)@11/lib/gcc/11/libgomp.1.dylib

MacOSX sw_vers output:

ProductName:            macOS
ProductVersion:         14.4.1
BuildVersion:           23E224

To Reproduce

mamba create --name meshkernel python=3.11
mamba activate meshkernel
pip install meshkernel
mamba install ipython

Then in ipython do

from meshkernel import MeshKernel
MeshKernel()

This creates the following error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[1], line 2
      1 from meshkernel import MeshKernel
----> 2 MeshKernel()

File ~/mambaforge/envs/meshkernel/lib/python3.11/site-packages/meshkernel/meshkernel.py:88, in MeshKernel.__init__(self, projection)
     85         system = "Unknown OS"
     86     raise OSError("Unsupported operating system: {}".format(system))
---> 88 self.lib = CDLL(str(lib_path))
     90 self._exit_code = self.__get_exit_codes()
     92 self._allocate_state(projection)

File ~/mambaforge/envs/meshkernel/lib/python3.11/ctypes/__init__.py:376, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    373 self._FuncPtr = _FuncPtr
    375 if handle is None:
--> 376     self._handle = _dlopen(self._name, mode)
    377 else:
    378     self._handle = handle

OSError: dlopen(/Users/backeb/mambaforge/envs/meshkernel/lib/python3.11/site-packages/meshkernel/libMeshKernelApi.dylib, 0x0006): Library not loaded: /opt/homebrew/opt/gcc@11/lib/gcc/11/libgomp.1.dylib
  Referenced from: <AE9E9AF2-D30A-3489-979F-BE034891C169> /Users/backeb/mambaforge/envs/meshkernel/lib/python3.11/site-packages/meshkernel/libMeshKernelApi.dylib
  Reason: tried: '/opt/homebrew/opt/gcc@11/lib/gcc/11/libgomp.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/gcc@11/lib/gcc/11/libgomp.1.dylib' (no such file), '/opt/homebrew/opt/gcc@11/lib/gcc/11/libgomp.1.dylib' (no such file)

Using homebrew I installed gcc@11 by doing brew install gcc@11, and retried the following in ipython:

from meshkernel import MeshKernel
MeshKernel()

Which created the MeshKernel class

Variable     Type    Data/Info
------------------------------
MeshKernel   type    <class 'meshkernel.meshkernel.MeshKernel'>
@backeb backeb added the bug Something isn't working label May 2, 2024
@backeb backeb changed the title Missing gcc@11 library MacOS 14 arm64 missing gcc@11 library May 2, 2024
@lucacarniato
Copy link
Contributor

We are not allowed to link OpenMP statically on all operating systems. Installing GCC 11 can solve this issue

brew install gcc@11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants