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

[Bug Report] #81

Open
RobertPincus opened this issue Jan 22, 2025 · 2 comments
Open

[Bug Report] #81

RobertPincus opened this issue Jan 22, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@RobertPincus
Copy link
Member

Describe the bug
conda-build fails on MacOS 15.1.1 running on Apple ARM (Python 3.11.11)

To Reproduce
Following the instructions for building a local installation with conda as in README.md on branch main, the step condo build condo.recipe runs for a while and fails. Example output include missing symbols and many uses of "placehold_":

export PREFIX=/Users/robert/Documents/mambaforge/envs/pyRTE/conda-bld/pyrte_rrtmgp_1737578614018/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_
export SRC_DIR=/Users/robert/Documents/mambaforge/envs/pyRTE/conda-bld/pyrte_rrtmgp_1737578614018/test_tmp
import: 'pyrte_rrtmgp'
import: 'pyrte_rrtmgp'
+ pyrte_rrtmgp run_tests
Running tests...
Tests failed!
============================= test session starts ==============================
platform darwin -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/robert/Documents/mambaforge/envs/pyRTE/conda-bld/pyrte_rrtmgp_1737578614018
collected 0 items / 9 errors

==================================== ERRORS ====================================
_ ERROR collecting _test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.11/site-packages/pyrte_rrtmgp/tests/lw_solver_test/2stream_test/lw_solver_2stream_test.py _
ImportError while importing test module '$PREFIX/lib/python3.11/site-packages/pyrte_rrtmgp/tests/lw_solver_test/2stream_test/lw_solver_2stream_test.py'.
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_/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.11/site-packages/pyrte_rrtmgp/tests/lw_solver_test/2stream_test/lw_solver_2stream_test.py:8: in <module>
    import pyrte_rrtmgp.pyrte_rrtmgp as py
E   ImportError: dlopen($PREFIX/lib/python3.11/site-packages/pyrte_rrtmgp/pyrte_rrtmgp.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_rrtmgp_compute_Planck_source'

Expected behavior
I was hoping for a working installation :-)

Software Versions:

  • OS:MacOS 15.1.1, Apple ARM
  • Whatever is fetched by conda?
@RobertPincus RobertPincus added the bug Something isn't working label Jan 22, 2025
@sehnem
Copy link
Collaborator

sehnem commented Jan 23, 2025

This looks like an issue with the linking of the libraries, I had something similar in the past with my M1 Mac, I solved it adding some conditions to the CMakeList, but it may be breaking other installers.

if (${LINUX})
    target_link_libraries(${TARGET_NAME} PUBLIC gfortran)
elseif(APPLE)
    # On macOS, explicitly link against gfortran runtime
    if(APPLE_ARM)
        target_link_directories(${TARGET_NAME} PUBLIC /opt/homebrew/lib/gcc/current)
    else()
        target_link_directories(${TARGET_NAME} PUBLIC /usr/local/lib/gcc/current)
    endif()
    target_link_libraries(${TARGET_NAME} PUBLIC gfortran)
endif()

I could not reproduce it in my machine I used Miniconda3-py311_24.5.0-0-MacOSX-arm64 and the build and install worked. It is also working in the CI. Tomorrow I will try to use the exact version of mambaforge that you are using to see if I can reproduce it.

@RobertPincus
Copy link
Member Author

@sehnem It seems plausible that conda build is missing the paths to some directories, but that can't be the only problem: the last line of the error log I copied above reads:
E ImportError: dlopen($PREFIX/lib/python3.11/site-packages/pyrte_rrtmgp/pyrte_rrtmgp.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_rrtmgp_compute_Planck_source'

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

4 participants