Problem running TAUCS in Microsoft Visual C++ 6.0

239 views
Skip to first unread message

aortizb

unread,
Oct 11, 2008, 6:18:32 PM10/11/08
to matrixprogramming
Hello All,

I have a problem using TAUCS on Win32. I have some experience using
TAUCS in Linux only. I have been trying to use TAUCS in windows for
about 1 month without success. I guess some of you have done this in
Win32 before. I don’t have any problem under Linux where I use TAUCS
in all my codes. I am appealing to your kind advice on using TAUCS in
Win32. Could someone help me in this regard?. The C++ code I want to
run is too simple. It is just to test a 10x10 linear system of
equations. I have tried this several times with different types of
Win32 TAUCS libraries compilations but without success so far. In
linux it runs pretty well, though. I also contacted to TAUCS’s author
but I guess they don’t offer support so I didn’t get a reply from him.
I have done some modifications in taucs header, so it looks like
something like this:

#ifdef __cplusplus
extern "C" {
#endif

In Linux runs pretty well. In Win32 I have some linkage problems. My
question is why this works in Linux and no in Win32? What can I do so
the code runs in Win32 using Microsoft Visual C++ 6.0?. Thanks in
advance.

Alejandro.


My sample code that works in Linux is the following:

#include <iostream>
using namespace std;

#define TAUCS_CORE_DOUBLE
#include <taucs.h>
#include <vector>

int main()
{
vector<double> an(10);
vector<int> jn(10);
vector<int> ia(10);
vector<double> f(10); // right-hand size vector object

// create CCS matrix structure using vector class
an[0] = 1.0;
an[1] = 0.5;
an[2] = 1.0;
an[3] = 0.5;
an[4] = 1.0;
an[5] = 0.5;
an[6] = 1.0;

jn[0] = 0;
jn[1] = 1;
jn[2] = 1;
jn[3] = 2;
jn[4] = 2;
jn[5] = 3;
jn[6] = 3;

ia[0] = 0;
ia[1] = 2;
ia[2] = 4;
ia[3] = 6;
ia[4] = 7;

// create right-hand size vector object
f[0] = 1.0;
f[1] = 2.0;
f[2] = 3.0;
f[3] = 4.0;

// resize vectors.
an.resize(7);
jn.resize(7);
ia.resize(5);
f.resize(4);

// create TAUCS matrix from vector objects an, jn and ia
taucs_ccs_matrix A; // a matrix to solve Ax=b in CCS format
A.n = ia.size() - 1;
A.m = ia.size() - 1;
A.flags = (TAUCS_DOUBLE | TAUCS_SYMMETRIC | TAUCS_LOWER);
A.colptr = &ia[0];
A.rowind = &jn[0];
A.values.d = &an[0];

// create TAUCS right-hand size
taucs_double* b = &f[0]; // right hand side vector to solve Ax=b

// allocate TAUCS solution vector
taucs_double* x = new taucs_double[f.size()]; // the unknown vector
to solve Ax=b

// solve the linear system
void* F = NULL;
char* options[] = {"taucs.factor.LLT=true", NULL};
void* opt_arg[] = { NULL };

int i = taucs_linsolve(&A, &F, 1, x, b, options, opt_arg);

if (i != TAUCS_SUCCESS)
{
cout << "Solution error." << endl;
if (i==TAUCS_ERROR)
cout << "Generic error." << endl;

if (i==TAUCS_ERROR_NOMEM)
cout << "NOMEM error." << endl;

if (i==TAUCS_ERROR_BADARGS)
cout << "BADARGS error." << endl;

if (i==TAUCS_ERROR_MAXDEPTH)
cout << "MAXDEPTH error." << endl;

if (i==TAUCS_ERROR_INDEFINITE)
cout << "NOT POSITIVE DEFINITE error." << endl;
}
else
{
cout << "Solution success." << endl;

for (unsigned j = 0; j < f.size(); j++)
cout << x[j] << endl;
}

// deallocate the factorization
taucs_linsolve(NULL, &F, 0, NULL, NULL, NULL, NULL);

// deallocate solution
delete [] x;

return 0;
}




Evgenii Rudnyi

unread,
Oct 12, 2008, 4:34:14 AM10/12/08
to matrixpr...@googlegroups.com
> In Linux runs pretty well. In Win32 I have some linkage problems. My
> question is why this works in Linux and no in Win32? What can I do so
> the code runs in Win32 using Microsoft Visual C++ 6.0?. Thanks in
> advance.
>

Hi Alejandro,

I was able to compile and run your test program on Win32

$ cl -I../../lib/include -EHsc -MD -c main.cpp
$ cl main.obj libtaucs.lib libmetis.lib mkl_intel_c.lib
mkl_intel_thread.lib mkl_core.lib libiomp5md.lib -link
-LIBPATH:../../ms/lib/bin
$ ./main.exe
Solution success.
0
2
0
4

What linking problems do you have? There could be many reasons for this.
It could depends on BLAS that you use. In the example above I have used
Intel MKL. In Intel MKL for example the function names are in uppercase
and without the underscore.

Please just describe what you have done and what an error message do you
receive.

Best wishes,

Evgenii

aortizb

unread,
Oct 12, 2008, 5:20:18 AM10/12/08
to matrixprogramming

> What linking problems do you have? There could be many reasons for this.
> It could depends on BLAS that you use. In the example above I have used
> Intel MKL. In Intel MKL for example the function names are in uppercase
> and without the underscore.
>
> Please just describe what you have done and what an error message do you
> receive.

Hello Evgenii, thanks for your prompt reply. Actually, I've tried:

1) Compiling TAUCS library in Win32 from the version 2.2 posted by the
author in the TAUCS web page and using the precomiled external
libraries provided there. This is the same procedure that I use in
Linux successfully.

2) Using a precompiled TAUCS library and external libraries, both for
Win32 in the following home page: http://www.cs.tau.ac.il/~tommer/adv-graphics/ex1.htm

3) The TAUCS library and the external ones provided in the last
version of CGAL.

I use neither of the "taucs.h" headers provided in the files of 1), 2)
and 3) nor the "taucsaddon.h" provided in 2), but rather I use just
the libraries. For the headers, I use my own headers that I use under
Linux. I can't upload them here, so I will send them you by e-mail.

For the libraries in 2) I follow the rules given in the web page:
"taucs (VS6 & VS.NET) is compiled using Multi-Threaded (/MT non-debug)
runtime. Either compile your project using /MT (Project Settings->C/C+
+->Code Generation) or set the /NODEFAULTLIB:LIBCMT.LIB to override
the /MT runtime from the pre-compiled taucs".

I use Microsoft Visual C++ 6.0. The code above compiles well but when
linking I get the following linkage error for all the three cases 1),
2) and 3):

--------------------Configuration: test - Win32
Debug--------------------
Linking...
test4.obj : error LNK2001: unresolved external symbol _taucs_linsolve
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

test.exe - 2 error(s), 0 warning(s)


Any idea what the problem is about?

Thanks,
Alejandro





Alejandro A. Ortiz Bernardin

unread,
Oct 12, 2008, 5:23:47 AM10/12/08
to matrixpr...@googlegroups.com, Evgenii Rudnyi
Hi Evgenii,

Attached are the TAUCS headers that I am using for Windows and Linux.

Thanks,
Alejandro.

-----Mensaje original-----
De: matrixpr...@googlegroups.com
[mailto:matrixpr...@googlegroups.com] En nombre de Evgenii Rudnyi
Enviado el: Sunday, October 12, 2008 1:34 AM
Para: matrixpr...@googlegroups.com
Asunto: [matrixprogramming] Re: Problem running TAUCS in Microsoft Visual
C++ 6.0

taucs_private.h
taucs.h
taucs_config_build.h
taucs_config_tests.h

Evgenii Rudnyi

unread,
Oct 12, 2008, 8:26:02 AM10/12/08
to matrixpr...@googlegroups.com
...

> I use neither of the "taucs.h" headers provided in the files of 1), 2)
> and 3) nor the "taucsaddon.h" provided in 2), but rather I use just
> the libraries. For the headers, I use my own headers that I use under
> Linux. I can't upload them here, so I will send them you by e-mail.

I have changed the settings and now you can upload the files. There were
cases when spammers uploaded files with inappropriate content and I have
disabled the access but now the upload it allowed.

However, the simpler solution would be to use

extern "C" {
#include <taucs.h>
}

in the code. This way you do not need to change the headers. Well, I
have to check if I have modified my headers or not, I do not remember it
right now.

> I use Microsoft Visual C++ 6.0. The code above compiles well but when
> linking I get the following linkage error for all the three cases 1),
> 2) and 3):
>
> --------------------Configuration: test - Win32
> Debug--------------------
> Linking...
> test4.obj : error LNK2001: unresolved external symbol _taucs_linsolve
> Debug/test.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
>
> test.exe - 2 error(s), 0 warning(s)
>
>
> Any idea what the problem is about?

Well, it could be that VC does not use the TAUCS library. Alternatively
the name in the object file does not correspond to the name in the library.

First make sure that you have made setting in VC to link with the TACUS
library. I do not know how to do it from GUI as I do not use it. From
the command line is as follows

cl test.obj libtaucs.lib

and then to make sure the cl finds the library. But if it does not, it
makes an error message in this case.

If the problem persists, check the object names. I do it with nm from
cygwin:

$ nm main.obj | grep -i taucs_linsolve
U _taucs_linsolve

It says that the object file needs this function.

$ nm libtaucs.lib | grep -i taucs_linsolve
obj//win32//taucs_linsolve.obj:
...
00000000 T _taucs_linsolve

It says that the function is in the library.

If VC does search functions in the library and you get the message
above, then these two command should produce somewhat different names.

Evgenii

aortizb

unread,
Oct 12, 2008, 2:13:13 PM10/12/08
to matrixprogramming

>
> However, the simpler solution would be to use
>
> extern "C" {
> #include <taucs.h>
>
> }

Ok. I did this before but I remember that I have some errors, so I
tried the other way.

>
> Well, it could be that VC does not use the TAUCS library. Alternatively
> the name in the object file does not correspond to the name in the library.
>
> First make sure that you have made setting in VC to link with the TACUS
> library. I do not know how to do it from GUI as I do not use it. From
> the command line is as follows
>
> cl test.obj libtaucs.lib
>

I have specified where the libraries and the headers are. There is a
makefile
which is created automatically in which I have checked that the
directories
are specified.

> and then to make sure the cl finds the library. But if it does not, it
> makes an error message in this case.
>

Maybe, no idea. The only thing I know is that the directories are
specified
as I explained above.

> If the problem persists, check the object names. I do it with nm from
> cygwin:
>
> $ nm main.obj | grep -i taucs_linsolve
>           U _taucs_linsolve
>
> It says that the object file needs this function.
>
> $ nm libtaucs.lib  | grep -i taucs_linsolve
> obj//win32//taucs_linsolve.obj:
> ...
> 00000000 T _taucs_linsolve
>
> It says that the function is in the library.
>
> If VC does search functions in the library and you get the message
> above, then these two command should produce somewhat different names.
>

I also have installed Cygwin in my PC. I will try it to see if the
problem persists.
Just one doubt. If I use Cygwin to build the application, then will it
run just over
Cygwin? or can I run it directly on Win32?


Thanks,
Alejandro.

aortizb

unread,
Oct 12, 2008, 2:42:22 PM10/12/08
to matrixprogramming
In addition to my reply above. Now, I have tried using the VC++ 2005
express edition and I get the following linkage error with more
information:

1>------ Build started: Project: test, Configuration: Debug Win32
------
1>Compiling...
1>test4.cpp
1>c:\documents and settings\alejandro\desktop\taucs_test\test
\test4.cpp(56) : warning C4267: '=' : conversion from 'size_t' to
'int', possible loss of data
1>c:\documents and settings\alejandro\desktop\taucs_test\test
\test4.cpp(57) : warning C4267: '=' : conversion from 'size_t' to
'int', possible loss of data
1>Compiling manifest to resources...
1>Linking...
1>test4.obj : error LNK2019: unresolved external symbol
_taucs_linsolve referenced in function _main
1>C:\Documents and Settings\ALEJANDRO\Desktop\taucs_test\test\Debug
\test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\ALEJANDRO
\Desktop\taucs_test\test\Debug\BuildLog.htm"
1>test - 2 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
> Alejandro.- Hide quoted text -
>
> - Show quoted text -

Evgenii Rudnyi

unread,
Oct 12, 2008, 3:04:26 PM10/12/08
to matrixpr...@googlegroups.com
> In addition to my reply above. Now, I have tried using the VC++ 2005
> express edition and I get the following linkage error with more
> information:
>
> 1>------ Build started: Project: test, Configuration: Debug Win32
> ------
> 1>Compiling...
> 1>test4.cpp
> 1>c:\documents and settings\alejandro\desktop\taucs_test\test
> \test4.cpp(56) : warning C4267: '=' : conversion from 'size_t' to
> 'int', possible loss of data
> 1>c:\documents and settings\alejandro\desktop\taucs_test\test
> \test4.cpp(57) : warning C4267: '=' : conversion from 'size_t' to
> 'int', possible loss of data
> 1>Compiling manifest to resources...
> 1>Linking...
> 1>test4.obj : error LNK2019: unresolved external symbol
> _taucs_linsolve referenced in function _main
> 1>C:\Documents and Settings\ALEJANDRO\Desktop\taucs_test\test\Debug
> \test.exe : fatal error LNK1120: 1 unresolved externals
> 1>Build log was saved at "file://c:\Documents and Settings\ALEJANDRO
> \Desktop\taucs_test\test\Debug\BuildLog.htm"
> 1>test - 2 error(s), 2 warning(s)
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==========

It is actually the same linking error - unresolved symbol
_taucs_linsolve. Additionally there are two warnings during compile but
they have nothing to do with this.

What happens is that the linker cannot find this symbol during linking.
Why? I can imagine only the two reasons that I have mentioned. The
linker is a pretty simple tool.

A good introduction to linking is a paper

David M. Beazley, Brian D. Ward, and Ian R. Cooke,
The Inside Story On Shared Libraries and Dynamic Loading,
Computing in Science & Engineering, September/October 2001, N 5, p. 90-97.

Evgenii

aortizb

unread,
Oct 12, 2008, 3:26:24 PM10/12/08
to matrixprogramming
OK. I see. I don't understand why MV C++ cannot find the libraries if
I am specifying where they are.
I also tried another complete project in MV C++ example ready to use
in the www, but also I have the same problem (among others).

I initially contacted to you because I thought that you used MV C++
directly in Win32 without using cygwin, but I realize that is not the
case, so if there is
someone else that can comment would be much appreciated.

Thanks,
Alejandro.
> Evgenii- Hide quoted text -

Evgenii Rudnyi

unread,
Oct 12, 2008, 3:27:25 PM10/12/08
to matrixpr...@googlegroups.com
>> However, the simpler solution would be to use
>>
>> extern "C" {
>> #include <taucs.h>
>>
>> }
>
> Ok. I did this before but I remember that I have some errors, so I
> tried the other way.

Interesting. This is exactly how I have compile your example. I have to
check the headers that I use though.

>> Well, it could be that VC does not use the TAUCS library. Alternatively
>> the name in the object file does not correspond to the name in the library.
>>
>> First make sure that you have made setting in VC to link with the TACUS
>> library. I do not know how to do it from GUI as I do not use it. From
>> the command line is as follows
>>
>> cl test.obj libtaucs.lib
>>
>
> I have specified where the libraries and the headers are. There is a
> makefile
> which is created automatically in which I have checked that the
> directories
> are specified.

Could you post the makefile? I guess that it in the NMAKE format but
this should be readable.

You can also try such a command from the command line. It helps to
understand what happens.

>
>> and then to make sure the cl finds the library. But if it does not, it
>> makes an error message in this case.
>>
>
> Maybe, no idea. The only thing I know is that the directories are
> specified
> as I explained above.

If you are sure that the linker checks the library, then what is left is
to check names of symbols in the library. I do not see the third option.

>> If the problem persists, check the object names. I do it with nm from
>> cygwin:
>>
>> $ nm main.obj | grep -i taucs_linsolve
>> U _taucs_linsolve
>>
>> It says that the object file needs this function.
>>
>> $ nm libtaucs.lib | grep -i taucs_linsolve
>> obj//win32//taucs_linsolve.obj:
>> ...
>> 00000000 T _taucs_linsolve
>>
>> It says that the function is in the library.
>>
>> If VC does search functions in the library and you get the message
>> above, then these two command should produce somewhat different names.
>>
>
> I also have installed Cygwin in my PC. I will try it to see if the
> problem persists.
> Just one doubt. If I use Cygwin to build the application, then will it
> run just over
> Cygwin? or can I run it directly on Win32?

Cygwin by itself just brings a Unix-like shell. It is also possible to
do it from cmd but its DOS language is very limited.

It does not matter if you call cl from Cygwin or cmd, the result will be
the same. Cygwin does not change the work of Win32 applications.

I guess there should be also some tools in Visual Studio to check the
names in the libraries and object files. However it is necessary to find
them.

If you use gcc in Cygwin, then it by default links with cygwin1.dll.
Well, its goal is to treat Unix calls. With -mno-cygwin, one uses MINGW
and obtains an application that does not depend on cygwin1.dll. But then
there should be no Unix calls.

I have some short document on how to compile UMFPACK

http://matrixprogramming.com/UMFPACK/

Here there are all three cases under Cygwin: compiling with gcc,
compiling with mingw, and then compiling with VC.

On my list to make a similar thing for TAUCS but this has not been done
yet.

I have the libraries for TAUCS for these three cases and I can give you
them if you want. Well, the library for VC assume that the BLAS names
are uppercase and without underscore (Intel MKL or AMD ACML).

Evgenii

Evgenii Rudnyi

unread,
Oct 12, 2008, 3:32:08 PM10/12/08
to matrixpr...@googlegroups.com
> OK. I see. I don't understand why MV C++ cannot find the libraries if
> I am specifying where they are.
> I also tried another complete project in MV C++ example ready to use
> in the www, but also I have the same problem (among others).
>
> I initially contacted to you because I thought that you used MV C++
> directly in Win32 without using cygwin, but I realize that is not the
> case, so if there is
> someone else that can comment would be much appreciated.

I do use Microsoft VC++ directly - see the message that I have just sent
as a reply to your another message. But I do it from the command line
and I do not know GUI. As I have written, cygwin is just a shell that I
like. With cygwin the work on Linux and Windows looks the same. Anyway,
the scripting capabilities of CMD is a disaster.

Evgenii

aortizb

unread,
Oct 12, 2008, 3:41:35 PM10/12/08
to matrixprogramming
It seems that still I can't attach something, so I copy and paste the
makefile created by MV C++ 6.0:



# Microsoft Developer Studio Generated NMAKE File, Based on test.dsp
!IF "$(CFG)" == ""
CFG=test - Win32 Debug
!MESSAGE No configuration specified. Defaulting to test - Win32 Debug.
!ENDIF

!IF "$(CFG)" != "test - Win32 Release" && "$(CFG)" != "test - Win32
Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "test.mak" CFG="test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "test - Win32 Release" (based on "Win32 (x86) Console
Application")
!MESSAGE "test - Win32 Debug" (based on "Win32 (x86) Console
Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF

CPP=cl.exe
RSC=rc.exe

!IF "$(CFG)" == "test - Win32 Release"

OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros

ALL : "$(OUTDIR)\test.exe"


CLEAN :
-@erase "$(INTDIR)\test4.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\test.exe"

"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /
D "_MBCS" /Fp"$(INTDIR)\test.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\
\" /FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\test.bsc"
BSC32_SBRS= \

LINK32=link.exe
LINK32_FLAGS=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:no /pdb:"$(OUTDIR)\test.pdb" /
machine:I386 /out:"$(OUTDIR)\test.exe"
LINK32_OBJS= \
"$(INTDIR)\test4.obj"

"$(OUTDIR)\test.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ELSEIF "$(CFG)" == "test - Win32 Debug"

OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros

ALL : "$(OUTDIR)\test.exe"


CLEAN :
-@erase "$(INTDIR)\test4.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\test.exe"
-@erase "$(OUTDIR)\test.ilk"
-@erase "$(OUTDIR)\test.pdb"

"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /I "C:\Documents and Settings
\ALEJANDRO\Desktop\taucs_test\taucs_original" /D "WIN32" /D "_DEBUG" /
D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\test.pch" /YX /Fo"$(INTDIR)\\" /
Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\test.bsc"
BSC32_SBRS= \

LINK32=link.exe
LINK32_FLAGS=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:"$(OUTDIR)\test.pdb" /debug /
machine:I386 /nodefaultlib:"LIBCMT.LIB" /out:"$(OUTDIR)\test.exe" /
pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\test4.obj"

"$(OUTDIR)\test.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ENDIF

.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<


!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("test.dep")
!INCLUDE "test.dep"
!ELSE
!MESSAGE Warning: cannot find "test.dep"
!ENDIF
!ENDIF


!IF "$(CFG)" == "test - Win32 Release" || "$(CFG)" == "test - Win32
Debug"
SOURCE=.\test4.cpp

"$(INTDIR)\test4.obj" : $(SOURCE) "$(INTDIR)"



!ENDIF

aortizb

unread,
Oct 12, 2008, 3:46:57 PM10/12/08
to matrixprogramming
Sorry, I paste the wrong Makefile which has not the Lib Path. Now, the
correct:
pdbtype:sept /libpath:"C:\Documents and Settings\ALEJANDRO\Desktop
\taucs_test\taucs_original"
> > - Show quoted text -- Hide quoted text -

Evgenii Rudnyi

unread,
Oct 12, 2008, 3:56:51 PM10/12/08
to matrixpr...@googlegroups.com
Okay. Now it clear. Below there are lines that contain taucs

...


> CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /I "C:\Documents and Settings
> \ALEJANDRO\Desktop\taucs_test\taucs_original" /D "WIN32" /D "_DEBUG" /

This is to find headers.

...


> LINK32_FLAGS=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:"$(OUTDIR)\test.pdb" /debug /
> machine:I386 /nodefaultlib:"LIBCMT.LIB" /out:"$(OUTDIR)\test.exe" /
> pdbtype:sept /libpath:"C:\Documents and Settings\ALEJANDRO\Desktop
> \taucs_test\taucs_original"

This is to find a library. This is the equivalent to -L for gcc. However
you have not told cl what library to search. There are only default
libraries but the TAUCS library is not listed. You need equivalent to -l
for gcc and for cl it is just the library name.

This is why I like the command line. To learn GUI on what dialog boxes I
should click is too complicated.

Evgenii

aortizb

unread,
Oct 12, 2008, 4:06:50 PM10/12/08
to matrixprogramming

>
> > LINK32_FLAGS=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:"$(OUTDIR)\test.pdb" /debug /
> > machine:I386 /nodefaultlib:"LIBCMT.LIB" /out:"$(OUTDIR)\test.exe" /
> > pdbtype:sept /libpath:"C:\Documents and Settings\ALEJANDRO\Desktop
> > \taucs_test\taucs_original"
>
> This is to find a library. This is the equivalent to -L for gcc. However
> you have not told cl what library to search. There are only default
> libraries but the TAUCS library is not listed. You need equivalent to -l
> for gcc and for cl it is just the library name.


OK. Thanks. I know how to put the name of the libraries in the GUI of
MV C++ rather than the name of the directory itself. I'll do it and
let you know how it is going.

Thanks.


> Evgenii

aortizb

unread,
Oct 12, 2008, 9:22:04 PM10/12/08
to matrixprogramming
Hello Evgenii,

I have tried your advice above, but the problem persists. In a
desperated way I did this through
the Windows command prompt following all the steps that you posted in:

http://matrixprogramming.com/Tools/CompileLinkVC.html

So, all was done in a *fair* way. Surprinsingly, the same linkage
error persists. In my PC
I have the following folders:

D:\taucs_test\taucs_original ( for the headers and libraries)
D:\taucs_test\test (for test4.cpp file)

That is the complete sequence in windows command line:

D:\taucs_test\test>cl -EHsc -c -I../taucs_original test4.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

test4.cpp

D:\taucs_test\test>cl test4.obj blas_win32.lib lapack_win32.lib
libatlas.lib lib
cblas.lib libf77blas.lib liblapack.lib libmetis.lib libtaucs.lib
vcf2c.lib -link
-LIBPATH:../taucs_original
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:test4.exe
-LIBPATH:../taucs_original
test4.obj
blas_win32.lib
lapack_win32.lib
libatlas.lib
libcblas.lib
libf77blas.lib
liblapack.lib
libmetis.lib
libtaucs.lib
vcf2c.lib
test4.obj : error LNK2001: unresolved external symbol _taucs_linsolve
test4.exe : fatal error LNK1120: 1 unresolved externals

So, what is going on now?

Thanks,
Alejandro.

Evgenii Rudnyi

unread,
Oct 14, 2008, 2:29:12 PM10/14/08
to matrixpr...@googlegroups.com

I have looked at the library that you have sent me. nm shows that it
does not have the symbol _taucs_linsolve indeed. Actually its size is
very small (10 Kb). Something went wrong during its compilation.

I have copied my TAUCS libraries to

http://matrixprogramming.com/TAUCS/

in readme.txt I have written shortly about them. I am not sure if they
will help you. Well, the VC library expects to have the BLAS calls
uppercase and without underscore (Intel MKL or AMD ACML). The mingw DLL
should be compatible but I guess that cl will expect the import library.
And the cygwin library depends on cygwin1.dll. Anyway all three
libraries have _taucs_linsolve.

I still plan to document the way I have compiled TAUCS, similar to
UMFPACK, but it is unclear when I will have time.

Best wishes,

Evgenii

aortizb

unread,
Oct 14, 2008, 7:28:48 PM10/14/08
to matrixprogramming
Hello Egvenii,

Finally, I found where the problem is and now I can build the TAUCS
library from the original source code posted by the author in the
website.

In my PC I have MV C++ 6.0 and MV C++ 2008. The problem seems to be in
the newer version since in the building stage some errors arise and
then the TAUCS library is not built as supposed to be. Surprisingly,
no problem is found when building it with MV C++ 6.0. Now, the library
looks very good and I was able to run my codes along TAUCS in Win32
successfully. But this was not the only thing that I had to figure out
but also something that you pointed me out about giving to MV C++ not
only the folder in which the TAUCS library is but also the name of the
library. Yes, that was simply enough to run TAUCS in Win32.

So thank you so much, first for helping me out in this problem and
second for opening this valuable forum. Certainly, I will post here
any thing that might be of interest to share with other people
involved in matrix related computation.

Best,
Alejandro.


Evgenii Rudnyi

unread,
Oct 19, 2008, 6:45:43 AM10/19/08
to matrixpr...@googlegroups.com
I have made a quick test with my MS VC 2005 from the command prompt
(cmd) that was already set up for MS VC (all environment variables for
MS VC have been set). Say nmake was working. I have used

http://www.tau.ac.il/~stoledo/taucs/2.2/taucs_full.zip

1) unzip taucs_full.zip

2) configure

3) nmake

That's it. I have got the library and the examples have been also
successfully linked with the supplied libraries in taucs_full.zip.

cd bin\win32

direct -mesh2d 400 -log stdout -snmf

Well, MS VC has made warnings about some functions. For example

progs\\iter.c(369) : warning C4996: 'fscanf': This function or variable
may be unsafe. Consider using fscanf_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.

It could be that in VC 2008 they have disabled them and then it could be
necessary to modify the TAUCS code to compile it. If you write what
errors there were there, I could think of a workaround.

Evgenii

aortizb

unread,
Oct 21, 2008, 10:22:09 PM10/21/08
to matrixprogramming
Hi Evgenii,

I remember that the problem was after type configure. Once one types
configure it is supposed that a makefile is created. The problem was
that with MS VC 2008 that makefile was not created and so when I typed
*nmake* there was no makefile available. I'll give you more details by
the weekend.

Alejandro.

aortizb

unread,
Oct 21, 2008, 10:22:09 PM10/21/08
to matrixprogramming
Hi Evgenii,

I remember that the problem was after type configure. Once one types
configure it is supposed that a makefile is created. The problem was
that with MS VC 2008 that makefile was not created and so when I typed
*nmake* there was no makefile available. I'll give you more details by
the weekend.

Alejandro.

On Oct 19, 3:45 am, Evgenii Rudnyi <use...@rudnyi.ru> wrote:

Evgenii Rudnyi

unread,
Oct 22, 2008, 2:47:10 AM10/22/08
to matrixpr...@googlegroups.com
> I remember that the problem was after type configure. Once one types
> configure it is supposed that a makefile is created. The problem was
> that with MS VC 2008 that makefile was not created and so when I typed
> *nmake* there was no makefile available. I'll give you more details by
> the weekend.

You need to make sure that cl and nmake are on the path before you run
configure. I guess you can achieve it with so called Visual Studio
Command Line that sets all the variables required to run it from the
command line.

Evgenii

aortizb

unread,
Oct 22, 2008, 2:58:57 AM10/22/08
to matrixprogramming
Yes, they were in the path when I ran configure. Now, they are not in
the path since I set the path in such a way that only MS VC 6.0 is on
it. I remember that I was able to also run configure using MS VC 2005.
As I comment before for MS VC 2008 didn't work, though. I'll set the
path for MS VC 2008 again and describe with more details the errors
displayed. If you want and have time you can test it by yourself using
the MS VC 2008 express edition which is the one I used.

Alejandro.

Evgenii Rudnyi

unread,
Oct 22, 2008, 11:28:13 AM10/22/08
to matrixpr...@googlegroups.com
> Yes, they were in the path when I ran configure. Now, they are not in
> the path since I set the path in such a way that only MS VC 6.0 is on
> it. I remember that I was able to also run configure using MS VC 2005.
> As I comment before for MS VC 2008 didn't work, though. I'll set the
> path for MS VC 2008 again and describe with more details the errors
> displayed.

I would appreciate it. Please not that it could be necessary to type

configure.bat

not configure. This batch file first runs nmake to compile configurator
and then runs it.

> If you want and have time you can test it by yourself using
> the MS VC 2008 express edition which is the one I used.

I am afraid that I am not ready to install MS VC 2008. My installation
of MS VC 2005 is working just fine and I am happy with this now.

Evgenii

aortizb

unread,
Oct 22, 2008, 11:40:04 AM10/22/08
to matrixprogramming

>
> I would appreciate it. Please not that it could be necessary to type
>
> configure.bat
>

Maybe that could be the problem. I typed just configure (without .bat)
in MS VC 6.0, 2005 and 2008. For the first two it was fine but for
2008 I remember the error was something like "...not recognized...".
I'll do it right away and let you know.

Alejandro.

aortizb

unread,
Oct 22, 2008, 11:54:46 AM10/22/08
to matrixprogramming
Evgenii, I did it but the problem is still there. That is the error
displayed:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\ALEJANDRO>cd desktop

C:\Documents and Settings\ALEJANDRO\Desktop>cd taucs_full_fixed

C:\Documents and Settings\ALEJANDRO\Desktop
\taucs_full_fixed>configure.bat

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

cl /Feconfigurator\configurator.exe configurator
\taucs_config.c
NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio
9.0\VC\bin
\cl.EXE"' : return code '0xc0000135'
Stop.
'configurator\configurator' is not recognized as an internal or
external command
,
operable program or batch file.
Could Not Find C:\Documents and Settings\ALEJANDRO\Desktop
\taucs_full_fixed\.las
tconf

C:\Documents and Settings\ALEJANDRO\Desktop\taucs_full_fixed>


Alejandro.

Evgenii Rudnyi

unread,
Oct 22, 2008, 4:57:09 PM10/22/08
to matrixpr...@googlegroups.com
This is what happens by me with MS VC 2005

D:\users\erudnyi\misc\taucs>configure.bat

Microsoft (R) Program Maintenance Utility, Version 8.00.50727.42
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

cl /Feconfigurator\configurator.exe configurator\taucs_config.c
Microsoft (R) 32-Bit C/C++-Optimierungscompiler Version 14.00.50727.762
für 80x8
6
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

taucs_config.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

/out:configurator\configurator.exe
taucs_config.obj
del taucs_config.obj
D:\users\erudnyi\misc\taucs\.lastconf konnte nicht gefunden werden

Well, you see that nmake issues the same command for cl but for some
strange reason it does not work in MS VC 2008. It seems that cl there
does not like

/Feconfigurator\configurator.exe

It seems that they have changed the meaning of the option /Fe in MS VC
2008. It probably makes sense to try to search for it in the manual or
to ask by some MS newsgroup, for example microsoft.public.vc.language

Evgenii

Evgenii Rudnyi

unread,
Oct 28, 2008, 3:34:02 PM10/28/08
to matrixpr...@googlegroups.com
I wanted to install MS Visual C 2008 to troubleshoot the problem but
unfortunately I did not have time and it seems that I will not do it
soon either. I am sorry.

What can be done to troubleshoot it is to try manually

cl configurator\taucs_config.c

I guess this should work. It could be safer

cd configure
cl taucs_config.c

Then it is possible just to run exe manually and it should create all
the make files.

Well, if the above works, then it is possible to find what MS MS Visual
C 2008 does not like in the original command by trial and error.

aortizb

unread,
Dec 6, 2008, 1:40:10 PM12/6/08
to matrixprogramming
Hi Evgenii,

I had a terrible quarter so I couldn't go over this on time.
Unfortunaltely, I am travelling to see my family and I will come back
the first week of January. I'll try to dig in MVC 2008 when I come
back. For now, TAUCS is working very well in all the MVC version until
2005.

Thanks,
Alejandro.
> > Alejandro.- Hide quoted text -

Evgenii Rudnyi

unread,
Dec 7, 2008, 3:42:26 AM12/7/08
to matrixpr...@googlegroups.com
Hi Alejandro,

The next year I will change my notebook and then probably install MVC
2008. I do not like to change compilers too often but on the other hand
we have to follow the trend.

I have actually started with MVC only this year, before I have used gcc.
The first major surprise was the use of manifests. My application is a
command line tool and when I have seen that it does not work on another
computer, well, it'd better I do not write what I thought at that
moment. The second major surprise was that even with -O2 MS VC++ uses
safe iterators and the standard C++ library is incredible slow in this
case. They are nuts.

Let us see what challenges MS VC 2008 will bring to us.

Evgenii

Reply all
Reply to author
Forward
0 new messages