Skip to content

Compiled library files are not linked when installing with conda #39

@denbonte

Description

@denbonte

Dear Dan,

Good day, and thanks for your work on maintaining the package!

I installed PascalX in a conda environment following the procedure below:

git clone https://github.com/BergmannLab/PascalX.git
cd PascalX
make all
cd python
python3 setup.py install 

After installing the boost libraries in the conda environment:

conda install boost libboost py-boost

Following a recommendation from a colleague, I updated the first line of the Makefile from:

CC=g++ 

To:

CC=g++ -I path_to_miniconda3_folder/PascalX/includeODIR=build

Where path_to_miniconda3_folder is the location where I created a fresh conda environment, in my case running Python 3.10.16:

conda create --prefix path_to_miniconda3_folder/PascalX python=3.10

Everything seemed to work fine, until this point:

>>> from PascalX import genescorer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "path_to_miniconda3_folder/envs/PascalX/PascalX/python/PascalX/genescorer.py", line 20, in <module>
    from PascalX import wchissum,snpdb,tools,refpanel,genome,hpstats
  File "path_to_miniconda3_folder/envs/PascalX/PascalX/python/PascalX/wchissum.py", line 21, in <module>
    from PascalX_core import lib,ffi
ImportError: libruben.so: cannot open shared object file: No such file or directory

After checking the folders resulting from the make command, I found that it was just a matter of these shared objects not being linked (as they are actually found in the PascalX/build/lib folder. A very fast and easy solution is to create a symlink to libruben.so, libdavies.so , and libwchissum.so in the lib folder of the conda environment, in this example path_to_miniconda3_folder/PascalX/lib:

ln -s path_to_git_folder/PascalX/build/lib/libruben.so path_to_miniconda3_folder/PascalX/lib/libruben.so
ln -s path_to_git_folder/PascalX/build/lib/libdavies.so path_to_miniconda3_folder/PascalX/lib/libdavies.so
ln -s path_to_git_folder/PascalX/build/lib/libwchissum.so path_to_miniconda3_folder/PascalX/lib/libwchissum.so

We replicated the same problem on multiple machines (and different Python versions, the latest being 3.12.3), and this simple procedure above solved the error(s) on all of them.

I am not sure whether this is something that can be easily solved for the conda-packaged PascalX, but I figured writing it here. people with the same problem (and make you aware that this couldmight help some an issue for some users)!

Thank you in advance for your help!
Dennis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions