FXIhub / condor

Condor: a simulation tool for flash X-ray imaging
http://lmb.icm.uu.se/condor
BSD 2-Clause "Simplified" License
25 stars 14 forks source link

Can not import nfft module #34

Closed s-kesh closed 3 years ago

s-kesh commented 3 years ago

Tried to run example.py after installing condor as per documentation. Encountered

---------------------------------------------------------------------------------------------------

>>> Example 1/17: PARTICLE IDEAL SPHERE (configfile)
cd /var/home/keshav/phd/beamline/condor_simulations/condor/examples/configfile/particle_sphere; rm -f condor.cxi; condor
[start output]
Traceback (most recent call last):
  File "/usr/local/bin/condor", line 33, in <module>
    sys.exit(load_entry_point('condor==1.0.7', 'console_scripts', 'condor')())
  File "/usr/local/bin/condor", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib64/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib64/python3.9/site-packages/condor/__init__.py", line 33, in <module>
    from .experiment import Experiment
  File "/usr/local/lib64/python3.9/site-packages/condor/experiment.py", line 53, in <module>
    import condor.utils.nfft
ImportError: libnfft3.so.1: cannot open shared object file: No such file or directory
[end output]
Traceback (most recent call last):
  File "/var/home/keshav/phd/beamline/condor_simulations/condor/examples.py", line 147, in <module>
    run_examples()
  File "/var/home/keshav/phd/beamline/condor_simulations/condor/examples.py", line 133, in run_examples
    raise Exception(">>> Example %i (%s) failed. Abort." % (i+1,e["name"]))
Exception: >>> Example 1 (PARTICLE IDEAL SPHERE (configfile)) failed. Abort.

It failed to open libnfft3.so.1, but NFFT is installed at /usr/local/lib/libnfft3.so.1.

$ locate libnfft
/usr/local/lib/libnfft3.a
/usr/local/lib/libnfft3.la
/usr/local/lib/libnfft3.so
/usr/local/lib/libnfft3.so.1
/usr/local/lib/libnfft3.so.1.0.0
FilipeMaia commented 3 years ago

Can you run ldd on /usr/local/lib64/python3.9/site-packages/condor/utils/nfft*.so?

s-kesh commented 3 years ago
$ ldd /usr/local/lib64/python3.9/site-packages/condor/utils/nfft*.so
linux-vdso.so.1 (0x00007ffd387d0000)
libnfft3.so.1 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007f0a11a26000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0a11c01000)

ok, libnfft3.so.1 not found. Should I just create a symlink from /usr/local/lib/libnfft3.so.1?

FilipeMaia commented 3 years ago

I have a feeling the install location of libnfft3 is wrong. It should probably be /usr/local/lib64/ not /usr/local/lib/.

s-kesh commented 3 years ago

So, I configured nfft3 to make libpath /usr/local/lib64 and it installed in /usr/local/lib64.

$ locate libnfft3
/usr/local/lib64/libnfft3.a
/usr/local/lib64/libnfft3.la
/usr/local/lib64/libnfft3.so
/usr/local/lib64/libnfft3.so.4
/usr/local/lib64/libnfft3.so.4.0.3
/usr/local/lib64/libnfft3_threads.a
/usr/local/lib64/libnfft3_threads.la
/usr/local/lib64/libnfft3_threads.so
/usr/local/lib64/libnfft3_threads.so.4
/usr/local/lib64/libnfft3_threads.so.4.0.3

But still i am getting libnfft3.so.1 not found

mhantke commented 3 years ago

Does LD_LIBRARY_PATH list /usr/local/lib64?

On Sat, 8 May 2021 at 10:16, Keshav Sishodia @.***> wrote:

So, I configured nfft3 to make libpath /usr/local/lib64 and it installed in /usr/local/lib64.

$ locate libnfft3 /usr/local/lib64/libnfft3.a /usr/local/lib64/libnfft3.la /usr/local/lib64/libnfft3.so /usr/local/lib64/libnfft3.so.4 /usr/local/lib64/libnfft3.so.4.0.3 /usr/local/lib64/libnfft3_threads.a /usr/local/lib64/libnfft3_threads.la /usr/local/lib64/libnfft3_threads.so /usr/local/lib64/libnfft3_threads.so.4 /usr/local/lib64/libnfft3_threads.so.4.0.3

But still i am getting libnfft3.so.1 not found

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FXIhub/condor/issues/34#issuecomment-835200725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADMV6PLDS2PKIPKTD2VFP3TMTXPFANCNFSM44LA7BKA .

FilipeMaia commented 3 years ago

The issue is that you compiled condor with a different nfft version than the one you installed now. Notice the libnfft3.so.4 that you installed now versus the libnfft3.so.1 that it's looking for.

s-kesh commented 3 years ago

Thanks setting this environment variable solved the issue.

Does LD_LIBRARY_PATH list /usr/local/lib64? On Sat, 8 May 2021 at 10:16, Keshav Sishodia @.***> wrote: So, I configured nfft3 to make libpath /usr/local/lib64 and it installed in /usr/local/lib64. $ locate libnfft3 /usr/local/lib64/libnfft3.a /usr/local/lib64/libnfft3.la /usr/local/lib64/libnfft3.so /usr/local/lib64/libnfft3.so.4 /usr/local/lib64/libnfft3.so.4.0.3 /usr/local/lib64/libnfft3_threads.a /usr/local/lib64/libnfft3_threads.la /usr/local/lib64/libnfft3_threads.so /usr/local/lib64/libnfft3_threads.so.4 /usr/local/lib64/libnfft3_threads.so.4.0.3 But still i am getting libnfft3.so.1 not found — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADMV6PLDS2PKIPKTD2VFP3TMTXPFANCNFSM44LA7BKA .