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

python bindings don't work on macOS #75

Closed
3 tasks done
c-dilks opened this issue Jan 10, 2024 · 5 comments · Fixed by #73
Closed
3 tasks done

python bindings don't work on macOS #75

c-dilks opened this issue Jan 10, 2024 · 5 comments · Fixed by #73

Comments

@c-dilks
Copy link
Member

c-dilks commented Jan 10, 2024

TODO

  • fix the issue (see below)
  • re-enable {macos-latest, python} test in the CI test matrix
  • update the documentation, if there are any claims to bindings not working on macOS

The Issue

Here is the CI output from running the python examples; note the additional DEBUG: printouts which show the arguments provided to cppyy.add_include_path and cppyy.add_library_path.

IncrementalExecutor::executeFunction: symbol '_ZN3fmt2v96detail18throw_format_errorEPKc' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of fmt::v9::detail::throw_format_error(char const*)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN3fmt2v96detail12is_printableEj' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of fmt::v9::detail::is_printable(unsigned int)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZTVN3fmt2v912format_errorE' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of vtable for fmt::v9::format_error
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN3fmt2v97vformatENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of fmt::v9::vformat(fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN3fmt2v912format_errorD1Ev' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of fmt::v9::format_error::~format_error()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN3fmt2v96vprintEP7__sFILENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of fmt::v9::vprint(__sFILE*, fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZTIN3fmt2v912format_errorE' unresolved while linking symbol '__cf_15'!
You are probably missing the definition of typeinfo for fmt::v9::format_error
Maybe you need to load the corresponding shared library?
cling JIT session error: Failed to materialize symbols: { (main, { __ZN6iguana9Algorithm9SetOptionINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvS8_T_ }) }
cling JIT session error: Failed to materialize symbols: { (main, { __ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_PKS6_ }) }
cling JIT session error: Failed to materialize symbols: { (main, { __ZN6iguana9Algorithm9SetOptionINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvS8_T_ }) }
cling JIT session error: Failed to materialize symbols: { (main, { __ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataEv }) }
BANK :: NAME            REC::Particle , ROWS     12 
               pid :       11       22       22       22       22       22       22     2112     2112     2112     2112     2112 
                px : -0.90290  0.06365  0.27729 -0.07980  0.05497 -0.05758  0.02447 -0.05363 -0.00424 -0.00582 -0.00988  0.00000 
                py :  0.85588 -0.18087 -0.22218 -0.21113 -0.08333 -0.00065 -0.06010 -0.01821  0.01221  0.01161 -0.00657 -0.00000 
                pz :  4.25403  1.19641  0.95335  0.51864  0.36270  0.32684  0.11307 -0.05478 -0.01894 -0.01643  0.00440  0.00000 
                vx :  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806  0.16806 
                vy :  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794  0.05794 
                vz : -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 -2.16882 
                vt : 90.55819 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 
            charge :       -1        0        0        0        0        0        0        0        0        0        0        0 
              beta :  1.00000  1.11368  1.11206  1.14478  1.14836  1.08951  1.16269  0.08357  0.02439  0.02229  0.01346  1.11980 
           chi2pid : -0.27508 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 9999.00000 
            status :    -2222     2020     2020     2020     2020     2210     2010     4100     4100     4100     4100     2010 
Traceback (most recent call last):
DEBUG: pyiguana - add package iguana: {'includedir': '/Users/runner/work/iguana/iguana/iguana/include', 'libdir': '/Users/runner/work/iguana/iguana/iguana/lib'}
  File "/Users/runner/work/iguana/iguana/iguana/bin/iguana-example-01-bank-rows.py", line 42, in <module>
    pid = particleBank.getInt('pid', row)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cppyy.gbl.std.runtime_error: int hipo::bank::getInt(const char* name, int index) =>
    runtime_error: failed to resolve function
DEBUG: pyiguana - add package fmt: {'includedir': '/Users/runner/work/iguana/iguana/fmt/include', 'libdir': '/Users/runner/work/iguana/iguana/fmt/lib'}
DEBUG: pyiguana - add package hipo4: {'includedir': '/Users/runner/work/iguana/iguana/hipo/include', 'libdir': '/Users/runner/work/iguana/iguana/hipo/lib'}
cling JIT session error: Failed to materialize symbols: { (main, { __ZNSt3__122__hash_key_value_typesINS_17__hash_value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_7variantIJidS7_NS_6vectorIiNS5_IiEEEEEEEEEE9__get_ptrERSD_ }) }
cling JIT session error: Failed to materialize symbols: { (main, { __ZN6iguana9AlgorithmD2Ev }) }
@c-dilks
Copy link
Member Author

c-dilks commented Jan 10, 2024

I get the same failures on both macOS 11 and 12. @baltzell what version did you test today?

@baltzell
Copy link

macOS 12, successfully, on two different laptops so far

@c-dilks
Copy link
Member Author

c-dilks commented Jan 11, 2024

Have you tried iguana-example-01-bank-rows.py? That's the one that fails in the CI, whereas iguana-example-00-basic.py appears to work but with errors/warnings.

@baltzell
Copy link

That one seems fine too.

@c-dilks
Copy link
Member Author

c-dilks commented Jan 12, 2024

Looks like brew install fmt fixes this.

EDIT: this is because the Homebrew formula installs both static and shared libs; cppyy on macOS needs the shared libs, evidently. Also, we need to set DYLD_LIBRARY_PATH (only for macOS Python tests), and don't force static linking of fmt with meson dependency(fmt, static: true)

@c-dilks c-dilks linked a pull request Jan 12, 2024 that will close this issue
@c-dilks c-dilks removed a link to a pull request Jan 13, 2024
@c-dilks c-dilks linked a pull request Jan 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants