Open VasSkliris opened 5 months ago
Hi Vassilis, this is because cuPhenom has not been compiled. It's a little clunky, but you have to compile cuPhenom first before you can run the library, I think there are instructions for this in the readme? I don't know if there is an easier way to use compiled C binaries in Python libraries, or have it automatically compile when you install it, I'm not sure.
Also I hope the tests run okay apart from this, they are a bit touch and go and see to break whenever I leave them alone for a while.
I did compiled it and it retuerned this:
nvcc ./src/cuphenom_functions.c ./src/cuda_functions.cu -shared -fPIC -lcurand -lcufft -I./include -I./io_tools/include -I./py_tools/include -I./cuda_tools/include -I/usr/include/gsl -Wall -Wextra -Wconversion -Wno-unused-function -Xcompiler "-Wno-unused-function -Wall -Wextra" -arch=native -use-fast-math -O3 -Xcompiler "-march=native -Ofast" -forward-unknown-to-host-compiler -lcrypt -lpthread -ldl -lutil -lrt -lm -L/usr/lib -lgsl -lgslcblas -o ./python/libphenom.so
so I assumed it did compiled it
Hmm, that is what happens when you compile. It must either have failed to compile for some reason or placed the output in the wrong place, there should be a shared object file ".so" called "libphenom.so" in this location "./gravyflow/gravyflow/cuphenom/python/libphenom.so". Is that there? Its possible that it's in the wrong place.
It is there yes, also just to clarify I run pytest from inside gravyflow repo or outside? When I run from the inside I get this:
`(mly-base-test) [vasileios.skliris@ldas-pcdev12 gravyflow]$ pytest gravyflow
ImportError while loading conftest '/home/vasileios.skliris/gravyflow/gravyflow/tests/conftest.py'.
gravyflow/init.py:13: in
`
I am unsure then, there may be a bug in how I get the shared library object location, is it urgent that this is fixed? I will probably have to look at it in context. You should be able to run pytest from inside the gravyflow directory by simply running pytest, or from outside the directory by running pytest gravyflow.
No no urgency, puting time to go through the notebooks. I will try building an isolated env where i install the package just to be sure
(mly-base-test) [vasileios.skliris@ldas-pcdev12 ~]$ pytest gravyflow =============================================================================== test session starts ================================================================================ platform linux -- Python 3.10.13, pytest-8.2.1, pluggy-1.5.0 rootdir: /home/vasileios.skliris/gravyflow plugins: ligo.skymap-1.0.7 collected 0 items / 2 errors
====================================================================================== ERRORS ====================================================================================== _ ERROR collecting gravyflow/cuphenom/python/test_cuphenom.py __ gravyflow/gravyflow/cuphenom/python/test_cuphenom.py:11: in
from .cuphenom import imrphenomd
gravyflow/gravyflow/cuphenom/python/cuphenom.py:16: in
lib = CDLL(f'{current_dir}/libphenom.so')
.conda/envs/mly-base-test/lib/python3.10/ctypes/init.py:374: in init
self._handle = _dlopen(self.name, mode)
E OSError: libcurand.so.10: cannot open shared object file: No such file or directory
____ ERROR collecting gravyflow/tests _____
.conda/envs/mly-base-test/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)