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

Cannot import cppyy under Mac OS #164

Closed
yzhang-23 opened this issue May 18, 2023 · 7 comments
Closed

Cannot import cppyy under Mac OS #164

yzhang-23 opened this issue May 18, 2023 · 7 comments

Comments

@yzhang-23
Copy link

I'm trying to use cppyy on my Mac mini M2 pro (Mac OS Ventura 13.3.1). Following the documentation, I ran

python -m pip install cppyy

and then want to test the installation with python, but I got the following error messages (only the top messages are shown):

% python
Python 3.11.1 (main, Feb 15 2023, 12:26:07) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cppyy
(Re-)building pre-compiled headers (options: -O2); this may take a minute ...
In file included from input_line_10:9:
In file included from ./etc/dictpch/allHeaders.h:373:
./include/TClassEdit.h:29:10: fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>
^~~~~~~~~~
Error: ./bin/rootcling: compilation failure (/var/folders/rc/fl4k257n5qd_385smlp095lh0000gn/T/allDict55c2af541f_dictUmbrella.h)
/Users/yzhang/Library/Python/3.11/lib/python/site-packages/cppyy_backend/loader.py:139: UserWarning: No precompiled header available (failed to build); this may impact performance.
warnings.warn('No precompiled header available (%s); this may impact performance.' % msg)
In file included from libCoreLegacy dictionary payload:7:
In file included from /Users/yzhang/Library/Python/3.11/lib/python/site-packages/cppyy_backend/include/Riostream.h:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/fstream:192:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:938:29: error: constructor for 'std::filesystem::path' must explicitly initialize the member '_pn' which does not have a default constructor
_LIBCPP_INLINE_VISIBILITY path() noexcept {}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:1512:15: note: member is declared here
string_type _pn;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:693:5: note: 'std::string' declared here
basic_string
^
...

What could be the reason for these errors? Any hint? Thank you very much!

@yzhang-23 yzhang-23 changed the title Cannot import copy under Mac OS Cannot import cppyy under Mac OS May 18, 2023
@wlav
Copy link
Owner

wlav commented May 18, 2023

Same as #150. Unfortunately, I can't reproduce it and have no idea what is causing it. :( In addition, on a normal install, the pre-compiled header should be build as part of the install process, not on first use.

@yzhang-23
Copy link
Author

on a normal install, the pre-compiled header should be build as part of the install process, not on first use.

I was also surprised that the pre-compiled headers were built on first use. Is there a way to build the headers before importing cppyy?

@wlav
Copy link
Owner

wlav commented May 18, 2023

The install process already does that. You should be able to find a .pch file in /Users/yzhang/Library/Python/3.11/lib/python/site-packages/cppyy_backend/etc. But otherwise the process of building the PCH is the same as cppyy uses when it fails to find it.

@Alex-EEE
Copy link

Alex-EEE commented Jun 7, 2023

Have you tried installing with conda

(WORK) $ conda install -c conda-forge cppyy
(WORK) [current compiler] $

this installs a different compiler, might have better luck

@yzhang-23
Copy link
Author

Have you tried installing with conda

(WORK) $ conda install -c conda-forge cppyy
(WORK) [current compiler] $

this installs a different compiler, might have better luck

I tried to install with conda, but that was for cppyy 2.4.0. Is there a way to install cppyy 3.0.0 with conda?

@wlav
Copy link
Owner

wlav commented Sep 11, 2023

I'm trying to complete the github workflows that were contributed (wlav/cppyy-backend#8). Although it doesn't run all yet, the building of the Mac wheels does and I'm finding that those wheels do NOT work on my laptop. In a way, that's not good, but it may also help me to get some fixes for upstream as it's the only reliable way that I have to break things on my box.

@wlav
Copy link
Owner

wlav commented Nov 13, 2023

Should all be good now with release 3.1.0. Feel free to reopen if you find otherwise.

@wlav wlav closed this as completed Nov 13, 2023
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

No branches or pull requests

3 participants