KIT-MBS / pydca

Direct coupling analysis software for protein and RNA sequences
MIT License
45 stars 22 forks source link

pip install fails with "file format not recognized" #4

Open edikedik opened 4 years ago

edikedik commented 4 years ago

Hello,

Attempting to pip install pydca into freshly created conda environment fails on Linux due to

build/temp.linux-x86_64-3.5/pydca/plmdca/lbfgs/lib/lbfgs.o: file not recognized: file format not recognized
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

I have gcc 10.1.0-2.

Sum02dean commented 3 years ago

I am also having this issue. I have tried installing from a fresh environment, both from pip and from install.sh but nothing seems to work.

file not recognized: file format not recognized collect2: error: ld returned 1 exit status error: command 'g++' failed with exit status 1

Sum02dean commented 3 years ago

Hello,

Attempting to pip install pydca into freshly created conda environment fails on Linux due to

build/temp.linux-x86_64-3.5/pydca/plmdca/lbfgs/lib/lbfgs.o: file not recognized: file format not recognized
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

I have gcc 10.1.0-2.

I have resolved the issue, the answer is practically the same as here (solved): https://github.com/pytorch/pytorch/issues/16683

In summary:

  1. Create new python env and activate it
  2. Git clone the repository to a directory of your choosing.
  3. Run python setup.py clean
  4. If using miniconda3: run cd ~/miniconda3/envs/ENV_NAME/compiler_compat/, else if using Anaconda: run ~/anaconda/envs/ENV_NAME/compiler_compat/
  5. Run mv ld ld_old
  6. Go back to dca repository
  7. Run bash install.sh

This should fix any issues with GCC compilation. The issue is that pydca is accessing the miniconda3/anaconda ld-linker when is should be using the system version.

Hope this helps.

Dean

Sum02dean commented 3 years ago

Important note: I found that the installation is in conflict with the latest version of Python (version 3.9). Before following the above instructions, make sure to install Python==3.7 into your newly initialized env before running steps 1-7.

best,

D

edikedik commented 3 years ago

Important note: I found that the installation is in conflict with the latest version of Python (version 3.9). Before following the above instructions, make sure to install Python==3.7 into your newly initialized env before running steps 1-7.

best,

D

Thanks for the instructions.

Installing with python=3.7 was the crucial moment for me, as it allowed for an error-free installation without the trick of renaming the ld-linker. Although, when installed, it throws Segmentation fault on any attempt to run pydca, which is another issue.