compiling taucs problem (Re: solving Ax=b with sparse A)



Evgenii Rudnyi wrote:
I am trying to solve Ax=b problem, where A is a sparse matrix. The
matrix A is saved in compressed column format.

If your matrix is positive definite, I would recommend you TAUCS

http://www.tau.ac.il/~stoledo/taucs/

Best wishes,

Evgenii


I am trying to use taucs with my own source code to solve a sparse
system of equations, Ax=b (as I have mentioned earlier in this thread).
But I am not able to get the taucs library to compile.

So I instead made a little stand alone program just see if taucs by
itself works for me. Here is my C++ source file:
------------------------------------------------------------------
$> cat spmat.cc
#include <taucs.h>

#ifdef __cplusplus
extern "C" {
#endif
extern taucs_ccs_matrix * taucs_ccs_create (int m, int n, int nnz,
int flags);
extern void taucs_css_free (taucs_ccs_matrix* );
#ifdef __cplusplus
}
#endif // __cplusplus

int main(){
int C,R,k;
C=20;
R=20;
k=4;
taucs_ccs_matrix *taucAsigmaIMat;
taucAsigmaIMat = taucs_ccs_create(C, R, (k+1)*C,
TAUCS_DOUBLE|TAUCS_SYMMETRIC);

//cleanup
taucs_ccs_free(taucAsigmaIMat);
return 0;
}

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

Here is the command I am using to compile this file (I am using Taucs
header files and the various libraries that come with it directly):
$> g++ -I$HOME/tmp/taucs/build/linux -I$HOME/tmp/taucs/src
-L$HOME/tmp/taucs/lib/linux -ltaucs -L$HOME/tmp/taucs/external/lib/linux
-latlas -lcblas -lf77blas -llapack -lmetis
$HOME/tmp/taucs/external/lib/linux/blas_aux.o spmat.cc -o spmat

(that is one single long line above). As you can see, I just extracted
taucs source code in ~/tmp/taucs and then compiled it in that directory
and am using the resulting libraries directly from there.


And the following is the compiler output I get:
$> g++ -I$HOME/tmp/taucs/build/linux -I$HOME/tmp/taucs/src
-L$HOME/tmp/taucs/lib/linux -ltaucs -L$HOME/tmp/taucs/external/lib/linux
-latlas -lcblas -lf77blas -llapack -lmetis
$HOME/tmp/taucs/external/lib/linux/blas_aux.o spmat.cc -o spmat
In file included from /usr/include/c++/4.1.3/backward/complex.h:31,
from /home/hs/tmp/taucs/src/taucs.h:132,
from spmat.cc:1:
/usr/include/c++/4.1.3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or <iostream> instead of
the deprecated header <iostream.h>. To disable this warning use
-Wno-deprecated.
/home/hs/tmp/taucs/src/taucs_private.h:45: error: previous declaration
of ‘taucs_ccs_matrix* taucs_ccs_create(int, int, int, int)’ with ‘C++’
linkage
spmat.cc:6: error: conflicts with new declaration with ‘C’ linkage


So, what am I doing wrong here?

thanks,
->HS
.



Relevant Pages

  • Re: Offline Tutorial
    ... program which won't compile under C++ compiler? ... int main ... "namespace" was used as a struct tag in a header, ... and referring to RXP_NAMESPACE throughout the header. ...
    (comp.lang.c)
  • Re: Utility to ensure appropriate headers were included
    ... failed to compile. ... This wasn't a problem on most systems because some of the other header ... header file that's included directly in the source file? ... int myputchar ...
    (comp.lang.c)