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

Installation Error #37

Open
pygabc1 opened this issue Sep 10, 2020 · 7 comments
Open

Installation Error #37

pygabc1 opened this issue Sep 10, 2020 · 7 comments

Comments

@pygabc1
Copy link

pygabc1 commented Sep 10, 2020

Could somebody mention how to fix this installation error?
As the author recommended in here #27 , I downloaded the package primme-3.1.0.tar.gz from https://pypi.org/project/primme/#files
[Error]
.........
ERROR: Failed building wheel for primme
..........
fatal error LNK1181: cannot open input file 'lapack.lib'
..........
ERROR: Command errored out with exit status 1: 'C:\Python36\python3.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\pygab\AppData\Local\Temp\pip-req-build-n0b8nlzv\setup.py'"'"'; file='"'"'C:\Users\pygab\AppData\Local\Temp\pip-req-build-n0b8nlzv\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\pygab\AppData\Local\Temp\pip-record-hyrlexyo\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python36\Include\primme' Check the logs for full command output.

@eromero-vlc
Copy link
Collaborator

On Windows, the easiest way to install primme is throw conda. Make sure that MKL is installed on conda, for instance by doing:

conda install mkl-devel

Then, do on a conda terminal:

pip install numpy   # if numpy is not installed yet
pip install scipy   # if scipy is not installed yet
pip install future  # if using python 2
pip install primme

@pygabc1
Copy link
Author

pygabc1 commented Sep 10, 2020

On Windows, the easiest way to install primme is throw conda. Make sure that MKL is installed on conda, for instance by doing:

conda install mkl-devel

Then, do on a conda terminal:

pip install numpy   # if numpy is not installed yet
pip install scipy   # if scipy is not installed yet
pip install future  # if using python 2
pip install primme

Thank you, eromero-vlc. Let me double check. If I install primme by using conda terminal or conda command, it means it is installed in
\Users\...\anaconda3\env\py36\...
NOT in
C:\Python36\...,
isn't it?
I set NOT to use anaconda python when I install anaconda, and set to use my own python, which is
C:\Python36\...,
because they might conflict (or complicated to use them)

@eromero-vlc
Copy link
Collaborator

I haven't tried to use my own python like that. The thing is that primme requires the BLAS and LAPACK libraries and these libraries are found in MKL. I don't know if the effects of conda install mkl-devel are visible outside a conda terminal.

@pygabc1
Copy link
Author

pygabc1 commented Sep 10, 2020

I haven't tried to use my own python like that. The thing is that primme requires the BLAS and LAPACK libraries and these libraries are found in MKL. I don't know if the effects of conda install mkl-devel are visible outside a conda terminal.

Hi, eromero, I don't think the error comes from MKL. I could install mkl-devel in my local pycharm through setting > Python Interpreter > + (add package) > mkl-devel , but could not install primme, with error of "install with system terminal". Above error came when I install with system terminal (git bash or cmd). Thanks anyway.

@liwt31
Copy link

liwt31 commented Sep 14, 2020

Hi everyone! I met the same problem: fatal error LNK1181: cannot open input file 'lapack.lib'. I tried conda install mkl-devel but got no luck.

I've also tried moving on to this website to download lapack.lib and blas.lib and put them in my lib directory. The error was fixed but I got something new:

    blaslapack.obj : error LNK2001: unresolved external symbol "cgetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dlarnv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sgetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dscal_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ccopy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zhemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zpotrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dsytrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "strmm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgesvd_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zaxpy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dtrmm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "chetrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cgemv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sdot_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sgemv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zcopy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "daxpy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zhetrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ztrsm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dsygvx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dgetrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ssygvx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dsytrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgemv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cpotrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dgemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "caxpy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cheevx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "saxpy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dtrsm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dgetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sgemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zscal_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dgemv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dsyevx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "strsm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ssyevx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dsymm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zhetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sgesvd_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dcopy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ssytrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dgesvd_"
    blaslapack.obj : error LNK2001: unresolved external symbol "dpotrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "slarnv_"
    blaslapack.obj : error LNK2001: unresolved external symbol "scopy_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ssymm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cgetrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ctrmm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "chetrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ztrmm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cgemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "chemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cscal_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ssytrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zheevx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "spotrf_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ctrsm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "chegvx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cgees_"
    blaslapack.obj : error LNK2001: unresolved external symbol "cgesvd_"
    blaslapack.obj : error LNK2001: unresolved external symbol "ddot_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgemm_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sscal_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgetrs_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zhegvx_"
    blaslapack.obj : error LNK2001: unresolved external symbol "zgees_"
    blaslapack.obj : error LNK2001: unresolved external symbol "sgetrs_"

I figured it is probably because I've used the wrong version of lapack.lib or blas.lib. I hope the information could be helpful to the discussion.

@liwt31
Copy link

liwt31 commented Sep 14, 2020

I gave up hacking and read a little about the setup.py code. It appears that primme relies on numpy to determine where to find BLAS and so on. So I:

  • Uninstall the current numpy (which is installed by pip) with pip.
  • Reinstall numpy with conda: conda install numpy. In this way, numpy is linked to the MKL library.
  • Install primme with pip install primme.

And then primme is correctly installed. After that you may install the original numpy back and primme will work just fine.

@eromero-vlc
Copy link
Collaborator

Thanks for your contribution, @liwt31 ! On Windows, I have also tried to install primme without using conda's numpy, but I was not able to make it work. The Windows' numpy version on pypi is shipped with OpenBLAS dlls, but not the lib files required by the linker. The errors showed on previous comments came from the linker (error LNKXXXX).

I will update the documentation to note that conda's numpy is required on Windows to install primme.

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

3 participants