I’m trying to build CTranslate2 from source after customising the code in python/translator.cc file.
I’m using the guide here: https://opennmt.net/CTranslate2/installation.html
When I install the python package on the same computer where I built it, it works. But when I install the python package on a different computer from my private artifactory, it doesn’t work - when I’m running the following code:
from ctranslate2 import Translator
I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/envs/arty_env/lib/python3.9/site-packages/ctranslate2/__init__.py", line 21, in <module>
from ctranslate2._ext import (
ImportError: libctranslate2.so.4: cannot open shared object file: No such file or directory
I suspect that the C++ stuff is not included in the python package build (the resulting .whl file is just ~500kb).
I did pay attention to the “Attention” section in the install guide. It looks like the install directory of CTranslate2 in the computer that builds it is in “/home/ubuntu/my_ctranslate2”, so I did: export CTRANSLATE2_ROOT=/home/ubuntu/my_ctranslate2, but it didn’t help.
More Info:
This is my cmake command:
make -DWITH_CUDA=ON -DWITH_CUDNN=ON -DWITH_DNNL=ON -DCUDA_DYNAMIC_LOADING=ON -DCMAKE_INSTALL_PREFIX=/home/ubuntu/my_ctranslate2 ..
and I also ran sudo ldconfig
I would be happy if you can help me with this problem
but the resulting .whl file is still small and doesn’t contain the libctranslate2.so file.
I will keep trying to make it work, I will open an issue in Github if I won’t make any progress.