Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
edikedik opened this issue Jun 18, 2020 · 4 comments
Open

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

edikedik opened this issue Jun 18, 2020 · 4 comments

Comments

@edikedik
Copy link

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
Copy link

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
Copy link

Sum02dean commented Apr 1, 2021

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):
pytorch/pytorch#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
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants