HOWTO LAPACK/CLAPACK for Windows

Open discussion regarding features, bugs, issues, vendors, etc.

Did it work?

Yes
39
75%
No
13
25%
 
Total votes : 52

Re: HOWTO LAPACK/CLAPACK for Windows

Postby Josselin » Mon Jun 28, 2010 10:22 am

Thanks for the replty.
I have checked that I have perl by doing a "which perl"and everything is ok.
Unfortunately, it doesn t work (same error messages).

During the compilation (see my previous post), I have "make[1]: lib: Command not found". Do I need to set a particular path (environment variable or something) for MSYS/MINGW?

Thanks& Regards

Josselin
Josselin
 
Posts: 6
Joined: Thu Jun 24, 2010 12:33 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby graphicsRat » Mon Jun 28, 2010 12:12 pm

Josselin wrote:I have checked that I have perl by doing a "which perl"and everything is ok.
Unfortunately, it doesn t work (same error messages).

During the compilation (see my previous post), I have "make[1]: lib: Command not found". Do I need to set a particular path (environment variable or something) for MSYS/MINGW?


Visual Studio has a binary called Library Manager tool called lib, which you'll find in C:\Program Files\Microsoft Visual Studio 9.0\VC\bin (or similar)

Add this directory to your path.
graphicsRat
 
Posts: 84
Joined: Wed Mar 25, 2009 3:08 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby Josselin » Tue Jun 29, 2010 8:26 am

Sorry, I m almost finished.
My compilation is almost fine. I don t know if this is a big problem, but at the beginning of the compilation process, the prompt says "the system cannot find the file specified".
Anyway, by adding the path environnment variable, there is no compilation error anymore.
But, unfortunately, I got at the end of the compilation libgoto2_core2p-r1.13.lib, libgoto2_core2p-r1.13.a, but not the dll (except libgoto.dll in the export folder). My Visual studio project compiles then finely but doesn t work, as expected (because nothing has been added in WINDOWS\system32)

Do I have to change something in the MakeRule or something?

Thanks very much for your replies, it helps me a lot, and I think I start to watch the light at the end of the tunnel...

Regards,

Josselin
Josselin
 
Posts: 6
Joined: Thu Jun 24, 2010 12:33 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby graphicsRat » Tue Jun 29, 2010 10:21 am

The last version that I compiled was GotoBLAS2-1.13. The build system created a custom lib file (e.g. libgoto2_prescottp-r1.13.lib) in the source folder, and a dll (libgoto2.dll) in the exports folder, which is what I think you have.

The build process does not place the dll in the WINDOWS\system32 folder. That's something you have to do. Better still read this (Microsoft's guidelines on Search Path Used by Windows to Locate a DLL) in order to make an informed decision.

Clearly, the HOWTO is now emarassingly out of date. I'll try writing an updated one so that this thread can be closed.
graphicsRat
 
Posts: 84
Joined: Wed Mar 25, 2009 3:08 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby Josselin » Wed Jun 30, 2010 3:28 am

Hello,

it is exactly what I did but the program is not running well: "Access violation reading location 0x00000", even if it compiles well.
Actually, my visual studio project compilation gives me a dll. I manually put this dll at the location of my exe.

In the debugger, it is written
name.dll!cpuid() + 0xed bytes
name.dll!_exec_blas() + 0xb4 bytes
name.dll!_blas_level1_tread() + 0x1ee bytes

I put the ligoto2.dll, in WINDOWS\system32, I tried in the folder where I have my executable, but it doesn t change anything.

How can I check that libgoto2.dll is taken into account in my code?
Did I do something wrong?

Thanks a lot,

Josselin
Josselin
 
Posts: 6
Joined: Thu Jun 24, 2010 12:33 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby graphicsRat » Wed Jun 30, 2010 6:48 am

Josselin wrote:Actually, my visual studio project compilation gives me a dll.


What do you mean by this? GotoBLAS2 is compiled by MSYS and not Visual Studio?

Two questions:
1. What type of application are you developing in Visual Studio? A console application or dll?
2. What are your Visual Studio project settings?

The correct runtime library is "Multithreaded-Debug (/MTd)"
Project options -> Configuration Properties -> C/C++ -> Code generation -> Use run-time library
->"Multithreaded-Debug (/MTd)".
graphicsRat
 
Posts: 84
Joined: Wed Mar 25, 2009 3:08 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby Josselin » Wed Jun 30, 2010 8:38 am

My dll is compiled with msys.
I do a dll with my visual studio project.

I use /MTd or MT but it doesn t work.

My project setting are:
- command line C++:
/O2 /Ob2 /Oi /Ot /GL /I "." /I "..\Algorithm" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Processing_EXPORTS" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /D "_MBCS" /GF /FD /EHsc /MTd /Gy /arch:SSE2 /openmp /Fo"Release\\" /Fd"Release\vc90.pdb" /W4 /nologo /c /Wp64 /Zi /TP /errorReport:prompt

- command line linker:
/OUT:"..\..\..\bin\Release\Algorithm.Processing.dll" /INCREMENTAL:NO /NOLOGO /LIBPATH: "/DLL /MANIFEST /MANIFESTFILE:"Release\Algorithm.Processing.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libc" /NODEFAULTLIB:"msvcrt" /NODEFAULTLIB:"libcmt" /DEBUG /PDB:"..\..\..\bin\Release\Algorithm.Processing.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT ..\Algorithm\libf2c.lib ..\Algorithm\lapack.lib ..\Algorithm\libgoto2_core2p-r1.13.lib ..\..\..\bin\Release\Algorithm.FindTable.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Thanks a lot!!

Josselin
Josselin
 
Posts: 6
Joined: Thu Jun 24, 2010 12:33 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby graphicsRat » Wed Jun 30, 2010 8:59 am

Josselin wrote:My dll is compiled with msys.
I do a dll with my visual studio project.

Do you mean to say that you're creating a dll project in Visual Studio? (Note that compiling the GotoBLAS2 dll in MSYS is a different issue and must not be confused.)

If you are creating a dll project in Visual Studio, you may want to first try a writing small console application in order to test your GotoBLAS2 build.

Try the sample program here http://www.cs.rochester.edu/~bh/cs400/using_lapack.html

If you've (saved your file as *.cpp and are) compiling with C++, rename the prototypes
void dgesv_( )
void dgels_( )

in the above program to
extern "C" void dgesv_( )
extern "C" void dgels_( )

and don't forget to use the "Multithreaded-Debug (/MTd)" runtime library.

Josselin wrote:I use /MTd or MT but it doesn t work.

What exactly do you mean? What errors are you getting?

If you are creating a dll in visual studio, use the Multi-threaded Debug DLL (/MDd) runtime library.

I've got two visual studio projects in my solution file, both using LAPACK. The first one is a console application and therefore uses the "Multithreaded-Debug (/MTd)" runtime library while the second is dll (AutoDesk Maya Plugin) and therefore uses the Multi-threaded Debug DLL (/MDd) runtime library. Why? because dlls and console applications (debug or release) cannot link against the same version of the C or C++ runtime library.
See: http://www.davidlenihan.com/2008/01/cho ... untim.html
graphicsRat
 
Posts: 84
Joined: Wed Mar 25, 2009 3:08 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby cat_red » Thu Jul 01, 2010 6:22 am

Hi,
I'm trying to link clapack libraries to a Visual Studio 2008 project (specifically, the example project given at http://www.cs.rochester.edu/~bh/cs400/using_lapack.html). I downloaded and built the cmake version of CLapack, without any errors, and after a bunch of fiddling with the project settings, I think I've nearly got it working. Unfortunately, I still have some errors I couldn't find solutions to anywhere in this forum. Has anyone had problem like this? Did I miss it? When I compile the afore-mentioned code, I get the following errors:

Code: Select all
Linking...
lapackd.lib(ilaenv.obj) : error LNK2019: unresolved external symbol _s_cmp referenced in function _ilaenv_
lapackd.lib(ilaenv.obj) : error LNK2019: unresolved external symbol _s_copy referenced in function _ilaenv_
lapackd.lib(dlamch.obj) : error LNK2019: unresolved external symbol _pow_di referenced in function _dlamch_
lapackd.lib(dlamch.obj) : error LNK2019: unresolved external symbol _e_wsfe referenced in function _dlamc2_
lapackd.lib(dlamch.obj) : error LNK2019: unresolved external symbol _do_fio referenced in function _dlamc2_
lapackd.lib(dlamch.obj) : error LNK2019: unresolved external symbol _s_wsfe referenced in function _dlamc2_
lapackd.lib(iparmq.obj) : error LNK2019: unresolved external symbol _i_nint referenced in function _iparmq_
C:\Documents and Settings\Kis\My Documents\Visual Studio 2008\Projects\ARG\Debug\ARG.exe : fatal error LNK1120: 7 unresolved externals


Thanks for any help you can give!
Cat
cat_red
 
Posts: 2
Joined: Wed Jun 30, 2010 5:10 am

Re: HOWTO LAPACK/CLAPACK for Windows

Postby melmartinez01 » Mon Jul 05, 2010 7:51 pm

I tried to compile the gotoblas library following the steps you say, but if I type "make dll" in the command prompt it says it doesn't know the command make.
melmartinez01
 
Posts: 1
Joined: Mon Jul 05, 2010 7:49 pm
Location: united states

Re: HOWTO LAPACK/CLAPACK for Windows

Postby admin » Mon Jul 05, 2010 10:55 pm

Cat,
you are missing the f2c library in your linking sequence.
admin
Site Admin
 
Posts: 498
Joined: Wed Dec 08, 2004 7:07 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby graphicsRat » Tue Jul 06, 2010 5:47 am

melmartinez01 wrote:I tried to compile the gotoblas library following the steps you say, but if I type "make dll" in the command prompt it says it doesn't know the command make.


GotoBLAS2 must be compiled in the MINGW/MSYS environment.

graphicsRat wrote:Install MINGW first -- http://sourceforge.net/projects/mingw/files/
then MSYS http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe (or the latest version of MSYS)

... then run make in MSYS. (MSYS is a shell.)

PS: it appears the last stage of the build requires Perl, so you may have to install Perl (from activestate Perl for example) and hard link the name "perl" to the bin folder. I'll explain how to do this if its necessary.


Admin, its time to close/archive this thread and start a new one based on an up to date HOWTO that I will write and send to you shortly.
graphicsRat
 
Posts: 84
Joined: Wed Mar 25, 2009 3:08 pm

Re: HOWTO LAPACK/CLAPACK for Windows

Postby Mariemiller02 » Tue Jul 06, 2010 9:35 am

Anyway, by adding the path environnment variable, there is no compilation error anymore.
Mariemiller02
 
Posts: 1
Joined: Tue Jul 06, 2010 9:31 am
Location: united states

Re: HOWTO LAPACK/CLAPACK for Windows

Postby lyechin2003 » Sun Jul 11, 2010 11:17 am

I want to learn for CLAPACK for Windows, who can guy me?
lyechin2003
 
Posts: 1
Joined: Sun Jul 11, 2010 10:31 am

Re: link error when testing dgesvd_ with CLAPACK and GotoBlas

Postby feicen » Fri Jul 16, 2010 8:18 am

I compiled the GotoBlas2-1.13 and used it with CLAPACK-3.1.1-VisualStudio.
The following link errors occurred when I called dgesvd_
1>gotoblas.lib(dgesvd.obj) : error LNK2001: unresolved external symbol __gfortran_concat_string
1>gotoblas.lib(dormbr.obj) : error LNK2001: unresolved external symbol __gfortran_concat_string
1>gotoblas.lib(dormqr.obj) : error LNK2001: unresolved external symbol __gfortran_concat_string
1>gotoblas.lib(dormlq.obj) : error LNK2001: unresolved external symbol __gfortran_concat_string
1>gotoblas.lib(ilaenv.obj) : error LNK2001: unresolved external symbol __gfortran_compare_string
1>gotoblas.lib(iparmq.obj) : error LNK2001: unresolved external symbol _logf
1>gotoblas.lib(iparmq.obj) : error LNK2001: unresolved external symbol _lroundf
1>gotoblas.lib(dlartg.obj) : error LNK2001: unresolved external symbol ___powidf2
Thanks for helping
feicen
 
Posts: 2
Joined: Fri Jul 16, 2010 2:00 am

PreviousNext

Return to User Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest