clapack linking errors

200 views
Skip to first unread message

aortizb

unread,
Sep 22, 2009, 2:44:08 AM9/22/09
to matrixprogramming
Hello all,

I am trying to compute the inverse of a matrix with lapack. I am
getting some link errors. The code is:

---------------------------------------------------------------------------------------

#include <iostream>
#include <string>
#include <vector>
using namespace std;

extern "C" int dpotrf_(char *uplo, int *n, double *a, int *lda, int
*info);
extern "C" int dpotri_(char *uplo, int *n, double *a, int *lda, int
*info);

int main()
{
int n = 2;
int info;
char uplo = 'u';

vector< vector<double> > a(2,vector<double>(2));
a[0][0] = 1;
a[0][1] = 1;
a[1][0] = 1;
a[1][1] = 1.000000001;

dpotrf_(&uplo,&n,&a[0][0],&n,&info);
if (info != 0)
cout << "Error in dpotrf(): Flag is " << info << endl;

dpotri_(&uplo,&n,&a[0][0],&n,&info);
if (info != 0)
cout << "Error in dpotri(): Flag is " << info << endl;

vector< vector<double> > ainv(2,vector<double>(2));
for (int i = 0; i < n; i++)
for (int j = 0; j < i-1; j++)
ainv[i][j] = a[j][i];

for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
cout << ainv[i][j] << " ";
cout << endl;
}

return 0;
}

-------------------------------------------------------------

I am using the precompiled libraries of lapack and f2c that comes with
TAUCS (liblapack.lib and vcf2c.lib).

Can i get some help/guidance with the following errors?.

Thanks.
Alejandro.

1>------ Rebuild All started: Project: test_clapack, Configuration:
Debug Win32 ------
1>Deleting intermediate and output files for project 'test_clapack',
configuration 'Debug|Win32'
1>Compiling...
1>clapack_example.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol ___security_cookie
1>clapack_example.obj : error LNK2019: unresolved external symbol
___security_cookie referenced in function _main
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
___security_cookie
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
___security_cookie
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol ___security_cookie
1>clapack_example.obj : error LNK2019: unresolved external symbol
___CxxFrameHandler3 referenced in function __ehhandler$_main
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
___CxxFrameHandler3
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
___CxxFrameHandler3
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol ___CxxFrameHandler3
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol @__security_check_cookie@4
1>clapack_example.obj : error LNK2019: unresolved external symbol
@__security_check_cookie@4 referenced in function __ehhandler$_main
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol @__security_check_cookie@4
1>clapack_example.obj : error LNK2001: unresolved external symbol
__fltused
1>clapack_example.obj : error LNK2019: unresolved external symbol
__RTC_CheckEsp referenced in function _main
1>clapack_example.obj : error LNK2019: unresolved external symbol
@_RTC_CheckStackVars@8 referenced in function _main
1>clapack_example.obj : error LNK2001: unresolved external symbol
__RTC_Shutdown
1>clapack_example.obj : error LNK2001: unresolved external symbol
__RTC_InitBase
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol __CxxThrowException@8
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(iosptrs.obj) : error LNK2019: unresolved external
symbol __CxxThrowException@8 referenced in function "void __cdecl
std::`dynamic initializer for 'initlocks''(void)" (??
__Einitlocks@std@@YAXXZ)
1>clapack_example.obj : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
__CxxThrowException@8
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol "const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol "const type_info::`vftable'" (??_7type_info@@6B@)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"const type_info::`vftable'" (??_7type_info@@6B@)
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol "public: __thiscall std::exception::exception(class
std::exception const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(iosptrs.obj) : error LNK2019: unresolved external
symbol "public: __thiscall std::exception::exception(class
std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) referenced
in function "void __cdecl `dynamic atexit destructor for
'init_atexit''(void)" (??__Finit_atexit@@YAXXZ)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol "public: __thiscall std::exception::exception(char const *
const &)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol "public: __thiscall std::exception::exception(char const *
const &)" (??0exception@std@@QAE@ABQBD@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z) referenced in function "public:
__thiscall std::bad_alloc::bad_alloc(char const *)" (??
0bad_alloc@std@@QAE@PBD@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&)" (??0exception@std@@QAE@ABQBD@Z)
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external
symbol "public: virtual char const * __thiscall std::exception::what
(void)const " (?what@exception@std@@UBEPBDXZ) referenced in function
"public: virtual __thiscall std::locale::facet::~facet(void)" (??
1facet@locale@std@@UAE@XZ)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol "public: virtual char const * __thiscall std::exception::what
(void)const " (?what@exception@std@@UBEPBDXZ)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)
const " (?what@exception@std@@UBEPBDXZ)
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol "public: virtual __thiscall std::exception::~exception
(void)" (??1exception@std@@UAE@XZ)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ)
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol "public: virtual __thiscall std::exception::~exception
(void)" (??1exception@std@@UAE@XZ)
1>clapack_example.obj : error LNK2019: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ) referenced in function "public: virtual
__thiscall std::bad_alloc::~bad_alloc(void)" (??
1bad_alloc@std@@UAE@XZ)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)" (??
1exception@std@@UAE@XZ)
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external
symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
referenced in function "public: static class std::locale __cdecl
std::locale::empty(void)" (?empty@locale@std@@SA?AV12@XZ)
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
__invalid_parameter referenced in function "public: double &
__thiscall std::vector<double,class std::allocator<double> >::operator
[](unsigned int)" (??A?$vector@NV?$allocator@N@std@@@std@@QAEAANI@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__invalid_parameter
1>clapack_example.obj : error LNK2019: unresolved external symbol
__CrtDbgReportW referenced in function "public: double & __thiscall
std::vector<double,class std::allocator<double> >::operator[](unsigned
int)" (??A?$vector@NV?$allocator@N@std@@@std@@QAEAANI@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__CrtDbgReportW
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external
symbol __CrtDbgReportW
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol __CrtDbgReportW
1>clapack_example.obj : error LNK2019: unresolved external symbol
"public: __thiscall std::exception::exception(void)" (??
0exception@std@@QAE@XZ) referenced in function "public: __thiscall
std::runtime_error::runtime_error(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)" (??
0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?
$allocator@D@2@@1@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(void)" (??
0exception@std@@QAE@XZ)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(void)" (??
0exception@std@@QAE@XZ)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_strlen referenced in function "public: static unsigned int __cdecl
std::char_traits<char>::length(char const *)" (?length@?
$char_traits@D@std@@SAIPBD@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
_strlen
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
_strlen
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _strlen
1>libcpmtd.lib(xmutex.obj) : error LNK2001: unresolved external symbol
_free
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _free
1>libcpmtd.lib(ios.obj) : error LNK2001: unresolved external symbol
_free
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol _free
1>clapack_example.obj : error LNK2019: unresolved external symbol
_free referenced in function "void __cdecl std::_DebugHeapDelete<class
std::locale::facet>(class std::locale::facet *)" (??
$_DebugHeapDelete@Vfacet@locale@std@@@std@@YAXPAVfacet@locale@0@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
_free
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
_free
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
_free
1>clapack_example.obj : error LNK2019: unresolved external symbol
"public: __thiscall std::bad_cast::bad_cast(char const *)" (??
0bad_cast@std@@QAE@PBD@Z) referenced in function "class
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > > const & __cdecl std::use_facet<class
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > > >(class std::locale const &)" (??
$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@std@@@std@@@std@@YAABV?$num_put@DV?
$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@0@ABVlocale@0@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::bad_cast::bad_cast(char const *)" (??
0bad_cast@std@@QAE@PBD@Z)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::bad_cast::~bad_cast(void)" (??
1bad_cast@std@@UAE@XZ)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::bad_cast::~bad_cast(void)" (??
1bad_cast@std@@UAE@XZ)
1>clapack_example.obj : error LNK2001: unresolved external symbol
"public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const
&)" (??0bad_cast@std@@QAE@ABV01@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const
&)" (??0bad_cast@std@@QAE@ABV01@@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
"void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced
in function "double * __cdecl std::_Allocate<double>(unsigned
int,double *)" (??$_Allocate@N@std@@YAPANIPAN@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
"void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
"void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_sprintf_s referenced in function "protected: virtual class
std::ostreambuf_iterator<char,struct std::char_traits<char> >
__thiscall std::num_put<char,class
std::ostreambuf_iterator<char,struct std::char_traits<char> > >::do_put
(class std::ostreambuf_iterator<char,struct std::char_traits<char>
>,class std::ios_base &,char,long)const " (?do_put@?$num_put@DV?
$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?
$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DJ@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_strcspn referenced in function "private: class
std::ostreambuf_iterator<char,struct std::char_traits<char> > __cdecl
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > >::_Fput(class
std::ostreambuf_iterator<char,struct std::char_traits<char> >,class
std::ios_base &,char,char const *,unsigned int,unsigned int,unsigned
int,unsigned int)const " (?_Fput@?$num_put@DV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@2@V32@AAVios_base@2@DPBDIIII@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_memchr referenced in function "private: class
std::ostreambuf_iterator<char,struct std::char_traits<char> > __cdecl
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > >::_Fput(class
std::ostreambuf_iterator<char,struct std::char_traits<char> >,class
std::ios_base &,char,char const *,unsigned int,unsigned int,unsigned
int,unsigned int)const " (?_Fput@?$num_put@DV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@2@V32@AAVios_base@2@DPBDIIII@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_localeconv referenced in function "private: class
std::ostreambuf_iterator<char,struct std::char_traits<char> > __cdecl
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > >::_Fput(class
std::ostreambuf_iterator<char,struct std::char_traits<char> >,class
std::ios_base &,char,char const *,unsigned int,unsigned int,unsigned
int,unsigned int)const " (?_Fput@?$num_put@DV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?
$char_traits@D@std@@@2@V32@AAVios_base@2@DPBDIIII@Z)
1>clapack_example.obj : error LNK2019: unresolved external symbol
_memmove_s referenced in function "private: class
std::ostreambuf_iterator<char,struct std::char_traits<char> > __cdecl
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > >::_Iput(class
std::ostreambuf_iterator<char,struct std::char_traits<char> >,class
std::ios_base &,char,char *,unsigned int)const " (?_Iput@?$num_put@DV?
$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?
$ostreambuf_iterator@DU?
$char_traits@D@std@@@2@V32@AAVios_base@2@DPADI@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
_memmove_s
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
_memmove_s
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _memmove_s
1>clapack_example.obj : error LNK2019: unresolved external symbol
_memset referenced in function "public: static char * __cdecl
std::char_traits<char>::assign(char *,unsigned int,char)" (?assign@?
$char_traits@D@std@@SAPADPADID@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
_memset
1>clapack_example.obj : error LNK2019: unresolved external symbol
_memcpy_s referenced in function "public: static char * __cdecl
std::char_traits<char>::_Copy_s(char *,unsigned int,char const
*,unsigned int)" (?_Copy_s@?$char_traits@D@std@@SAPADPADIPBDI@Z)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
_memcpy_s
1>libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol
_memcpy_s
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _memcpy_s
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>liblapack.lib(zlauum.obj) : error LNK2001: unresolved external
symbol _xerbla_
1>liblapack.lib(ztrtri.obj) : error LNK2001: unresolved external
symbol _xerbla_
1>liblapack.lib(dpotri.obj) : error LNK2019: unresolved external
symbol _xerbla_ referenced in function _dpotri_
1>liblapack.lib(dpotrf.obj) : error LNK2001: unresolved external
symbol _xerbla_
1>liblapack.lib(dlauum.obj) : error LNK2001: unresolved external
symbol _xerbla_
1>liblapack.lib(dtrtri.obj) : error LNK2001: unresolved external
symbol _xerbla_
1>liblapack.lib(zlauum.obj) : error LNK2001: unresolved external
symbol _lsame_
1>liblapack.lib(ztrtri.obj) : error LNK2001: unresolved external
symbol _lsame_
1>liblapack.lib(dpotri.obj) : error LNK2019: unresolved external
symbol _lsame_ referenced in function _dpotri_
1>liblapack.lib(dpotrf.obj) : error LNK2001: unresolved external
symbol _lsame_
1>liblapack.lib(dlauum.obj) : error LNK2001: unresolved external
symbol _lsame_
1>liblapack.lib(dtrtri.obj) : error LNK2001: unresolved external
symbol _lsame_
1>liblapack.lib(ATL_dlauumCL.obj) : error LNK2001: unresolved external
symbol _cblas_dsyrk
1>liblapack.lib(ATL_dlauumCU.obj) : error LNK2001: unresolved external
symbol _cblas_dsyrk
1>liblapack.lib(ATL_dpotrfL.obj) : error LNK2019: unresolved external
symbol _cblas_dsyrk referenced in function _ATL_dpotrfL
1>liblapack.lib(ATL_dpotrfU.obj) : error LNK2001: unresolved external
symbol _cblas_dsyrk
1>liblapack.lib(ATL_dlauumRL.obj) : error LNK2001: unresolved external
symbol _cblas_dsyrk
1>liblapack.lib(ATL_dlauumRU.obj) : error LNK2001: unresolved external
symbol _cblas_dsyrk
1>liblapack.lib(ATL_dtrtriRU.obj) : error LNK2001: unresolved external
symbol _cblas_dtrsm
1>liblapack.lib(ATL_dtrtriCU.obj) : error LNK2001: unresolved external
symbol _cblas_dtrsm
1>liblapack.lib(ATL_dpotrfL.obj) : error LNK2019: unresolved external
symbol _cblas_dtrsm referenced in function _ATL_dpotrfL
1>liblapack.lib(ATL_dpotrfU.obj) : error LNK2001: unresolved external
symbol _cblas_dtrsm
1>liblapack.lib(ATL_dtrtriRL.obj) : error LNK2001: unresolved external
symbol _cblas_dtrsm
1>liblapack.lib(ATL_dtrtriCL.obj) : error LNK2001: unresolved external
symbol _cblas_dtrsm
1>liblapack.lib(ATL_dpotrfL.obj) : error LNK2019: unresolved external
symbol _sqrt referenced in function _ATL_dpotrfL
1>liblapack.lib(ATL_dpotrfU.obj) : error LNK2001: unresolved external
symbol _sqrt
1>liblapack.lib(ATL_dlauumRL.obj) : error LNK2019: unresolved external
symbol _cblas_dtrmm referenced in function _ATL_dlauumRL
1>liblapack.lib(ATL_dlauumRU.obj) : error LNK2001: unresolved external
symbol _cblas_dtrmm
1>liblapack.lib(ATL_dlauumCL.obj) : error LNK2001: unresolved external
symbol _cblas_dtrmm
1>liblapack.lib(ATL_dlauumCU.obj) : error LNK2001: unresolved external
symbol _cblas_dtrmm
1>liblapack.lib(ATL_zlauumRL.obj) : error LNK2019: unresolved external
symbol _cblas_ztrmm referenced in function _ATL_zlauumRL
1>liblapack.lib(ATL_zlauumRU.obj) : error LNK2001: unresolved external
symbol _cblas_ztrmm
1>liblapack.lib(ATL_zlauumCL.obj) : error LNK2001: unresolved external
symbol _cblas_ztrmm
1>liblapack.lib(ATL_zlauumCU.obj) : error LNK2001: unresolved external
symbol _cblas_ztrmm
1>liblapack.lib(ATL_zlauumRL.obj) : error LNK2019: unresolved external
symbol _cblas_zherk referenced in function _ATL_zlauumRL
1>liblapack.lib(ATL_zlauumRU.obj) : error LNK2001: unresolved external
symbol _cblas_zherk
1>liblapack.lib(ATL_zlauumCL.obj) : error LNK2001: unresolved external
symbol _cblas_zherk
1>liblapack.lib(ATL_zlauumCU.obj) : error LNK2001: unresolved external
symbol _cblas_zherk
1>liblapack.lib(ATL_ztrtriRL.obj) : error LNK2019: unresolved external
symbol _cblas_ztrsm referenced in function _ATL_ztrtriRL
1>liblapack.lib(ATL_ztrtriCL.obj) : error LNK2001: unresolved external
symbol _cblas_ztrsm
1>liblapack.lib(ATL_ztrtriRU.obj) : error LNK2001: unresolved external
symbol _cblas_ztrsm
1>liblapack.lib(ATL_ztrtriCU.obj) : error LNK2001: unresolved external
symbol _cblas_ztrsm
1>liblapack.lib(ATL_ztrtriRL.obj) : error LNK2019: unresolved external
symbol _ATL_zcplxinvert referenced in function _ATL_ztrtriRL
1>liblapack.lib(ATL_ztrtriCL.obj) : error LNK2001: unresolved external
symbol _ATL_zcplxinvert
1>liblapack.lib(ATL_ztrtriRU.obj) : error LNK2001: unresolved external
symbol _ATL_zcplxinvert
1>liblapack.lib(ATL_ztrtriCU.obj) : error LNK2001: unresolved external
symbol _ATL_zcplxinvert
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol _atexit
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol _atexit
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_atexit referenced in function "void __cdecl `dynamic initializer for
'initlocks''(void)" (??__Einitlocks@@YAXXZ)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol
_atexit
1>libcpmtd.lib(xlock.obj) : error LNK2001: unresolved external symbol
_atexit
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _atexit
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
___iob_func referenced in function "void __cdecl std::`dynamic
initializer for 'fout''(void)" (??__Efout@std@@YAXXZ)
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external
symbol ___iob_func
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fwrite referenced in function "protected: virtual int __thiscall
std::basic_filebuf<char,struct std::char_traits<char> >::overflow
(int)" (?overflow@?$basic_filebuf@DU?
$char_traits@D@std@@@std@@MAEHH@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fputc referenced in function "bool __cdecl std::_Fputc<char>
(char,struct _iobuf *)" (??$_Fputc@D@std@@YA_NDPAU_iobuf@@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_ungetc referenced in function "bool __cdecl std::_Ungetc<char>(char
const &,struct _iobuf *)" (??$_Ungetc@D@std@@YA_NABDPAU_iobuf@@@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fgetc referenced in function "protected: virtual int __thiscall
std::basic_filebuf<char,struct std::char_traits<char> >::uflow
(void)" (?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fgetpos referenced in function "protected: virtual class
std::fpos<int> __thiscall std::basic_filebuf<char,struct
std::char_traits<char> >::seekoff(long,int,int)" (?seekoff@?
$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fseek referenced in function "protected: virtual class std::fpos<int>
__thiscall std::basic_filebuf<char,struct std::char_traits<char>
>::seekoff(long,int,int)" (?seekoff@?$basic_filebuf@DU?
$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fsetpos referenced in function "protected: virtual class
std::fpos<int> __thiscall std::basic_filebuf<char,struct
std::char_traits<char> >::seekpos(class std::fpos<int>,int)" (?
seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?
$fpos@H@2@V32@H@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_setvbuf referenced in function "protected: virtual class
std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall
std::basic_filebuf<char,struct std::char_traits<char> >::setbuf(char
*,int)" (?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?
$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fflush referenced in function "protected: virtual int __thiscall
std::basic_filebuf<char,struct std::char_traits<char> >::sync(void)" (?
sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ)
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external
symbol _fflush
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
_fclose referenced in function "public: class
std::basic_filebuf<char,struct std::char_traits<char> > * __thiscall
std::basic_filebuf<char,struct std::char_traits<char> >::close
(void)" (?close@?$basic_filebuf@DU?
$char_traits@D@std@@@std@@QAEPAV12@XZ)
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol
"void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) referenced in
function "protected: void __thiscall std::ctype<char>::_Tidy(void)" (?
_Tidy@?$ctype@D@std@@IAEXXZ)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__malloc_dbg referenced in function "void * __cdecl operator new
(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??
2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol __malloc_dbg
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const
&,int)" (??0exception@std@@QAE@ABQBDH@Z) referenced in function
"public: __thiscall std::bad_alloc::bad_alloc(void)" (??
0bad_alloc@std@@QAE@XZ)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__free_dbg referenced in function "void __cdecl operator delete(void
*,struct std::_DebugHeapTag_t const &,char *,int)" (??
3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol __free_dbg
1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external
symbol _abort referenced in function "void __cdecl std::_Debug_message
(char const *,char const *)" (?_Debug_message@std@@YAXPBD0@Z)
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external
symbol _abort
1>libcpmtd.lib(iosptrs.obj) : error LNK2001: unresolved external
symbol _abort
1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external
symbol _fputs referenced in function "void __cdecl std::_Debug_message
(char const *,char const *)" (?_Debug_message@std@@YAXPBD0@Z)
1>libcpmtd.lib(uncaught.obj) : error LNK2019: unresolved external
symbol "bool __cdecl __uncaught_exception(void)" (?
__uncaught_exception@@YA_NXZ) referenced in function "bool __cdecl
std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ)
1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external
symbol _setlocale referenced in function "public: static void __cdecl
std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?
_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z)
1>libcpmtd.lib(xwctomb.obj) : error LNK2019: unresolved external
symbol ____mb_cur_max_l_func referenced in function __Wcrtomb
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol ____mb_cur_max_l_func
1>libcpmtd.lib(xwctomb.obj) : error LNK2019: unresolved external
symbol __errno referenced in function __Wcrtomb
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol __errno
1>libcpmtd.lib(xwctomb.obj) : error LNK2019: unresolved external
symbol ____lc_codepage_func referenced in function __Wcrtomb
1>libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external
symbol ____lc_codepage_func
1>libcpmtd.lib(_toupper.obj) : error LNK2001: unresolved external
symbol ____lc_codepage_func
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol ____lc_codepage_func
1>libcpmtd.lib(xwctomb.obj) : error LNK2019: unresolved external
symbol ____lc_handle_func referenced in function __Wcrtomb
1>libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external
symbol ____lc_handle_func
1>libcpmtd.lib(_toupper.obj) : error LNK2001: unresolved external
symbol ____lc_handle_func
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol ____lc_handle_func
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external
symbol ___crtLCMapStringA referenced in function __Tolower
1>libcpmtd.lib(_toupper.obj) : error LNK2001: unresolved external
symbol ___crtLCMapStringA
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external
symbol ___pctype_func referenced in function __Tolower
1>libcpmtd.lib(_toupper.obj) : error LNK2001: unresolved external
symbol ___pctype_func
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external
symbol ___pctype_func
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external
symbol _isupper referenced in function __Tolower
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external
symbol _memcpy referenced in function __Getctype
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external
symbol __calloc_dbg referenced in function __Getctype
1>libcpmtd.lib(_toupper.obj) : error LNK2019: unresolved external
symbol _islower referenced in function __Toupper
1>libcpmtd.lib(xmbtowc.obj) : error LNK2019: unresolved external
symbol __free_locale referenced in function __GetLocaleForCP
1>libcpmtd.lib(xmbtowc.obj) : error LNK2019: unresolved external
symbol __create_locale referenced in function __CreateLocForCP
1>libcpmtd.lib(xmbtowc.obj) : error LNK2019: unresolved external
symbol __ui64toa_s referenced in function __CreateLocForCP
1>D:\UC DAVIS\Research\cpp\example_clapack\Debug\test_clapack.exe :
fatal error LNK1120: 75 unresolved externals
1>Build log was saved at "file://d:\UC DAVIS\Research\cpp
\example_clapack\Debug\BuildLog.htm"
1>test_clapack - 223 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Mark Hoemmen

unread,
Sep 22, 2009, 1:50:54 PM9/22/09
to matrixpr...@googlegroups.com
Please use a pastebin service, like pastebin.com, for posting long
code fragments and error messages. A good pastebin service will also
have syntax highlighting and automatic indentation of source code.
This can be a big help for us, especially if our e-mail clients mess
up the indentation of your original source code.

mfh

Mark Hoemmen

unread,
Sep 22, 2009, 1:52:41 PM9/22/09
to matrixpr...@googlegroups.com
It looks like the precompiled binaries are expecting symbol names that
aren't there. It's hard to say more unless we can see your Makefile.

mfh

Evgenii Rudnyi

unread,
Sep 22, 2009, 2:14:41 PM9/22/09
to matrixpr...@googlegroups.com
...

> I am using the precompiled libraries of lapack and f2c that comes with
> TAUCS (liblapack.lib and vcf2c.lib).
>
> Can i get some help/guidance with the following errors?.
>
> Thanks.
> Alejandro.

...

> 1>libcpmtd.lib(xmbtowc.obj) : error LNK2019: unresolved external
> symbol __ui64toa_s referenced in function __CreateLocForCP

The linking errors are coming from libcmpmtd. It looks like that you are
compiling with -MD while the libraries from TAUCS are compiled with -MT.
Try to compile the code with -MT. If you need -MD, then you need to
recompile the libraries with -MD.

Evgenii

Alejandro A. Ortiz Bernardin

unread,
Sep 22, 2009, 2:50:28 PM9/22/09
to matrixpr...@googlegroups.com

>>The linking errors are coming from libcmpmtd. It looks like that you are
>>compiling with -MD while the libraries from TAUCS are compiled with -MT.
>>Try to compile the code with -MT. If you need -MD, then you need to
>>recompile the libraries with -MD.

Yet I get lots of errors. I decide to use gcc instead. I have a folder "gcc"
where the following files are located: clapack_example.cpp, liblapack.lib

I have tried this in "gcc" folder:

g++ -c clapack_example.cpp
g++ -o example clapack_example.o -L ../gcc -llapack

The last line gives me the following output: collect2: ld returned 1 exit
status.

What might be the problem here?

Alejandro A. Ortiz Bernardin

unread,
Sep 22, 2009, 3:17:48 PM9/22/09
to matrixpr...@googlegroups.com

>> I have a folder "gcc" where the following files are located:
>> clapack_example.cpp, liblapack.lib

>> I have tried this in "gcc" folder:

>> g++ -c clapack_example.cpp
>> g++ -o example clapack_example.o -L ../gcc -llapack

>> The last line gives me the following output: collect2: ld returned 1 exit
>> status.

>> What might be the problem here?

I figured out that I am using the libraries for MVS *.lib, which were not
created with gcc.

Evgenii Rudnyi

unread,
Sep 22, 2009, 3:47:16 PM9/22/09
to matrixpr...@googlegroups.com
> I figured out that I am using the libraries for MVS *.lib, which were not
> created with gcc.

They actually should work but you need to rename them. With -llapack
gcc searches for the file liblapack.a.

However with gcc you can use precompiled ATLAS that available here with
the instruction on how to do it with an example of DGEMM

http://matrixprogramming.com/MatrixMultiply/

Look at

Using Specialized Libraries: BLAS and ATLAS

Alejandro A. Ortiz Bernardin

unread,
Sep 22, 2009, 4:04:28 PM9/22/09
to matrixpr...@googlegroups.com

>> http://matrixprogramming.com/MatrixMultiply/

Ok. Thanks. I'll try it. In order to start I just want to be sure what
libraries I have to use. I'll use your precompiled libraries.
You have: libatlas.a, libblas.a, libcblas.a, libf77blas.a and liblapack.a

Should I use all of them? Some of them? or just liblapack?

Alejandro A. Ortiz Bernardin

unread,
Sep 22, 2009, 4:20:34 PM9/22/09
to matrixpr...@googlegroups.com

>> Ok. Thanks. I'll try it. In order to start I just want to be sure
>> what libraries I have to use. I'll use your precompiled libraries.
>> You have: libatlas.a, libblas.a, libcblas.a, libf77blas.a and liblapack.a

>> Should I use all of them? Some of them? or just liblapack?

I just started to use them one by one. On using all the libraries I got the
following errors:

http://pastebin.com/m4a9e61b2

The code I am using is here:

http://pastebin.com/m607b3393


Alejandro A. Ortiz Bernardin

unread,
Sep 22, 2009, 4:30:06 PM9/22/09
to matrixpr...@googlegroups.com

>> http://pastebin.com/m4a9e61b2

>> http://pastebin.com/m607b3393

Sorry, there was a mistake in the code. The new code is here:

http://pastebin.com/m7c0beecd


and the errors remain in the same post:

>> http://pastebin.com/m4a9e61b2

Mark Hoemmen

unread,
Sep 23, 2009, 1:05:33 AM9/23/09
to matrixpr...@googlegroups.com
On Tue, Sep 22, 2009 at 13:30, Alejandro A. Ortiz Bernardin
<aor...@gmail.com> wrote:
> Sorry, there was a mistake in the code. The new code is here:
>
> http://pastebin.com/m7c0beecd
>
>
> and the errors remain in the same post:
>
>>> http://pastebin.com/m4a9e61b2

It looks like xerbla is trying to call Fortran intrinsics that aren't
linked in. You could try including the Fortran runtime library when
you link. What that should be depends on the Fortran compiler with
which the relevant libraries were built.

You really only need one LAPACK library and one BLAS library. I
shouldn't say more as I don't build on this particular system and I
don't want to confuse you with my ill-informedness ;-)

mfh

Mark Hoemmen

unread,
Sep 23, 2009, 1:06:09 AM9/23/09
to matrixpr...@googlegroups.com
> On Tue, Sep 22, 2009 at 13:30, Alejandro A. Ortiz Bernardin
> <aor...@gmail.com> wrote:
>> Sorry, there was a mistake in the code. The new code is here:
>>
>> http://pastebin.com/m7c0beecd
>>
>> and the errors remain in the same post:
>>
>>>> http://pastebin.com/m4a9e61b2

btw thanks for using pastebin -- hope I wasn't too annoying about
that. It really does help with formatting and all.

mfh

Evgenii Rudnyi

unread,
Sep 23, 2009, 2:33:18 PM9/23/09
to matrixpr...@googlegroups.com
> Sorry, there was a mistake in the code. The new code is here:
>
> http://pastebin.com/m7c0beecd
>
>
> and the errors remain in the same post:
>
>>> http://pastebin.com/m4a9e61b2

First about the libraries at my site. They are from ATLAS, that is,
liblapack.a needs ATLAS libs, not BLAS. Note that liblapack.a is not
complete but routines you need are there.

f77blas was compiled with g77 and it requires g2c. Then the order of the
libraries was not correct, gcc searches the library only once. By me the
next command is working

$ g++ inverse.cpp -L. -llapack -lf77blas -lcblas -latlas -lg2c

but then there is segmentation fault when I run the binary (a.exe in
this case). Some output is though is available.

With libraries from TAUCS I was also able to compile and link the code
with MS VC

$ cl -EHsc -MT inverse.cpp lapack_win32.lib blas_win32.lib vcf2c.lib

These are original LAPACK and the reference BLAS and below is ATLAS

$ cl -EHsc -MT inverse.cpp liblapack.lib libf77blas.lib libcblas.lib
libatlas.lib vcf2c.lib

As I have already mentioned you need -MT, as the libraries are compiled
with -MT. If you use -MD, then I see a lot of linking errors. With VC
however, there is a crash without any output. Please repeat with either
gcc or VC and then try to fix the code. A good idea is to insert more
outputs.

Alejandro A. Ortiz Bernardin

unread,
Sep 24, 2009, 2:00:44 AM9/24/09
to matrixpr...@googlegroups.com

>> f77blas was compiled with g77 and it requires g2c. Then the order of the
>> libraries was not correct, gcc searches the library only once. By me the
>> next command is working

>> $ g++ inverse.cpp -L. -llapack -lf77blas -lcblas -latlas -lg2c

For me too. Thanks.

>> but then there is segmentation fault when I run the binary (a.exe in
>> this case). Some output is though is available.

What strange ... I don't get segmentation fault .. but I don't get the
correct inverse, though.

>> With libraries from TAUCS I was also able to compile and link the code
>> with MS VC

>> $ cl -EHsc -MT inverse.cpp lapack_win32.lib blas_win32.lib vcf2c.lib

>> These are original LAPACK and the reference BLAS

I don't have these libraries. I just have the ones from ATLAS, so I didn't
try it.

>> and below is ATLAS

>> $ cl -EHsc -MT inverse.cpp liblapack.lib libf77blas.lib libcblas.lib
>> libatlas.lib vcf2c.lib

There is something strange here. If I do it from the command line with cl as
you have shown above, it is working fine for me too. Again, I don't get
segmentation fault but not the correct inverse.

Now, if I do it from the MVS GUI, I get lots of errors. I have specified the
same flags as you did from command line above, i.e., -EHsc and -MT. I guess
that other flags might be activated by default in the GUI which is causing
the errors?

I posted the errors here: http://pastebin.com/m7ff68d01

-a


Evgenii Rudnyi

unread,
Sep 24, 2009, 2:32:56 PM9/24/09
to matrixpr...@googlegroups.com
> What strange ... I don't get segmentation fault .. but I don't get the
> correct inverse, though.

Probably I have used the wrong code. If inverse is not correct, it is
necessary to check the calls. There is an example from NAG

http://www.nag.com/numeric/fl/manual20/pdf/F07/f07fjf.pdf

It could be possible to find other examples as well.

>>> With libraries from TAUCS I was also able to compile and link the code
>>> with MS VC
>
>>> $ cl -EHsc -MT inverse.cpp lapack_win32.lib blas_win32.lib vcf2c.lib
>
>>> These are original LAPACK and the reference BLAS
>
> I don't have these libraries. I just have the ones from ATLAS, so I didn't
> try it.

I think that they have been also in TAUCS. Definitely I have not
compiled them by myself.

>>> and below is ATLAS
>
>>> $ cl -EHsc -MT inverse.cpp liblapack.lib libf77blas.lib libcblas.lib
>>> libatlas.lib vcf2c.lib
>
> There is something strange here. If I do it from the command line with cl as
> you have shown above, it is working fine for me too. Again, I don't get
> segmentation fault but not the correct inverse.
>
> Now, if I do it from the MVS GUI, I get lots of errors. I have specified the
> same flags as you did from command line above, i.e., -EHsc and -MT. I guess
> that other flags might be activated by default in the GUI which is causing
> the errors?
>
> I posted the errors here: http://pastebin.com/m7ff68d01

It is the same. You will receive them from the command line if you use
-MD instead of -MT. I guess that you need to click something in GUI, not
just give the option -MT as such. But I do not know GUI, sorry. You may
want to ask about this at somewhere at microsoft.public.vc.*

Alejandro A. Ortiz Bernardin

unread,
Sep 25, 2009, 3:57:57 AM9/25/09
to matrixpr...@googlegroups.com

> What strange ... I don't get segmentation fault .. but I don't get the
> correct inverse, though.

>> Probably I have used the wrong code. If inverse is not correct, it is
>> necessary to check the calls. There is an example from NAG

>> http://www.nag.com/numeric/fl/manual20/pdf/F07/f07fjf.pdf

Possibly you used my old code (I had posted a correction, so you might have
picked the wrong one). Finally, I found out what the problem was. C version
of lapack expects the matrix in a vector ordered by columns. Here is the
code working perfectly:

http://pastebin.com/m7a8c8873 ,

which can be built with:

g++ -c inverse.cpp
g++ -o inverse inverse.o L./ -llapack -lf77blas -lcblas -latlas -lg2c

It would be great if you can post it in matrixprogramming.com

Thanks for your always valuable help!
Alejandro.

Evgenii Rudnyi

unread,
Sep 25, 2009, 2:34:51 PM9/25/09
to matrixpr...@googlegroups.com
> Possibly you used my old code (I had posted a correction, so you might have
> picked the wrong one). Finally, I found out what the problem was. C version
> of lapack expects the matrix in a vector ordered by columns. Here is the
> code working perfectly:
> http://pastebin.com/m7a8c8873 ,
>
> which can be built with:
>
> g++ -c inverse.cpp
> g++ -o inverse inverse.o L./ -llapack -lf77blas -lcblas -latlas -lg2c
>
> It would be great if you can post it in matrixprogramming.com

It is now here

http://matrixprogramming.com/LAPACK/

Alejandro A. Ortiz Bernardin

unread,
Sep 25, 2009, 2:54:46 PM9/25/09
to matrixpr...@googlegroups.com

>> It is the same. You will receive them from the command line if you use
>> -MD instead of -MT. I guess that you need to click something in GUI, not
>> just give the option -MT as such. But I do not know GUI, sorry. You may
>> want to ask about this at somewhere at microsoft.public.vc.*

I tried to solve this but I couldn't. There are lots of thing in the command
line that are put by default. Here is the complete command line
http://pastebin.com/m5aea0f8d

I'll ask in Microsoft.


Alejandro A. Ortiz Bernardin

unread,
Sep 26, 2009, 5:09:02 AM9/26/09
to matrixpr...@googlegroups.com

Finally, I just specify \MTd in the GUI and the errors disappeared. However,
I don't understand why in the command line works fine with just -MT.


Reply all
Reply to author
Forward
0 new messages