0

I'm trying to compile openBLAS (0.2.18 from here) on a windows 10 system. I've installed mingw, msys (with perl, gfortran, etc), and mingw-w64 (basically according to the procedure here).

Well into the compilation, I run get the following error:

gcc.exe: error: unrecognized command line option '--exclude-libs=libpthread.a'

It seems "library names may be delimited by commas or colons" and that the use of '=' is not accepted. So I'm trying to figure out how/where this command line option is being specified, including searching for "exclude", "libpthread" in the source directories and looking through the various makefiles, without any luck.

Am I correct about the command line option not having correct syntax? Does anyone have any ideas how to track down where it is being specified or have any references for how make can generate such a command line option?

For reference the whole command is:

gcc -O2 -DMS_ABI -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..  libopenblas.def dllinit.obj \
        -shared -o ../libopenblas.dll -Wl,--out-implib,../libopenblas.dll.a \
        -Wl,--whole-archive ../libopenblas_haswellp-r0.2.18.a -Wl,--no-whole-archive -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0 -Lc:/mingw/64/bin/../lib/gcc -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/lib/../lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../..  -lgfortran -lmingw32 -lmoldname -lmingwex -lmsvcrt -lquadmath -lm -lmingw32 -lmoldname -lmingwex -lmsvcrt -lpthread -lmingw32 -lmoldname -lmingwex -lmsvcrt  --exclude-libs=libpthread.a  -defaultlib:advapi32 -lgfortran -defaultlib:advapi32 -lgfortran

and occurs after make enters directory /c/tcm/xianyi-OpenBLAS-3f6398a/exports

Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
Andrew
  • 1
  • 1

1 Answers1

0

--exclude-libs is an option for the linker, ld. You are passing it to the compiler. To tell gcc to pass the option through to the linker, prefix it with -Wl, i.e.

-Wl,--exclude-libs=libpthread.a

just as you have done with for all the other linker options you are passing through.

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182