Skip to content

Libopenblas issues in conda build when adding <pybind11/numpy.h> functionality on OSX #66

Open
@EelcoHoogendoorn

Description

@EelcoHoogendoorn

If I clone this repo, it works great. If I add some simple pybind11/numpy functionality (passing a numpy array in and out), I run into trouble on OSX, when trying to build a conda package.

  • Doing a pip install in my conda env is fine; compiles, links, passes tests. Though I have not tried relocating the wheel to another env than the one it is built in, which I suspect might trigger the same problem.
  • The conda build works just fine on linux.
  • Obviously, I did add numpy to both my host and run requirements. But it cant find libopenblas when invoking the test. libopenblas and liblapack are in the test environment as you would expect, them being a numpy dependency.
  • Problem happens regardless of python version on OSX

Perhaps adding a little pybind/numpy to this example repo would be cool. Probably this is something simple that more seasoned OSX-linking-gurus can spot easily, but it eludes me after a few days of messing around with it.

Here is what the conda build tests have to say:

Hint: make sure your test modules/packages have valid Python names.
Traceback:
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_pyopcode.py:1: in <module>
    import numpy as np
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/site-packages/numpy/__init__.py:142: in <module>
    from . import add_newdocs
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/site-packages/numpy/add_newdocs.py:13: in <module>
    from numpy.lib import add_newdoc
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/site-packages/numpy/lib/__init__.py:8: in <module>
    from .type_check import *
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/site-packages/numpy/lib/type_check.py:11: in <module>
    import numpy.core.numeric as _nx
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python3.8/site-packages/numpy/core/__init__.py:14: in <module>
    from . import multiarray
E   ImportError: dlopen($PREFIX/lib/python3.8/site-packages/numpy/core/multiarray.cpython-38-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
E     Referenced from: $PREFIX/lib/python3.8/site-packages/numpy/core/multiarray.cpython-38-darwin.so
E     Reason: image not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions