Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Space in -pthread arguments fails compilation #124

Open
guimaluf opened this issue Feb 14, 2020 · 4 comments
Open

Space in -pthread arguments fails compilation #124

guimaluf opened this issue Feb 14, 2020 · 4 comments

Comments

@guimaluf
Copy link

I followed Installing via with Intel compilers instructions and got this error:

ifort: error #10236: File not found:  ' -lpthread'

I've look at the compiling command and realise that was a extra space in the pthread argument.

https://github.com/qmlcode/qml/blob/master/setup.py#L41
https://github.com/qmlcode/qml/blob/master/setup.py#L28

I'm attaching the patch to fix that.
remove_pthread_extra_space.patch.txt

git apply remove_pthread_extra_space.patch.txt

@guimaluf guimaluf changed the title Space in -pthread arguments fails compiling module Space in -pthread arguments fails compiling module Feb 14, 2020
@guimaluf guimaluf changed the title Space in -pthread arguments fails compiling module Space in -pthread arguments fails compilation Feb 14, 2020
@maxjr82
Copy link

maxjr82 commented Apr 29, 2020

I am also having problems to compile the code using Intel compilers. I am trying to install via pip by specifying the Intel compiler options:

pip install qml --user -U --global-option="build" --global-option="--compiler=intelem" --global-option="--fcompiler=intelem"

But the installation breaks with an error message regarding the lpthread. So how can I use/apply the patch to correct the problem with the extra space?

Or if I clone the repository to my computer, how can I pass the compiler options argument for the setup.py installer?

@guimaluf
Copy link
Author

guimaluf commented Apr 29, 2020

download remove_pthread_extra_space.patch.txt file
and run
git apply remove_pthread_extra_space.patch.txt

@maxjr82
Copy link

maxjr82 commented Apr 29, 2020

Ok, this I understood. But once the patch has been applied to the local setup.py file, how to pass the intel compiler options in the command line for the local installation? Based on the git command for the installation using intel compiler, I tried something like this

python setup.py --compiler=intelem --fcompiler=intelem

but "compiler" option is not recognized. So I would like to know how to proceed after the patch. I will appreciate any help you can provide. Thanks!

@f3rmion
Copy link

f3rmion commented May 7, 2021

Hi @maxjr82,

I know this is already quite old, but today I faced the same problem and solved it as follows:

  1. Create fresh conda env (e.g., qml)
  2. Download source from PyPI and extract (why is the GH version still at version 0.4.0.12 while the PyPI version is at 0.4.0.27?)
  3. Make changes according to @guimaluf to the setup.py (remove whitespaces)
  4. Install requirements inside qml env (numpy, ase, scipy)
  5. pip install with this command locally within the qml env
pip install . --global-option="build" --global-option="--compiler=intelem" --global-option="--fcompiler=intelem"

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

No branches or pull requests

3 participants