KlugerLab/FIt-SNE

Installation problems on Linux

lmweber opened this issue ยท 9 comments

Hi, I had some difficulties installing FIt-SNE on our Linux server, which I thought I would mention here in case others have the same problems.

First, I installed FFTW from source, using the source tarball from the provided link. I installed it into my home directory using the standard commands ./configure --prefix=$HOME, make, and make install.

Then, I cloned the FIt-SNE GitHub repository and tried running the g++ compiler command provided on the readme page. However, this gave the following errors:

In file included from src/tsne.cpp:39:0:
src/nbodyfft.h:7:19: fatal error: fftw3.h: No such file or directory
compilation terminated.
In file included from src/nbodyfft.cpp:3:0:
src/nbodyfft.h:7:19: fatal error: fftw3.h: No such file or directory
compilation terminated.

and

/usr/bin/ld: cannot find -lfftw3
collect2: error: ld returned 1 exit status

I managed to fix this by adding extra arguments to specify the include and lib directories (where the FFTW files were installed) in the g++ call, as follows:

g++ -std=c++11 -O3 src/sptree.cpp src/tsne.cpp src/nbodyfft.cpp -I<path_to_include_directory> -L<path_to_lib_directory> -o bin/fast_tsne -pthread -lfftw3 -lm

I think it would be helpful to include a few comments on this on the readme page, for users who do not have a lot of experience using compilers.

Good point. Note that if one installs FFTW without the --prefix then this is not needed and the g++ call works as is, but this probably requires root privileges and so I guess can be inconvenient on a server.

Thanks for the reply. Yes that makes sense, so this is probably only an issue for users who are installing without root privileges.

Hi,
I just compiled FFTW version 3.3.8 and installed it under my home folder (Ubuntu 16.04) since I do not have sudo rights on our cluster. I want to point out a minor thing to avoid possible confusions for other users. In my case, there was no include folder. The header files were located under the api folder. Also, the lib is called .libs. As a result, I created the binary for fast_tsne using the following command:

g++ -std=c++11 -O3 src/sptree.cpp src/tsne.cpp src/nbodyfft.cpp -I ~/fftw-3.3.8/api/ -L ~/fftw-3.3.8/.libs/ -o bin/fast_tsne -pthread -lfftw3 -lm

Lastly, thanks for figuring out how to install FIt-SNE without privileges.

I installed fftw using conda as suggested here: https://github.com/KlugerLab/pyFIt-SNE. But saw the same fftw3.h: No such file or directory error. Had to specify the fftw paths to make it work. Took me a while to find this post; I think it would be helpful to add some comments or a link to this issue.

@yimingli A link to this issue is right here https://github.com/KlugerLab/FIt-SNE on the front page in the Installation/Linux section. How would you suggest to make it more prominent?

@dkobak Ah, missed that. Thanks. I think I missed that because as a noob, I didn't know the error is related to sudo rights, until I saw your comment above. By the way I falled back to compile myself instead of pip install fitsne because pip install failed with the message:

Collecting fitsne
  Using cached https://files.pythonhosted.org/packages/46/1c/1f28558d49fbc8b719103cf999d12fa76f9e80959b1066803b0bc56bb015/fitsne-0.2.9.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-QvvPHM/fitsne/setup.py", line 10, in <module>
        with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

I was wondering if this error is related to the path issue.

@yimingli Ah, I understand now. Sorry, I have no idea about this error. I haven't tried to install pyFIt-SNE myself, I am using the old-school Python wrapper in this package (FIt-SNE). Maybe George @linqiaozhi will be able to help.

@yimingli Are you perhaps using Python2.x? That would explain this error, according to here. The version of FIt-SNE on PyPI requires Python 3. Could you make sure you're using Python3's pip?

Note that this is not really a necessary requirement--the person who made the PyPI version used some Python3 functions, and we never got around to making it backwards compatible.

Finally, if you're still having trouble, would you mind opening a new issue? This way if other users have the same problem they can find it, as it is not likely related to installing without root privileges as discussed here.

For me, .libs was not in fftw-3.3.8 directory but instead was in the directory above it. I dont know why. But thanks mshayan, it works.