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

Error. OpenBLAS could not be compiled #1020

Closed
cswluo opened this issue Nov 24, 2016 · 5 comments
Closed

Error. OpenBLAS could not be compiled #1020

cswluo opened this issue Nov 24, 2016 · 5 comments

Comments

@cswluo
Copy link

cswluo commented Nov 24, 2016

I install torch 7 on ubuntu 16.04 following the official site instructions, but it fails when compiling the OpenBLAS. Can anyone help to fix this problem?

make[1]: Leaving directory '/tmp/OpenBLAS/ctest'
make[1]: Entering directory '/tmp/OpenBLAS/exports'
perl ./gensymbol linktest x86_64 _ 0 0 0 0 0 0 "" "" 1 > linktest.c
gcc -O2 -DMAX_STACK_ALLOC=2048 -fopenmp -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DUSE_OPENMP -DNO_WARMUP -DMAX_CPU_NUMBER=16 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME="_" -DCHAR_CNAME="" -DNO_AFFINITY -I.. -shared -o ../libopenblas_haswellp-r0.2.20.dev.so
-Wl,--whole-archive ../libopenblas_haswellp-r0.2.20.dev.a -Wl,--no-whole-archive
-Wl,-soname,libopenblas.so.0 -lm -lpthread -lgfortran -lm -lpthread -lgfortran
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target '../libopenblas_haswellp-r0.2.20.dev.so' failed
make[1]: *** [../libopenblas_haswellp-r0.2.20.dev.so] Error 1
make[1]: Leaving directory '/tmp/OpenBLAS/exports'
Makefile:85: recipe for target 'shared' failed
make: *** [shared] Error 2
Error. OpenBLAS could not be compiled

@martin-frbg
Copy link
Collaborator

martin-frbg commented Nov 24, 2016

/usr/bin/ld: cannot find -lgfortran

Looks like your Ubuntu is missing a gfortran-dev package, or perhaps your gcc and gfortran are different
release versions, confusing the build system about where to find the libraries. What version numbers do
"gcc --version" and "gfortran --version" return ?
See JuliaLang/julia#6150 for a similar question (but ignore the part of the discussion where it drifts off into problems with "llvm"), and #954 where the problem was indeed a mismatch of gcc and gfortran versions.

@cswluo
Copy link
Author

cswluo commented Nov 25, 2016

@martin-frbg thanks for your suggestions. I followed #954 and installed gfrtran-4.9 through sudo apt-get install gfortran-4.9 since my "gcc --version" returns 4.9.3, then it's OK.

@brada4
Copy link
Contributor

brada4 commented Nov 25, 2016

Can you close the issue?

@cswluo cswluo closed this as completed Nov 25, 2016
@drormeir
Copy link

drormeir commented Nov 7, 2018

I suggest to add compilers version consistency check inside the Makefile.

@brada4
Copy link
Contributor

brada4 commented Nov 7, 2018

What is the best version match for Xcode + gfortran?

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

4 participants