Closed maichmueller closed 1 year ago
I can't reproduce it, but it's clear that there's a mix-up of headers from the conda install and the system, where several public system C headers pick up internal implementation headers from conda. Reading the headers in more detail, that per se shouldn't be a problem, as all the above are protected with feature macro's, so maybe it goes wrong from the beginning first when the incorrect c++config.h
(the system one) is being loaded.
What does strace python -c 'import cppyy' |& grep config.h
show?
@wlav the output of the strace reads
(cppyy) ➜ ~ strace python -c 'import cppyy' |& grep config.h
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/bits/c++config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/x86_64-conda-linux-gnu/bits/c++config.h", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/pstl/pstl_config.h", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/lib/python3.9/site-packages/cppyy_backend/etc/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/lib/python3.9/site-packages/cppyy_backend/etc//cling/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/lib/python3.9/site-packages/cppyy_backend/include/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/include/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/x86_64-conda-linux-gnu/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/c++/11.2.0/backward/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/lib/python3.9/site-packages/cppyy_backend/etc//cling/lib/clang/9.0.1/include/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/include/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/include-fixed/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/include/_G_config.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/anaconda3/envs/cppyy/bin/../x86_64-conda-linux-gnu/sysroot/usr/include/_G_config.h", O_RDONLY|O_CLOEXEC) = 3
That all looks correct ... I have no idea how this can then fail. :/
I still don't know how the above can fail, but cppyy 3.0.0 was released yesterday and is based on Clang13 (previous 2.4.2 was based on Clang9). If there were compatibility problems between that older Clang and specific versions of gcc, then these may have been fixed in Clang13 by upstream. It may be worth a try.
Since version 3.0 is not yet on the conda, I uninstalled it from the env and used pip to install version 3.0 instead. It seems that the new version is not installable either on my system with a different error message this time:
(cppyy) ➜ ~ pip install cppyy
Collecting cppyy
Downloading cppyy-3.0.0.tar.gz (27 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
Collecting cppyy-backend==1.14.11
Downloading cppyy-backend-1.14.11.tar.gz (34 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting cppyy-cling==6.28.0
Using cached cppyy_cling-6.28.0-py2.py3-none-manylinux2014_x86_64.whl (42.2 MB)
Building wheels for collected packages: cppyy-backend
Building wheel for cppyy-backend (pyproject.toml): started
Building wheel for cppyy-backend (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for cppyy-backend (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
running bdist_wheel
running build
running build_ext
checking for build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/src
/home/michael/anaconda3/envs/cppyy/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/michael/anaconda3/envs/cppyy/include -fPIC -O2 -isystem /home/michael/anaconda3/envs/cppyy/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/michael/anaconda3/envs/cppyy/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/michael/anaconda3/envs/cppyy/include -fPIC -I/tmp/pip-build-env-optws427/overlay/lib/python3.9/site-packages/cppyy_backend/include -I/home/michael/anaconda3/envs/cppyy/include/python3.9 -c src/clingwrapper.cxx -o build/temp.linux-x86_64-cpython-39/src/clingwrapper.o -O2 -pthread -std=c++1z -m64
error: command '/home/michael/anaconda3/envs/cppyy/bin/x86_64-conda-linux-gnu-cc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cppyy-backend
Failed to build cppyy-backend
ERROR: Could not build wheels for cppyy-backend, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I just set up a fresh environment (as described before) and installed cppyy via pip. This now actually worked and i could import cppyy. Maybe the change for version 3.0 did fix the issue. I'm closing this for now then @wlav.
Thanks for letting me know; I still have no idea as to what went wrong in the first place.
On a ubuntu 20.04 system with anaconda as package manager a basic installation (as per the docs) and subsequent import of cppyy in a python
3.9
shell will lead to the trigger of precompiling headers and fail.System:
Steps to reproduce:
Output generated: