using CLAPACK with VC++6.0

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

using CLAPACK with VC++6.0

Postby kaien » Thu Sep 11, 2008 9:16 pm

Hello, I want to know how to use CLAPACK 3.1.1 via VC++6.0.
I have tried a quite small example, but there are always some problems during the compilation.

If I use clapack.lib for debug version. I will get following error messages:

LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
clapack.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapack.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapack.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_sgemm
clapack.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sger
clapack.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sscal
clapack.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sswap
clapack.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_isamax
clapack.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol _s_cmp
clapack.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol _s_copy
clapack.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __ftol2_sse
clapack.lib(slamch.obj) : error LNK2001: unresolved external symbol __ftol2_sse
clapack.lib(slamch.obj) : error LNK2001: unresolved external symbol _pow_ri
clapack.lib(iparmq1.obj) : error LNK2001: unresolved external symbol _i_nint
Debug/test_clapack1.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.

test_clapack1.exe - 14 error(s), 1 warning(s)


If I use clapackd.lib for debug version, I will get:
Linking...
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(iparmq1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(sgesv1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(xerbla1.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(iparmq1.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(sgesv1.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(iparmq1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(ieeeck1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(slaswp1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(lsame1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(sgesv1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(xerbla1.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(iparmq1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(ieeeck1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(slaswp1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(lsame1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(sgesv1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(xerbla1.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_sgemm
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sger
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sscal
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sswap
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_isamax
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol _s_cmp
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol _s_copy
clapackd.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __ftol2_sse
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol __ftol2_sse
clapackd.lib(slamch.obj) : error LNK2001: unresolved external symbol _pow_ri
clapackd.lib(iparmq1.obj) : error LNK2001: unresolved external symbol _i_nint
Debug/test_clapack1.exe : fatal error LNK1120: 15 unresolved externals
Error executing link.exe.

test_clapack1.exe - 50 error(s), 0 warning(s)

I really don't know how to make compilation correctly in VC++6.0!
Please help me!
Thank you very much!


PS: The small example which I used

#include <iostream>
using namespace std;

extern "C"
{
#include <f2c.h>
#include <blaswrap.h>
#include <clapack.h>
}


int main(int argc, char* argv[])
{

integer M=3 ;
integer N=1;
real a[9]={4,3,11,2,-1,0,-1,2,3};
real b[3]={2,10,8};
integer lda;
integer ldb;
integer INFO;

lda=M;
ldb=M;
integer *ipiv;
ipiv = (integer *)new integer[M];

sgesv_(&M, &N, a, &lda,ipiv, b, &ldb, &INFO);

if(INFO==0)
{
for(int i=0; i<M; i++)
{
cout<<b[i]<<endl;
}
}
else
{
cout<<"Failed."<<endl;
}
return 0;
}
kaien
 
Posts: 5
Joined: Thu Sep 11, 2008 8:58 pm

Re: using CLAPACK with VC++6.0

Postby Julie » Thu Sep 11, 2008 9:23 pm

LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library

Just do what VC wants: add /NODEFAULTLIB:LIBCMT.lib

clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol _f2c_strsm

Looks like you are missing the f2c library.

Next time, provide the libraries used when linking, it will be easier to help you.
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: using CLAPACK with VC++6.0

Postby kaien » Thu Sep 11, 2008 9:43 pm

Thank you julie.
Here are libs used in my project:
clapackd.lib libf2cd.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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/nologo /subsystem:console /incremental:yes /pdb:"Debug/test_clapack1.pdb" /debug /machine:I386 /out:"Debug/test_clapack1.exe" /pdbtype:sept

I have tried adding /NODEFAULTLIB:LIBCMT.lib into C/C++option. It seems nothing has been changed :(

PS:
I use directly the LIB files of "CLAPACK-3.1.1-VisualStudio" package.
I don't recompliler the source code because the projet file is not for VC++6.0.
So I use .bin files in the BIN\Win32 folder.
Perhaps, these lib files can not be used in VC++6.0! I am not sure.
If anybody knows well how to use 3.1.1 version in VC++6.0, please give me some commants.
Any advice is welcome. Thank you very much!
kaien
 
Posts: 5
Joined: Thu Sep 11, 2008 8:58 pm

Re: using CLAPACK with VC++6.0

Postby Julie » Thu Sep 11, 2008 10:00 pm

I have tried adding /NODEFAULTLIB:LIBCMT.lib into C/C++option. It seems nothing has been changed :(


This fixed the WARNING.
Now, it looks like the f2c library is not used.

I do not have access at my Windows machine at the moment, I cannot check the linking sequence.
- For sure you are missing the Blas library in between clapackb.lib and libf2cd.lib.
I do not think that will fix your problem, but for sure the BLAS.lib is needed for your program.
- For sure, you need the cblaswrap.lib if you are using the clapack.lib, otherwise, you need to take clapack_nowrap.lib.

So you linking sequence should look like this:
clapackd.lib cblaswrap.lib blas.lib libf2cd.lib
or
clapackd_nowrap.lib blas.lib libf2cd.lib

Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: using CLAPACK with VC++6.0

Postby kaien » Thu Sep 11, 2008 10:44 pm

After using this linking sequence: libf2c.lib BLAS.lib clapack.lib tmglib.lib.
It is better now. but there are still some errors like:

Code: Select all
Linking...
clapack.lib(ilaenv1.obj) : error LNK2001: unresolved external symbol __ftol2_sse
clapack.lib(slamch.obj) : error LNK2001: unresolved external symbol __ftol2_sse
libf2c.lib(i_nint1.obj) : error LNK2001: unresolved external symbol __ftol2_sse
Debug/test_clapack1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

test_clapack1.exe - 4 error(s), 0 warning(s)


But, if I add cblaswrap.lib ,then the errors go up to 140 errors. - -
Code: Select all
cblaswrap.lib(cblaswr.obj) : error LNK2001: unresolved external symbol _cblas_sdot
cblaswrap.lib(cblaswr.obj) : error LNK2001: unresolved external symbol _cblas_ddot
cblaswrap.lib(cblaswr.obj) : error LNK2001: unresolved external symbol _cblas_cdotu_sub
...................................
test_clapack1.exe - 140 error(s), 0 warning(s)


I tried other combinaisions, the errors always ...
what I should to do!
Please help...

PS:
here are lib files provided in my CLAPACK version:
\LIB\Win32>
BLAS.lib
BLASd.lib
BLASd_nowrap.lib
BLAS_nowrap.lib
cblaswrap.lib
cblaswrapd.lib
clapack.lib
clapackd.lib
clapackd_nowrap.lib
clapack_nowrap.lib
f77blaswrap.lib
f77blaswrapd.lib
libf2c.lib
libf2cd.lib
tmglib.lib
tmglibd.lib
tmglibd_nowrap.lib
tmglib_nowrap.lib
kaien
 
Posts: 5
Joined: Thu Sep 11, 2008 8:58 pm

Re: using CLAPACK with VC++6.0

Postby kaien » Fri Sep 12, 2008 5:50 am

If somebody has successfuly used CLAPACK 3.1.1 in VC++6.0. Please give a "step by setp" example to show how did you do that. Thank you very much in advance!
kaien
 
Posts: 5
Joined: Thu Sep 11, 2008 8:58 pm

Re: using CLAPACK with VC++6.0

Postby kaien » Fri Sep 12, 2008 6:06 am

- I created a simple win32 console application in vc6.
- add my test code in the project.
- add "include", "library" and "source" folder in TOOLS->OPTIONS->DIRECTORIES
- add link libs sequences as"libf2c.lib BLAS.lib clapack.lib tmglib.lib" or "the two sequences given by Julie" in my projet setting.
- set C/C++ -> "Code Generation" -> Use run-time library as "Debug multithreaded"
Finally, compile the projet.
That's all I did. Is there something that I forget to do or not?
kaien
 
Posts: 5
Joined: Thu Sep 11, 2008 8:58 pm

Re: using CLAPACK with VC++6.0

Postby muscicapa » Mon Oct 20, 2008 6:09 am

I actually had some other problem. I created the clapack3.tgz expanded and CLAPACK3-Windows.tgz expanded to overwrite and built the library. It built perfectly. Then I created a second project which was using TNT and I added clapack.h and f2c.h to the tnt_lapack.h containing directory and added the three libs clapack.lib, blas.lib and libF77.lib. I ran into trouble with the default tnt_lapack.h. I commented out the externed includes and and added only the dgesv_ header and strangely enough all went fine. I got a similar linker warning as above but on running I found that all was fine except that cout entirely failed.
muscicapa
 
Posts: 1
Joined: Mon Oct 20, 2008 5:55 am

Re: using CLAPACK with VC++6.0

Postby richard.moodie7 » Mon Jan 12, 2009 7:48 am

I have tried to compile CLAPACK with WATCOM C/C++10.6 compiler on
PC running windows 95, but I have got a lots of messages
e.g. F2CLIB\libf77\abort.c' ....it is "no return value",
however, some of routines were compiled without any problem.
Seems to me that for some particular routines , I used wrong switches (options).
I followed the README file in CLAPACK package, but
the option MSDOS and/or NON_UNIX_STDIO did not solve compilation problems.

Any suggestions ?

Does exist some kind of step by step procedure for compiling the CLAPACK via
Watcom C/C++ 10.6 compiler under win95 ?

Are CLAPACK pre-compiled libraries available?

Thanks a lot

---------------------------------------------------------------------------
homework assignment | writing assignment | the assignment
richard.moodie7
 
Posts: 1
Joined: Mon Jan 12, 2009 7:33 am

Re: using CLAPACK with VC++6.0

Postby jasonglades » Sat Feb 07, 2009 9:27 pm

I have also tried to compile CLAPACK with WATCOM C/C++10.6 compiler on
PC running windows 95, but I have got a lots of messages
e.g. F2CLIB\libf77\abort.c' ....it is "no return value",
however, some of routines were compiled without any problem.

Can you give some suggestions?
--------------------------------------
Essay writing
jasonglades
 
Posts: 2
Joined: Sat Feb 07, 2009 9:24 pm

Re: using CLAPACK with VC++6.0

Postby Flooby » Fri Jun 26, 2009 12:22 pm

Don't think its stable there are too many errors when I trying to install CLAPACK (f2c varsion of Lapack) in a Visual C++ 6.0 environment.
Flooby
 
Posts: 2
Joined: Wed Jun 17, 2009 9:38 am
Location: UK

Re: using CLAPACK with VC++6.0

Postby arshumum » Thu Nov 05, 2009 3:58 pm

Still am getting the same error?
arshumum
 
Posts: 2
Joined: Thu Nov 05, 2009 2:52 pm

Re: using CLAPACK with VC++6.0

Postby T0ny4+ » Tue Nov 17, 2009 12:37 am

I am also getting constant error messages!
frustrating
has anyone been able to fix the problem?
T0ny4+
 
Posts: 1
Joined: Tue Nov 17, 2009 12:30 am

Re: using CLAPACK with VC++6.0

Postby benhurt » Wed Nov 18, 2009 5:12 am

clapackd.lib(sgetrs1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_strsm
clapackd.lib(sgetrf1.obj) : error LNK2001: unresolved external symbol _f2c_sgemm
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sger
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sscal
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_sswap
clapackd.lib(sgetf21.obj) : error LNK2001: unresolved external symbol _f2c_isamax

It looks great, thanks for tips.
benhurt
 
Posts: 1
Joined: Wed Nov 18, 2009 5:09 am

Re: using CLAPACK with VC++6.0

Postby admin » Wed Nov 18, 2009 11:55 am

CLAPACK under Windows works fine.
There is a README that explains the blaswrap and other things.
If you have problem installing CLAPACK, just use the CLAPACK 3.2.1 Package with CMAKE available from netlib.
http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz
for: CLAPACK, version 3.2.1 CMAKE package.
, for UNIX Make, MAC xcode, Windows (Nmake, Visual Studio all versions) 32 or 64 bits.
, [REQUIRE CMAKE - http://www.cmake.org/ Running doc: http://www.cmake.org/cmake/help/runningcmake.html]
, FEEDBACK WELCOME --> http://icl.cs.utk.edu/lapack-forum

Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Next

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 3 guests