pgfoster / p4-phylogenetics

A Python phyloinformatic toolkit, and an implementation of tree-heterogeneous models of evolution
GNU General Public License v2.0
29 stars 8 forks source link

Installation on other Linux distribution than Debian/Ubuntu #4

Closed tomas-fer closed 7 years ago

tomas-fer commented 7 years ago

When trying to install p4 on other Linux distribution than Debian/Ubuntu I get following error after typing python setup.py build: The setup.py script could not find the libgsl or gsl headers. So that is not going to work. Under openSUSE/Fedora/CentOS the gsl library is installed as 'gsl-devel'. So may be this is the problem? Do you have any advice how to solve this issue? Thank you, Tomas

pgfoster commented 7 years ago

Hi Tomas, My prerequisite package list was Ubuntu-centric, with Ubuntu names. Other linux distros would have perhaps slightly different names for the same packages. Your example was one of them. However, it should be a simple translation. So go ahead and use gsl-devel, and it should work.

Also, I see that my installation docs, specifically the preparation, are out of date in that they do not mention that scipy is now required.

cymon commented 7 years ago

Hi Tomas,

For CentOS 7 (and I assume newer RH derived distributions), you need gsl and gsl-devel which will install the GSL shared library in /usr/lib64 and headers in /usr/include/gsl. You need to make changes to the setup.py to point to the gsl headers (see notes in the file on latest github devel. version).

Cymon

On 29 November 2016 at 04:40, pgfoster notifications@github.com wrote:

Hi Tomas, My prerequisite package list was Ubuntu-centric, with Ubuntu names. Other linux distros would have perhaps slightly different names for the same packages. Your example was one of them. However, it should be a simple translation. So go ahead and use gsl-devel, and it should work.

Also, I see that my installation docs, specifically the preparation, are out of date in that they do not mention that scipy is now required.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pgfoster/p4-phylogenetics/issues/4#issuecomment-263474411, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEvV828Jbk_HruIL-hhzJhygkaJbnSGks5rC6yugaJpZM4K-Sot .

tomas-fer commented 7 years ago

Dear Cymon, pgfoster, thanks for your answers. However, even after installing gsl-devel and uncommenting lines in setup.py about my_include_dirs and my_lib_dirs the installation stops with the same error. What exactly the setup.py is searching for in these folders? Tomas

pgfoster commented 7 years ago

Tomas, Cymon, Not having a RH-like system to hand, I follow Tomas' question with a question. Cymon, it looks to me like setup.py is looking for something named gsl in /usr/include/gsl. Should it be looking in /usr/include instead? So should we set my_include_dirs = ['/usr/include'] rather than the current my_include_dirs = ['/usr/include/gsl']? -Peter

cymon commented 7 years ago

Hi Peter and Tomas,

I think you are right Peter, it should just be: my_include_dirs = ['/usr/include']

But then it should have found them by default no?

I've looked again at both a CentOS 5.4 and CentOS 7.2 release and in neither case did use rpms to install gsl - I built it from source to non-default root directories. But in both cases the binaries got installed to "my root/lib" and the headers to "my root/include/gsl". When I did the same on CentOS 6.8 by default it placed the binaries in "/usr/lib64".

Perhaps, if you still cannot build it Tomas you could try finding where gsl is installed:

$ sudo updatedb $ locate libgsl.a $ locate gsl_blas.h

Cymon

tomas-fer commented 7 years ago

Dear Peter, Cymon, thanks for this advice, it works now! Setting my_include_dirs = ['/usr/include'] and my_lib_dirs = ['/usr/lib64'] makes setup.py working on Fedora 24, CentOS 7.2 and OpenSUSE 42 (all three tested). All three distributions need gsl-devel and python-devel. OpenSUSE needs python-numpy-devel and python-scipy. Fedora and CentOS need numpy and scipy, Fedora need also redhat-rpm-config. May be this information could be included in documentation? Tomas

pgfoster commented 7 years ago

With Cymon's suggested fix #5 (thanks muchly!) it works on ubuntu, centos 7, and mac, without adjustment. So I think it is done.