I've just started used LAPACK with MinGW on Windows XP in C++. I'm able to use some functions (e.g., dgesv) without any problems, but attempting to use others (e.g., dgeqrf) results in compiler errors related to gfortran functions. I've included the build commands for my test program below as well as some of the errors.
- Code: Select all
mingw32-g++.exe -Wall -fexceptions -g -c "C:\Documents and Settings\WFrane\My Documents\C++ code\lapack_test\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\lapack_test.exe obj\Debug\main.o "C:\Documents and Settings\WFrane\My Documents\Downloads\GotoBLAS2\libgoto2_opteronp-r1.13.lib" "C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a"
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(ilaenv.o):ilaenv.f:(.text+0x23a): undefined reference to `_gfortran_compare_string'
(... More undefined reference errors for _gfortran_compare_string ...)
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(ilaenv.o):ilaenv.f:(.text+0x30b): undefined reference to `_gfortran_compare_string'
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(ilaenv.o):ilaenv.f:(.text+0x333): more undefined references to `_gfortran_compare_string' follow
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(dlarft.o):dlarft.f:(.text+0x40b): undefined reference to `dgemv_'
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(dlarft.o):dlarft.f:(.text+0x48d): undefined reference to `dtrmv_'
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(dlarfb.o):dlarfb.f:(.text+0x222): undefined reference to `dcopy_'
C:\Documents and Settings\WFrane\My Documents\Downloads\lapack-3.3.0\lapack_WIN32.a(dlarfb.o):dlarfb.f:(.text+0x2a7): undefined reference to `dtrmm_'
(... etc...)
This seems to point to a problem related to how I built lapack_WIN32.a, so I've included the steps I used to set up BLAS and LAPACK below (I've italicized file and folder names and put lines within individual files in bold).
- Downloaded and installed MinGW and MSYS from http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20110211/
- Downloaded GotoBLAS2 from http://www.tacc.utexas.edu/tacc-projects/gotoblas2/downloads/ and unpacked it into a folder called GotoBLAS2
- Compiled GotoBLAS2 by running make in MSYS while in the GotoBLAS2 folder; the resulting library was libgoto2_opteronp-r1.13.lib
- Downloaded lapack-3.3.0.tgz from http://www.netlib.org/lapack/ and unpacked it into a folder called lapack-3.3.0 in the same directory as the GotoBLAS2 folder (i.e., both folders are at the same level)
- Made a copy of lapack-3.3.0/INSTALL/make.inc.gfortran, placed it in lapack-3.3.0, renamed it make.inc, and changed PLAT = _LINUX to PLAT = _WIN32 and changed BLASLIB = ../../blas$(PLAT).a to BLASLIB = ../../../GotoBLAS2/libgoto2_opteronp-r1.13.lib
- Ran make in MSYS while in the lapack-3.3.0 folder; the resulting library was lapack_WIN32.a
Any assistance would be appreciated; I'm not particularly experienced with the use of makefiles, so I suspect I omitted something in the make.inc file for LAPACK.
Thanks!
William

