Open wielandbrendel opened 5 years ago
To make this easier to reproduce, I extended your Dockerfile with the following lines:
COPY python/ /superscs/python
RUN apt-get install -y python3-pip
RUN pip3 install --upgrade pip
RUN pip3 install numpy scipy
RUN cd /superscs/python && python3 setup.py install
This basically gives the same errors as reported above.
@wielandbrendel The Python interface of SuperSCS needs python2 (it has been tested with Python v2.7).
@alphaville Great, thanks for the quick response! Python2 solves some but not all problems: changing the lines above to
RUN apt-get install -y python-pip
RUN pip install --upgrade pip
RUN pip install numpy scipy
RUN cd /superscs/python && python setup.py install
still leaves some of the errors:
gcc: ../src/util.c
gcc: scsmodule.c
gcc: ../src/unit_test_util.c
gcc: ../linsys/direct/external/amd_postorder.c
gcc: ../linsys/direct/external/amd_dump.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
gcc: ../linsys/direct/external/amd_2.c
gcc: ../linsys/direct/external/amd_control.c
gcc: ../linsys/direct/external/SuiteSparse_config.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
gcc: ../linsys/direct/external/amd_valid.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
I'd love to help with a Python3 version but fear that my non-existent knowledge of C is not much of a help here :(.
I think the problem here is that in python/setup.py extra_compile_args = ["-O3 -std=c99"]
Changing this to extra_compile_args = ['-O3', '-std=c99']
gets ride of the "cc1: error: argument to '-O' should be " ... errors
@wmtonkin In python/setup.py
, line 185, the extra compilation arguments are
extra_compile_args = [""]
which version of SuperSCS are you using? You could download the latest version.
Hello Pantelis,
Thank you for getting back to me, I very much appreciate it.
I was building from master, commit ff0ee5b457d062d5aa0f5f2c27c384f9a161a9a2
If one runs the following from the top level "scs" dir: git diff v1.3.2..ff0ee5b457d062d5aa0f5f2c27c384f9a161a9a2 -- python/setup.py
It will show (snipped for brevity):
@@ -157,14 +182,14 @@ def install_scs(**kwargs): blas_info = kwargs['blas_info'] lapack_info = kwargs['lapack_info']
I believe this change was introduced in commit ef306c18094eb46fd846db72232ab4cdd54971b9
Running
git diff ef306c18094eb46fd846db72232ab4cdd54971b9^..ef306c18094eb46fd846db72232ab4cdd54971b9 -- python/setup.py
diff --git a/python/setup.py b/python/setup.py index fc98245b..f7d1aa5b 100644 --- a/python/setup.py +++ b/python/setup.py @@ -157,7 +157,7 @@ def install_scs(**kwargs): blas_info = kwargs['blas_info'] lapack_info = kwargs['lapack_info']
extra_define_macros += [('DLONG', 0)] # longs for integer type
_superscs_direct = Extension( name='_superscs_direct',
Best Regards, Bill Tonkin
I think the problem here is that in python/setup.py extra_compile_args = ["-O3 -std=c99"]
Changing this to extra_compile_args = ['-O3', '-std=c99']
gets ride of the "cc1: error: argument to '-O' should be " ... errors
Thanks, it works!
I am running into a few issues when trying to install the Python version. After calling
sudo python3 setup.py install
I get (sorry for the long traceback):Do you have any idea what's going wrong?