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
Linking problem with atlas on OS X #1247
Comments
To me there is no issue to fix in scikit-learn: you need to build sklearn against the same blas lib as numpy and scipy. If you build numpy / scipy / scikit-learn with the default build environment of OSX (python / clang / accelerate framework) [1] then everything work fine and all tests pass on OSX 10.8. [1] this is what happens when you do |
I was not sure if it is necessary that all three projects are build against the same blas. But I guess it makes sense. |
@amueller @ogrisel I am having a similar problem with missing ATLAS symbols in sklearn, although I think in my case numpy, scipy and sklearn was linked against Accelerate: I didn't have this problem a few weeks ago, my guess would be that it was introduced by the recent update to scipy 0.11 in Macports? If you have Macports, could you please check if you can reproduce the issue? |
Can you find out what k_means.so was linked against? |
@amueller You mean
I gave some more info on what numpy / scipy / sklearn is linked against in the Macports ticket. |
I have built numpy / scipy / scikit-learn from sources (using the setup.py files) against Accelerate (on OSX 10.8) without any issue myself:
The python interpreter itself has been installed using homebrew:
I assume that it would also work with the default python from the system but I prefer to now install custom python package on it. I have not tried macports because I am quite happy with homebrew already. |
@ogrisel According to the build log (https://gist.github.com/3938458), my sklearn was built against the Accelerate BLAS:
Why does my
Note that I do have the |
I don't have time to dig deeper now but indeed there is probably a bug in one (or all) of our setup.py. |
I refactored that so that now the bug is in only one function ;) |
According to line 1347 in the gist, the linker flag is just |
I am a bit confused why you have if sys.platform=='darwin' and not os.environ.get('ATLAS',None):
args = []
link_args = []
if get_platform()[-4:] == 'i386':
intel = 1
else:
intel = 0
if os.path.exists('/System/Library/Frameworks/Accelerate.framework/'):
if intel:
args.extend(['-msse3'])
else:
args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework','-Wl,Accelerate'])
elif os.path.exists('/System/Library/Frameworks/vecLib.framework/'):
if intel:
args.extend(['-msse3'])
else:
args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework','-Wl,vecLib'])
if args:
self.set_info(extra_compile_args=args,
extra_link_args=link_args,
define_macros=[('NO_ATLAS_INFO',3)])
return Do you have any idea why it didn't find accelerate? |
On my machine:
and thus there will be something in The code says: "if Accelerate is there, set |
oh sorry. I misread the code. You are completely right. |
Note that at the end of line 1341 there is also: Without a closer look I don't know which
|
I guess we should get rid of |
I think you have |
When building sklearn outside Macports, I didn't have Removing
Can one of you try to reproduce the issue?
|
Sorry, no OS X here.... |
I've hit the same issue (building scikit-learn from source). Any movement on this? |
Ok, I tried re-running all of the link commands, but removing all instances of My flavor of the issue:
And the workaround:
The contents of workaround.py are at https://gist.github.com/4498773 |
I can reproduce this. I did two changes two my setup, at the same time: 1) switch from installer-python to macports python, 2) switch from installer-scipy to the current git head (ie, built instead of binary release). I suppose the second one is at fault, but still the issue was with scikit-learn, and I needed @ChrisBeaumont 's workaround. I will update when I understand it better. |
Uninstalling macports atlas fixes this. I suppose we should find out where the -L/opt/local/lib comes from and remove it unless that's the atlas path found by config. |
UPDATE: I solved the issue and the NO_ATLAS_INFO , -1 brought me on the way apparently I had a second blas/lapack via ubuntu. I deleted those and reinstalled numpy/scipy/sklearn and now everything works like a charm. I have the same issue...but on ubuntu.
the output of the build process
and
|
do we still need this open? |
Looks like I was one of the people with this issue in 2012. OK to close. |
ha. I'm happy with that. |
See mailing list.
The text was updated successfully, but these errors were encountered: