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 install python package in Linux container #8

Closed
ca3tech opened this issue Dec 16, 2021 · 1 comment
Closed

cannot install python package in Linux container #8

ca3tech opened this issue Dec 16, 2021 · 1 comment

Comments

@ca3tech
Copy link

ca3tech commented Dec 16, 2021

I am unable to install orderedstructs in a Linux docker container. I originally tried with the python:3.9.9-bullseye image, which failed and I speculated that it was because there is no C++ 11 compiler for that environment. I then tried an image based on ubuntu:jammy which does have C++ 11 compiler available:

ARG VARIANT="jammy"
FROM ubuntu:${VARIANT}

ARG PYTHON_VERSION=3.9

# The following was actually performed in the running container
# The installation of python prompts for information and so
# doesn't work non-interactively
RUN apt update \
 && apt install -y build-essential python${PYTHON_VERSION} python3-pip \
 && apt-get autoremove -y \
 && apt-get clean -y \
 && rm -rf /var/lib/apt/lists/*

When doing the pip install I get:


...
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/usr/include/python3.9 -c src/cpp/SkipList.cpp -o build/temp.linux-x86_64-3.9/src/cpp/SkipList.o -Wall -Wextra -Werror -Wfatal-errors -Wno-c++11-compat-deprecated-writable-strings -std=c++11 -Isrc/cpp -USKIPLIST_THREAD_SUPPORT -Wno-stdlibcxx-not-found -g3 -O2 -DNDEBUG
    In file included from src/cpp/SkipList.h:397,
                     from src/cpp/SkipList.cpp:15:
    src/cpp/Node.h:21: error: ignoring ‘#pragma mark ’ [-Werror=unknown-pragmas]
       21 | #pragma mark -
          |
    compilation terminated due to -Wfatal-errors.
    cc1plus: all warnings being treated as errors
    error: command '/usr/bin/gcc' failed with exit code 1
...

I also tried installing clang and using that as the compiler. It fails as well, but differently:


...
    clang -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/usr/include/python3.9 -c src/cpp/SkipList.cpp -o build/temp.linux-x86_64-3.9/src/cpp/SkipList.o -Wall -Wextra -Werror -Wfatal-errors -Wno-c++11-compat-deprecated-writable-strings -std=c++11 -Isrc/cpp -USKIPLIST_THREAD_SUPPORT -Wno-stdlibcxx-not-found -g3 -O2 -DNDEBUG
    In file included from src/cpp/SkipList.cpp:15:
    In file included from src/cpp/SkipList.h:397:
    In file included from src/cpp/Node.h:12:
    In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/functional:54:
    In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/tuple:38:
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/utility:95:29: fatal error: no template named 'remove_cv'; did you mean '::std::remove_cv'?
               typename _Up = typename remove_cv<_Tp>::type,
                                       ^
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:1537:12: note: '::std::remove_cv' declared here
        struct remove_cv
               ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
...

@paulross
Copy link
Owner

Thanks for reporting this. I have just fixed it in version 0.3.7 and I have checked that build out of source on Linux when you set the USING_GCC environment variable thus:

USING_GCC=1 python setup.py ...

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

2 participants