wlav / cppyy

Other
390 stars 40 forks source link

Does it work on apple silicon ? #150

Closed Jac-Zac closed 9 months ago

Jac-Zac commented 1 year ago

I'm on an M1 macbook and I was wondering if it works on apple silicon too. Because for some reason when I import cppyy I get this error:

>>> import cppyy
(Re-)building pre-compiled headers (options: -O2); this may take a minute ...
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.*include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0
Warning: sysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" not found (ignoring for now).input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:32:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:81:2: warning: "Unsupported compiler detected" [-W#warnings]
#warning "Unsupported compiler detected"
 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:913:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:36:2: error: architecture not supported
#error architecture not supported
 ^
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_dev_t;         /* dev_t */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
        ^
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:69:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_ptrdiff_t.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:39:2: error: architecture not supported
#error architecture not supported
 ^
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:69:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_ptrdiff_t.h:32:9: error: unknown type name '__darwin_ptrdiff_t'
typedef __darwin_ptrdiff_t ptrdiff_t;
        ^
In file included from input_line_3:1:
In file included from ./include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:72:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h:31:9: error: unknown type name '__darwin_size_t'
typedef __darwin_size_t        rsize_t;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libCling.so              0x000000010c83a2a4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  libCling.so              0x000000010c839354 llvm::sys::RunSignalHandlers() + 72
2  libCling.so              0x000000010c83a8e4 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000190a36a84 _sigtramp + 56
4  libCling.so              0x0000000109d34674 CppyyLegacy::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) + 112
5  libCling.so              0x0000000109d32db4 CppyyLegacy::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) + 44
6  libCling.so              0x0000000109de4a18 CppyyLegacy::TCling::TCling(char const*, char const*, char const* const*, void*) + 9396
7  libCling.so              0x0000000109ddee10 CreateInterpreter + 64
8  libCoreLegacy.so         0x0000000105782340 CppyyLegacy::TROOT::InitInterpreter() + 192
9  libCoreLegacy.so         0x0000000105782224 CppyyLegacy::Internal::GetROOT2() + 44
10 libCling.so              0x0000000109dc63a8 TCling__GetInterpreter + 76
11 libCling.so              0x0000000109d909c8 RootClingMain(int, char**, bool) + 15632
12 libCling.so              0x0000000109d9f940 ROOT_rootcling_Driver + 512
13 rootcling                0x0000000104dc7f44 main + 136
14 dyld                     0x00000001906aff28 start + 2236
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.  Program arguments: ./bin/rootcling -rootbuild -generate-pch -f /var/folders/76/mm0_swqd58q3n62yt3xx20jw0000gn/T/allDict.cxx -noDictSelection -D__CLING__ -DROOT_PCH -I./include -I./etc -I./etc/dictpch -I./etc/cling -I/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include -cxxflags "-std=c++2a -m64 -pipe -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++" etc/dictpch/allHeaders.h etc/dictpch/allLinkDefs.h
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TCling::TCling(char const*, char const*, char const* const*, void*) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CreateInterpreter (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCoreLegacy.so] CppyyLegacy::TROOT::InitInterpreter() (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCoreLegacy.so] CppyyLegacy::Internal::GetROOT2() (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] TCling__GetInterpreter (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] RootClingMain(int, char**, bool) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] ROOT_rootcling_Driver (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/bin/rootcling] main (no debug info)
[/usr/lib/dyld] start (no debug info)
/opt/homebrew/lib/python3.11/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)
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.*include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0
Warning: sysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" not found (ignoring for now).input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
Replaced symbol at_quick_exit cannot be found in JIT!
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:32:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:81:2: warning: "Unsupported compiler detected" [-W#warnings]
#warning "Unsupported compiler detected"
 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:913:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:36:2: error: architecture not supported
#error architecture not supported
 ^
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_dev_t;         /* dev_t */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
        ^
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:69:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_ptrdiff_t.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:39:2: error: architecture not supported
#error architecture not supported
 ^
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:69:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_ptrdiff_t.h:32:9: error: unknown type name '__darwin_ptrdiff_t'
typedef __darwin_ptrdiff_t ptrdiff_t;
        ^
In file included from input_line_3:1:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:22:
In file included from /opt/homebrew/lib/python3.11/site-packages/cppyy_backend/include/RtypesCore.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h:72:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h:31:9: error: unknown type name '__darwin_size_t'
typedef __darwin_size_t        rsize_t;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CppyyLegacy::TCling::TCling(char const*, char const*, char const* const*, void*) (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCling.so] CreateInterpreter (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCoreLegacy.so] CppyyLegacy::TROOT::InitInterpreter() (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libCoreLegacy.so] CppyyLegacy::Internal::GetROOT2() (no debug info)
[/opt/homebrew/lib/python3.11/site-packages/cppyy_backend/lib/libcppyy_backend.so] _GLOBAL__sub_I_clingwrapper.cxx (no debug info)
[/usr/lib/dyld] invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const (no debug info)
[/usr/lib/dyld] invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const (no debug info)
[/usr/lib/dyld] invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const (no debug info)
[/usr/lib/dyld] dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const (no debug info)
[/usr/lib/dyld] dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const (no debug info)
[/usr/lib/dyld] dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const (no debug info)
[/usr/lib/dyld] dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const (no debug info)
[/usr/lib/dyld] dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const (no debug info)
[/usr/lib/dyld] dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const (no debug info)
[/usr/lib/dyld] dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const (no debug info)
[/usr/lib/dyld] dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const (no debug info)
[/usr/lib/dyld] dyld4::APIs::dlopen_from(char const*, int, void*) (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/lib-dynload/_ctypes.cpython-311-darwin.so] py_dl_open (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] cfunction_call (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyObject_MakeTpCall (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_Vector (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyObject_FastCallDictTstate (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] slot_tp_init (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] type_call (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyObject_MakeTpCall (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyEval_EvalCode (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] builtin_exec (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] cfunction_vectorcall_FASTCALL_KEYWORDS (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_Vector (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] object_vacall (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyObject_CallMethodObjArgs (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyImport_ImportModuleLevelObject (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyEval_EvalCode (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] builtin_exec (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] cfunction_vectorcall_FASTCALL_KEYWORDS (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_Vector (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] object_vacall (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyObject_CallMethodObjArgs (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyImport_ImportModuleLevelObject (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyEval_EvalFrameDefault (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyEval_EvalCode (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] run_eval_code_obj (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] run_mod (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyRun_InteractiveOneObjectEx (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyRun_InteractiveLoopObject (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] _PyRun_AnyFileObject (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] PyRun_AnyFileExFlags (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] pymain_run_stdin (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] Py_RunMain (no debug info)
[/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/Python] Py_BytesMain (no debug info)
[/usr/lib/dyld] start (no debug info)

I tried also installing Xcode but I still get an error. I also tried on another mac that wans't running apple silicon and it worked until I changed to a newer version of python that I installed with brew. Therefore I tried to run it on my mac on a virtual enviroment with the python that comes inlcuded which is Python 3.9.6 but it still didn't work. Maybe I'm missing something. If anyone needs other info I'll provide it. Thanks in advance

wlav commented 10 months ago

Yes, it's a problem still will SDKROOT. Incidentally, it's now fixed (for me anyway) in repo. I'm still having trouble with the wheels from the CI, though: even as it's build for Mac ARM, the binaries are the wrong architecture.

I kind of like the idea of having the CI build the wheels as the environment doesn't risk being polluted by any development setup I may have, but none of the wheels thus produced yet work on any platform (I still have to test the Windows' ones, maybe I get lucky). I'm wondering whether I should simply give up on that. :/

marktsuchida commented 10 months ago

Ah, so the PyPI wheels are manually built? I feel your pain....

wlav commented 10 months ago

I always did so far, but then a CI recipe was contributed, so I thought that would be great. However, I'm finding the CI to be far more unwieldy than building manually. :(

The problem with Cling is that it will bake in the local build paths as an additional way to find things like include headers etc. I.e., when building and running on my own machines, the result is guaranteed to work more often when I test it locally than on any other, different setup. I.e. a clean, alternate, build environment that doesn't favor my own would be preferable to guarantee portability. But the github CI build runners are all over the place.

wlav commented 10 months ago

All that said, I really do hope that this particular issue itself is solved now that I patched cling to use xcrun and changed the way it looks for sysroot. :)

marktsuchida commented 10 months ago

All that said, I really do hope that this particular issue itself is solved now that I patched cling to use xcrun and changed the way it looks for sysroot. :)

Awesome, thanks so much! Let me know if there is a good way for me to test now, or I'll look forward to the next release.

Hopefully the run-time discovery (xcrun, etc.) would help somewhat with CI builds. I can see that the multiple Xcode versions on GitHub runners could be a problem, for one thing. I'm sure there are other complications, though.

Alex-EEE commented 10 months ago

is that fix live? if not, please let us know when it is, can't wait to try it! we switched to pybind11 for one project, b/c of this issue, and ugh it was painful. would really love to stick with cppyy

wlav commented 10 months ago

@Alex-EEE: it's in the repo. I'm fighting the CI ... one other thing that would be great if that were functional, is that I could just point you to the artifacts to download.

I'm currently re-writing the workflow using the scikit-learn one as an example.

wlav commented 10 months ago

The CI path isn't going to work out: the ARM target is a cross-compilation, but the build process creates small helper executables. Presumably, it's possible to compile the latter for the host, while compiling the rest for ARM, but I'm giving up for now. The build process will be simplified once the move to Clang-REPL is complete.

For now, here's a wheel that should work, however. Appreciate feedback: http://cern.ch/wlav/cppyy_cling-6.28.6-py2.py3-none-macosx_11_0_arm64.whl

If confirmed, I can finally cut a new release...

(Edit just to say not to worry about pip complaining about version numbers when installing the above wheel. It's ABI compatible.)

marktsuchida commented 10 months ago

Looks like this works for me!

With the latest cppyy installed normally from PyPI (showing failure case first, then the workaround, then the new cppyy-cling),

$ pip list
Package       Version
------------- -------
cppyy         3.0.0
cppyy-backend 1.14.11
cppyy-cling   6.28.0
CPyCppyy      1.12.13
pip           23.3
setuptools    68.2.2
$ python
Python 3.11.5 (main, Aug 24 2023, 15:09:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cppyy
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.*include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0
>>> ^D
$ SDKROOT=$(xcrun --show-sdk-path) python
Python 3.11.5 (main, Aug 24 2023, 15:09:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cppyy
>>> ^D
$ pip install https://cern.ch/wlav/cppyy_cling-6.28.6-py2.py3-none-macosx_11_0_arm64.whl
Collecting cppyy-cling==6.28.6
  Using cached https://cern.ch/wlav/cppyy_cling-6.28.6-py2.py3-none-macosx_11_0_arm64.whl (27.9 MB)
Installing collected packages: cppyy-cling
  Attempting uninstall: cppyy-cling
    Found existing installation: cppyy-cling 6.28.0
    Uninstalling cppyy-cling-6.28.0:
      Successfully uninstalled cppyy-cling-6.28.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cppyy-backend 1.14.11 requires cppyy-cling==6.28.0, but you have cppyy-cling 6.28.6 which is incompatible.
cpycppyy 1.12.13 requires cppyy-cling==6.28.0, but you have cppyy-cling 6.28.6 which is incompatible.
cppyy 3.0.0 requires cppyy-cling==6.28.0, but you have cppyy-cling 6.28.6 which is incompatible.
Successfully installed cppyy-cling-6.28.6
$ python
Python 3.11.5 (main, Aug 24 2023, 15:09:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] 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 ...
>>> 

I got the same result with xcode-select pointing to either Xcode.app or CommandLineTools.

wlav commented 9 months ago

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

PouyaEsmaili commented 3 months ago

@wlav I have the same problem. Release 3 is not good for me because of a known issue of ns3 with it (#156, #175). Can you fix this on top of 2.4.2 and release a new patch for cppyy 2?

Gabrielcarvfer commented 3 months ago

@wlav I have the same problem. Release 3 is not good for me because of a known issue of ns3 with it (#156, #175). Can you fix this on top of 2.4.2 and release a new patch for cppyy 2?

As the ns-3 maintainer for build/python/platform-specific stuff:

  1. 175 has been fixed a long time ago for all of our test suites;

  2. 156 issues are still a problem, but a workaround has been merged making ns-3 compatible with cppyy3 (ns-3 needs to be built from source, e.g. cc51f7a, until ns-3.42 gets released at the end of the month);

  3. ns-3 does not test nor claim compatibility with MacOS for the python bindings. I suggest using docker instead;
  4. ns-3 now depends on C++20 features only available on cppyy3. In my opinion, it would be a waste of Wim's time to backport this kind of stuff to support older releases.
PouyaEsmaili commented 3 months ago

About 2, I built from master and still had the issue running first.py About 3, I think being able to debug inside an IDE is a feature we lose. Also, I suggest mentioning this in the installation documentation. I had to dig deep to come across these issues and find out what is the problem.

Gabrielcarvfer commented 3 months ago

About 2, I built from master and still had the issue running first.py About 3, I think being able to debug inside an IDE is a feature we lose. Also, I suggest mentioning this in the installation documentation. I had to dig deep to come across these issues and find out what is the problem.

You can report these issues in https://groups.google.com/u/0/g/ns-3-users, or https://gitlab.com/nsnam/ns-3-dev/-/issues, not to pollute the cppyy tracker. The intended way for people that are not really sure what they are doing to consume the ns-3 bindings is via pip. :)