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

scipy fails compilation when building from source #8680

Closed
aisri opened this issue Apr 4, 2018 · 11 comments
Closed

scipy fails compilation when building from source #8680

aisri opened this issue Apr 4, 2018 · 11 comments
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS defect A clear bug or issue that prevents SciPy from being installed or used as expected
Milestone

Comments

@aisri
Copy link

aisri commented Apr 4, 2018

scipy_build_tail.log

Building the scipy source from tip fails when compiling :
This might be the offending line: Dont know how the line in BLOCK text showed up
-L"Using built-in specs

/opt/amba/cv22_third/tv2/exe/gfortran -Wall -g -Wall -g -shared build/temp.linux-x86_64-3.5/scipy/integrate/_quadpackmodule.o -L/opt/amba/cv22_third/tv2/release/atlas/3.10.3/lib -L"Using built-in specs.

PLEASE HELP. BLOCKING DEVELOPMENT

Error message:

building 'scipy.integrate._odepack' extension
compiling C sources
C compiler: gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -v -fPIC

Scipy/Numpy/Python version information:

<<Output from 'import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)'>>

Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'scipy' has no attribute '__version__'

@aisri
Copy link
Author

aisri commented Apr 4, 2018

UPDATE:

upon removing the extra_link_args (-Wl, --version-script=) by commenting line#214 compilation succeeded. or upon cleaning up the list ext.extra_link_args
Guess, setup.py does not clear() the list before appending new stuff or is it the expected behavior.
Why does odepack needs version info of quadpack ?

This change in setup.py fixes issue.

214                     ext.extra_link_args.clear()
215                     ext.extra_link_args.append('-Wl,--version-script=' + script_fn)

@ilayn
Copy link
Member

ilayn commented Apr 25, 2018

@aisri Is this issue resolved? We don't have much information to work with so I don't know how we can help.

@ilayn ilayn added defect A clear bug or issue that prevents SciPy from being installed or used as expected Build issues Issues with building from source, including different choices of architecture, compilers and OS labels Apr 25, 2018
@aisri
Copy link
Author

aisri commented Apr 25, 2018

@ilayn I got it resolved by making changes to your setup.py script. These are the lines I changed. You can review these changes

> 214                     ext.extra_link_args.clear()
> 215                     ext.extra_link_args.append('-Wl,--version-script=' + script_fn)

@ilayn
Copy link
Member

ilayn commented Apr 25, 2018

The problem is that we can't understand what the cause was in the first place. Could you provide your system and configuration? Otherwise this is a special fix for your own system.

@rgommers
Copy link
Member

rgommers commented Sep 2, 2018

/usr/bin/ld: anonymous version tag cannot be combined with other version tags - seems to be an unusual issue, unclear what is causing it here.

@michaelhutt
Copy link

I got the same error (scipy 1.0.1 is fine). I'm using CentOS 7.5, gcc 4.8.5, ld/binutils 2.27-28.
My ~/.numpy-site.cfg is:

[mkl]
library_dirs = /opt/intel/compilers_and_libraries_2017/linux/mkl/lib/intel64
lapack_libs = mkl_rt
mkl_libs=mkl_rt
extra_link_args = -Wl,-rpath=/opt/intel/compilers_and_libraries_2017/linux/mkl/lib/intel64

The build succeeds if I comment out the 'extra_link_args'.

@zerothi
Copy link
Contributor

zerothi commented Oct 29, 2018

I have the same problem

Sys-info:

binutils: 2.31.1
numpy: 1.15.3
site.cfg:

[openblas]
...
extra_link_args = ...

GCC 8.2.0
Debian 9u6

It successfully compiles with the above fix.

@zerothi
Copy link
Contributor

zerothi commented Oct 29, 2018

This small addition also seems to work fine (simply remove any version-script flags already in the argument list):

ext.extra_link_args = [arg for arg in ext.extra_link_args if not "version-script" in arg]

@rgommers rgommers added this to the 1.2.0 milestone Oct 29, 2018
@tylerjereddy
Copy link
Contributor

Are we willing to make the fix proposed above without perhaps fully understanding the issue? I don't see a linked PR.

@rgommers
Copy link
Member

rgommers commented Nov 6, 2018

The fix from @zerothi seems fine to make in any case. Let's do that.

tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Nov 6, 2018
* remove any version-script flags prior
to processing of extra_link_args in
setup.py to resolve scipygh-8680
@rgommers
Copy link
Member

rgommers commented Nov 7, 2018

This was introduced in gh-8463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS defect A clear bug or issue that prevents SciPy from being installed or used as expected
Projects
None yet
Development

No branches or pull requests

6 participants