[Numpy-discussion] Moving to gcc 4.* for win32 installers ?

Sturla Molden sturla@molden...
Thu Feb 9 12:07:20 CST 2012


On 07.02.2012 18:38, Sturla Molden wrote:

> One potential problem I just discovered is dependency on a DLL called
> libpthreadGC2.dll.

This is not correct!!! :-D

Two threading APIs can be used for OpenBLAS/GotoBLAS2, Win32 threads or 
OpenMP.

    driver/others/blas_server_omp.c
    driver/others/blas_server_win32.c

Simply build without telling OpenBLAS/GotoBLAS2 to use OpenMP (i.e. make 
without USE_OPENMP=1), and no dependency on libpthreadGC2.dll is ever 
made. OpenBLAS/GotoBLAS2 is thus a plain BSD licenced BLAS.

I tried to compile OpenBLAS on my office computer. It did not know about 
"Sandy Shore" architecture so I had to tell it to use NEHALEM instead:

    $ make TARGET=NEHALEM

This worked just fine :)

Setup:

    - TDM-GCC 4.6.1 for x64 (install before MSYS) with gfortran.

    - MSYS (mingw-get-inst-20111118.exe).
      During the MSYS install, deselect "C compiler" and select
      "MinGw Developer ToolKit" to get Perl.

NB! OpenBLAS/GotoBLAS2 will not build without Perl in MSYS, you will get 
an error that says "couldn't commit memory for cygwin heap".

Never mind that OpenBLAS/GotoBLAS2 says you need Cygwin and Visual 
Studio, those are not needed.

The DLL that is produced (OpenBLAS.dll) is linked against msvcrt.dll, 
not msvcr90.dll. Thus, don't use it with Python27, or at least don't 
share any CRT resources with it. The static library 
(libopenblas_nehalemp-r0.1alpha2.4.lib) is not linked with msvcrt.dll as 
far as I can tell, or any other library such as libgfortran. (This is 
the one we need for NumPy anyway, I think, David C. hates DLLs.) We will 
probably have to build one for all the different AMD and Intel 
architectures.

If it is of interest for building NumPy, it seems the OpenBLAS DLL is 
linked with this sequence:

-lgfortran -lmingw32 -lmoldname -lmingwex -lmsvcrt -lquadmath -lm


I tried to build plain GotoBLAS2 as well...

Using

   $ make BINARY=64

resulted this error:

http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2011-October/220422.html

That is because GotoBLAS2 thinks Shandy Shore is Prescott, and then does 
something stupid...


Thus:


Building OpenBLAS with MinGW workes just fine (TDM-GCC with gfortran and 
MSYS DTK) and requires no configuration. Just type make and specity the 
CPU architecture, see the text file TargetList.txt.



Sturla


More information about the NumPy-Discussion mailing list