Hi,
I am using Sparselib++ in this C++ program.
#include <iostream>
#include <cstdlib>
#include "comprow_double.h"
using namespace std;
int main() {
cout << "Sparse example" << endl; // prints Sparse example
double val[12]={1,2,3,4,5,6,7,8,9,10,11,12};
int colind[12]={0,1,4,0,1,2,1,2,4,3,0,4};
int rowptr[6]={0,3,6,9,10,12};
CompRow_Mat_double R (5,5,12,val,rowptr,colind);
return 0;
}
Since I use Eclipse, I have added the -D preprocessor statement in the Project->Properties->C/C=++ Build->Settings->Preprocessor. The -D statement added here is
COMPLEX=std::complex<double>
which was given in the Sparselib++ makefile.def as
# g++ v. 2.7.0
#
CCC = g++
CC = gcc
CCCFLAGS = -DMV_VECTOR_BOUNDS_CHECK -g -Wall -pedantic\
'-DCOMPLEX=std::complex<double>'
CCCFLAGS = -g -Wall -pedantic -O3 '-DCOMPLEX=std::complex<double>'
LDFLAGS = $(SPARSELIB_DIR)/lib/libsparse.a $(SPARSELIB_DIR)/lib/libspblas.a \
$(SPARSELIB_DIR)/lib/libmv.a -lm
Now the build error I get is as follows saying " /bin/sh: double: No such file or directory'"
make -k all
Building file: ../src/sparseCpp.cpp
/bin/sh: double: No such file or directory
Invoking: GCC C++ Compiler
g++ -DCOMPLEX=std::complex<double> -I/home/s/Download/SparseLib++/1.7/include -I/home/s/Download/SparseLib++/1.7/src -I/home/s/Download/SparseLib++/1.7/mv/include -I/home/s/Download/SparseLib++/1.7/mv/src -O0 -g3 -p -Wall -c -fmessage-length=0 -v -MMD -MP -MF"src/sparseCpp.d" -MT"src/sparseCpp.d" -o"src/sparseCpp.o" "../src/sparseCpp.cpp"
make: *** [src/sparseCpp.o] Error 1
make: Target `all' not remade because of errors.
There could be something I need to set up in Eclipse before compiling. I also checked using the 'which sh' command in Linux and get '/bin/sh' although I am not quite sure what is missing. Please help.