NSLS-II / docs

Standards Documentation for NSLS-II DAQ and Analysis
https://nsls-ii.github.io
BSD 2-Clause "Simplified" License
2 stars 13 forks source link

Add tomopy recipe. #61

Closed danielballan closed 5 years ago

danielballan commented 7 years ago

Work in progress. This works locally but not on Travis yet.

mrakitin commented 5 years ago

@danielballan, if you have a chance, please check the conflicting .travis file. I'm not sure what should be the correct fix as a custom package is installed into a conda env. Thanks.

danielballan commented 5 years ago

At the time that this PR was written, we used conda. Now we just use pip, which have found to be faster overall (because you don't need to install conda and Python first) and more reliable. The requirements come in implicitly through requirements.txt, which Travis automatically installs.

It looks like Tomopy is not pip-installable, so the best option may be to install it from source. Whether that's the worth the trouble to maintain as part of NSLS-II/docs is debatable.

mrakitin commented 5 years ago

I see, thanks for the explanation. Where should the source install instructions go?

mrakitin commented 5 years ago

@danielballan, I don't understand why Travis changed Python's directories in this build:

/home/travis/build/NSLS-II/docs/source/_cookbook/live_recon.py failed to execute correctly: Traceback (most recent call last):
  File "/home/travis/build/NSLS-II/docs/source/_cookbook/live_recon.py", line 36, in <module>
    import tomopy
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/tomopy/__init__.py", line 55, in <module>
    from tomopy.misc.corr import *
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/tomopy/misc/corr.py", line 60, in <module>
    import tomopy.util.extern as extern
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/tomopy/util/extern.py", line 115, in <module>
    LIB_TOMOPY = c_shared_lib('libtomopy')
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/tomopy/util/extern.py", line 109, in c_shared_lib
    return load_dll(sharedlib)
  File "/opt/python/3.6.3/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/opt/python/3.6.3/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmkl_rt.so: cannot open shared object file: No such file or directory

In the first case it's /home/travis/virtualenv/python3.6.3/lib/python3.6, but then /opt/python/3.6.3/lib/python3.6/. Any ideas?

I have a workaround in https://github.com/NSLS-II/docs/pull/61/commits/41141c8b92bfe525e83fad2a0059ca6017b9d3b4#diff-354f30a63fb0907d4ad57269548329e3R17, which seems to solve the problem, but not sure why it's not searching in the proper place first (where Python venv is installed).

mrakitin commented 5 years ago

Anyway, it's built successfully now! Please merge at your convenience.

danielballan commented 5 years ago

Merging to get this up in time for tomorrow. Will circle back later for that question.

mrakitin commented 5 years ago

Thank you @danielballan!