-
Notifications
You must be signed in to change notification settings - Fork 11
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
Errors in Python Installation #28
Comments
To make this easier to reproduce, I extended your Dockerfile with the following lines:
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
still leaves some of the errors:
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 Changing this to gets ride of the "cc1: error: argument to '-O' should be " ... errors |
@wmtonkin In
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 ff0ee5b
If one runs the following from the top level "scs" dir:
git diff v1.3.2..ff0ee5b -- 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']
- extra_compile_args = ["-O3"]
+ extra_compile_args = ["-O3 -std=c99"]
library_dirs = []
extra_link_args = []
libraries = []
extra_define_macros = []
sources = ['scsmodule.c', ] + glob(os.path.join(root_dir, 'src/*.c'))
+ glob(os.path.join(root_dir, 'linsys/*.c'))
include_dirs = [root_dir, os.path.join(root_dir, 'include'),
get_include(), os.path.join(root_dir, 'linsys')]
I believe this change was introduced in commit `ef306c18094eb46fd846db72232ab4cdd54971b9`
Running
git diff
ef306c1^..ef306c1
-- 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_compile_args = ["-O3"]
+ extra_compile_args = ["-O3 -std=c99"]
library_dirs = []
extra_link_args = []
libraries = []
@@ -182,7 +182,7 @@ def install_scs(**kwargs):
extra_link_args += blas_info.pop('extra_link_args', []) +
lapack_info.pop('extra_link_args', [])
extra_compile_args += blas_info.pop('extra_compile_args', []) +
lapack_info.pop('extra_compile_args', [])
if not args.int32:
- extra_define_macros += [('DLONG', 1)] # longs for integer type
+ extra_define_macros += [('DLONG', 0)] # longs for integer type
_superscs_direct = Extension(
name='_superscs_direct',
Best Regards,
Bill Tonkin
|
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?
The text was updated successfully, but these errors were encountered: