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

Difficulty installing fathon on Linux #1

Closed
ali-ramadhan opened this issue Nov 6, 2019 · 9 comments
Closed

Difficulty installing fathon on Linux #1

ali-ramadhan opened this issue Nov 6, 2019 · 9 comments

Comments

@ali-ramadhan
Copy link

I installed gsl through pacman but ran into a few issues.

The command given in step 3 of the README seems incorrect.

$ python setup.py build_ext -- =/usr/include/gsl/ -- =/usr/lib/ --inplace
zsh: /usr/include/gsl/ not found

so I changed it to

$ python setup.py build_ext -- /usr/include/gsl/* -- /usr/lib/ --inplace
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'

so apparently I had to install install Cython. Googling brought me to CellProfiler/centrosome#78 so it was simple to fix and now I think I got it to start compiling but I ran into another issue

$ python setup.py build_ext -- /usr/include/gsl/* -- /usr/lib/ --inplace
Compiling src/dfa.pyx because it changed.
Compiling src/dcca.pyx because it changed.
Compiling src/mfdfa.pyx because it changed.
Compiling src/ht.pyx because it changed.
[1/4] Cythonizing src/dcca.pyx
[2/4] Cythonizing src/dfa.pyx
[3/4] Cythonizing src/ht.pyx
[4/4] Cythonizing src/mfdfa.pyx
invalid command name '/usr/include/gsl/gsl_blas.h'

Apologies if I'm just doing something stupid. Just hoping to install fathon and try playing around with it.

Thanks so much!

@stfbnc
Copy link
Owner

stfbnc commented Nov 9, 2019

There was an error in the README, try python setup.py build_ext --include-dirs=/path/to/GSL/includes --rpath=/path/to/GSL/libs --inplace

@stfbnc
Copy link
Owner

stfbnc commented Nov 9, 2019

In your specific case, python setup.py build_ext --include-dirs=/usr/include/ --rpath=/usr/lib/ --inplace

@stfbnc
Copy link
Owner

stfbnc commented Nov 10, 2019

@ali-ramadhan I have now changed the installation guidelines in the README.md, and GSL is no more required.

Let me know if you still have problems with the installation.

@ashwinvis
Copy link

ashwinvis commented Nov 11, 2019

Hi @stfbnc, I should point out the instructions are not sufficient. Could be improved with the following suggestions:

  • As a first step, specify build requirements such as cython, numpy in requirements.txt file, with versions if necessary. Followed by
pip install -r requirements.txt

Better solutions to specify build requirements as pyproject.toml may be explored in the future.

  • Do not rely on shell commands via subprocess. Especially, use of shell=True is not recommended in the official documentation. Atleast use shutil and os.path / pathlib. An even better option be to use MANIFEST.IN which would copy LICENSE, README etc. while packaging with python setup.py sdist
  • Consider renaming directories ./src to ./fathon and move __init__.py. Set target for built extensions inside ./fathon. I believe that is the standard way. This would assist distuils to run python setup.py install and copy the code to site-packages.

@ashwinvis
Copy link

I followed your installation instructions in Ubuntu as it is now. But I get:

❯ python -c 'import fathon'          
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/avmo/src/sandbox/venv-fathon/lib/python3.8/site-packages/fathon/__init__.py", line 19, in <module>
    from .dfa import DFA
ImportError: libgsl.so.25: cannot open shared object file: No such file or directory

I had to run:

❯ LD_LIBRARY_PATH="../venv-fathon/lib/python3.8/site-packages/fathon/fathonGSL/lib/" python -c 'import fathon'

to make it work. Note that I am using a virtual environment.

@stfbnc
Copy link
Owner

stfbnc commented Nov 21, 2019

@ali-ramadhan @ashwinvis fathon is now available via pip and the user can choose to install GSL by themselves or let pip download and install it.
See the README.md for the installation guidelines.

@ashwinvis I have followed your suggestions. In the readme there are now also instructions for fathon installation in a virtual environment.

@ashwinvis
Copy link

Thank you so much! It looks much better now. I really appreciate the effort you took to improve the installation.

@stfbnc
Copy link
Owner

stfbnc commented Dec 3, 2019

@ali-ramadhan @ashwinvis Any news with the installation?

@ali-ramadhan
Copy link
Author

ali-ramadhan commented Dec 17, 2019

@stfbnc I was able to install fathon on Arch Linux, thank you!

A small hiccup with GSL that I mention in #2 but I'll close this issue as @ashwinvis also seems happy with the installation process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants