danielfrg / tsne

A python wrapper for Barnes-Hut tsne
Apache License 2.0
404 stars 132 forks source link

Difficulty with anaconda #5

Closed ghost closed 9 years ago

ghost commented 9 years ago

Not sure exactly why, but building this from both source and with anaconda's pip resulted in the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "tsne/__init__.py", line 5, in <module>
    from bh_sne import BH_SNE
ImportError: ./bh_sne.so: undefined symbol: ATL_dgemm

The library always compiled correctly, but had this linking difficulty. Running ldd /path/to/bh_sne.so didn't report any dependency on libcblas.so, so something is going on wrong during linking. Possibly related to this.

Anyway, I eventually discovered that installing with /usr/bin/pip rather than anaconda dodged the issue, and copying bh_sne.so from the system path to the anaconda directory avoided the malformed shared object. So I've moved on - but I thought I would report anyway.

My system is Ubuntu 14.04 and I install cblas with sudo apt-get install libatlas-base-dev

danielfrg commented 9 years ago

Thanks for the report Russell, ill take a look at this when i get a chance.

PD: I love pythonpy ;)

danielfrg commented 9 years ago

I tested on a simple docker container (https://github.com/danielfrg/tsne/blob/master/Dockerfile) and it looks to be working for me:

# ldd bh_sne.so
    linux-vdso.so.1 =>  (0x00007ffd9532b000)
    libpython2.7.so.1.0 => /opt/conda/lib/libpython2.7.so.1.0 (0x00007fc660c5a000)
    libcblas.so.3 => /usr/lib/libcblas.so.3 (0x00007fc660a3d000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc660736000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc6604b4000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc66029e000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc660082000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc65fcf7000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc65faf3000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fc65f8f0000)
    libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007fc65f2f5000)
    libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fc65efdf000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc661259000)
    libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fc65edaa000)
ghost commented 9 years ago

Yea, I expected this would be difficult to reproduce - it may have something to do with the fact that I'm running on a cluster with NFS where the anaconda and .so files may not be collocated on the same machine - because I never had any issues setting up tsne before. I'll close this and if someone else has the same issue at some point, they should be able to find it.

Thanks for looking into this though.

arthim commented 8 years ago

I have the exact same error message from bh_sne import BH_SNE ImportError: ./bh_sne.so: undefined symbol: ATL_dgem

4.1.7-15.23.amzn1.x86_64 GNU/Linux

I'm using anaconda installation for python