compile problems

30 views
Skip to first unread message

jack

unread,
Apr 20, 2012, 11:54:13 AM4/20/12
to linbox-use
Dear Linbox-team,


I have two different compile problems:

the first one is related to a nameclash with std::rank
I'm resolving this by changing 'rank' to LinBox::rank in 'rank.h'
Even if LinBox never(?) uses std namespace this could happen in other
places
(appears at least in 'fflas-ffpack/utils/args-parser.h')

the second problem is an undefined function error:
appears when trying to compile following small example with linbox
1-2-2 :

Any suggestions?

Jakob

///////////////////////////////////////////////
#include <linbox/linbox-config.h>
#include <linbox/field/Givaro/givaro-gfq.h>
#include <linbox/blackbox/sparse.h>
#include <linbox/blackbox/matrix-blackbox.h>
#include <linbox/matrix/blas-matrix.h>
#include <linbox/solutions/rank.h>


template <class FieldType>
inline void testDeterminant()
{
FieldType gfqField(3,4);

int rows_m = 4; int cols_m = 4;

//LinBox::BlasMatrix<FieldType> mat( gfqField, rows_m, cols_m );
LinBox::SparseMatrix<FieldType, typename
Vector<FieldType>::SparseSeq > mat( gfqField, rows_m, cols_m );
for ( int currRow=0; currRow < rows_m; currRow++ )
for ( int currCol =0; currCol < cols_m; currCol++ )
{
mat.setEntry(currRow,currCol, ((int)rand()) %
gfqField.characteristic() );
}
unsigned long rnk = 0;
rnk= LinBox::rank(rnk,mat);
std::cout << " rank = " << rnk << std::endl;
}

int main(int argc, char* argv[])
{
testDeterminant<LinBox::GivaroGfq>();
return 0;
}
///////////////////////////////////////////////


/tmp/include/linbox/solutions/rank.h:61: warning: inline function
‘long unsigned int& LinBox::rank(long unsigned int&, const Blackbox&,
const DomainCategory&, const Method&) [with Blackbox =
LinBox::SparseMatrix<LinBox::GivaroGfq, std::vector<std::pair<long
unsigned int, int>, std::allocator<std::pair<long unsigned int, int> >
> >, Method = LinBox::HybridSpecifier, DomainCategory =
LinBox::RingCategories::ModularTag]’ used but never defined
/tmp/ccHuz35F.o: In function `unsigned long&
LinBox::rank<LinBox::SparseMatrix<LinBox::GivaroGfq,
std::vector<std::pair<unsigned long, int>,
std::allocator<std::pair<unsigned long, int> > > > >(unsigned long&,
LinBox::SparseMatrix<LinBox::GivaroGfq, std::vector<std::pair<unsigned
long, int>, std::allocator<std::pair<unsigned long, int> > > >
const&)':
gfqTest.cpp:
(.text._ZN6LinBox4rankINS_12SparseMatrixINS_9GivaroGfqESt6vectorISt4pairImiESaIS5_EEEEEERmS9_RKT_[unsigned
long& LinBox::rank<LinBox::SparseMatrix<LinBox::GivaroGfq,
std::vector<std::pair<unsigned long, int>,
std::allocator<std::pair<unsigned long, int> > > > >(unsigned long&,
LinBox::SparseMatrix<LinBox::GivaroGfq, std::vector<std::pair<unsigned
long, int>, std::allocator<std::pair<unsigned long, int> > > > const&)]
+0x48): undefined reference to `unsigned long&
LinBox::rank<LinBox::SparseMatrix<LinBox::GivaroGfq,
std::vector<std::pair<unsigned long, int>,
std::allocator<std::pair<unsigned long, int> > > >,
LinBox::HybridSpecifier, LinBox::RingCategories::ModularTag>(unsigned
long&, LinBox::SparseMatrix<LinBox::GivaroGfq,
std::vector<std::pair<unsigned long, int>,
std::allocator<std::pair<unsigned long, int> > > > const&,
LinBox::RingCategories::ModularTag const&, LinBox::HybridSpecifier
const&)'

Jean-Guillaume Dumas

unread,
Apr 23, 2012, 5:50:51 AM4/23/12
to linbo...@googlegroups.com, jack
jack wrote, on 20/04/2012 17:54:
> Dear Linbox-team,
>
>
> I have two different compile problems:
>
> the first one is related to a nameclash with std::rank
> I'm resolving this by changing 'rank' to LinBox::rank in 'rank.h'
> Even if LinBox never(?) uses std namespace this could happen in other
> places
> (appears at least in 'fflas-ffpack/utils/args-parser.h')
OK, thanks for pointing out. I have removed these dependencies to std

> the second problem is an undefined function error:
> appears when trying to compile following small example with linbox
> 1-2-2 :
From the message I guess the second template arg of the matrix is not
correct (also message from my compiler).
When I replace by "typename LinBox::Vector<FieldType>::SparseSeq", i.e.,
when adding "LinBox::" to the Vector, everything is fine.
Best,

--
Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guill...@imag.fr T�l.: +33 476 514 866
Universit� Joseph Fourier, Grenoble I. Fax.: +33 476 631 263
Laboratoire Jean Kuntzmann, Math�matiques Appliqu�es et Informatique
51, avenue des Math�matiques. LJK/IMAG - BP53. 38041 Grenoble FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________

kroeker

unread,
Apr 23, 2012, 11:05:29 AM4/23/12
to linbo...@googlegroups.com, Jean-Guillaume Dumas
Hello,

I found out the reason for my compiling problems:

the example does not compile when using '-std=c++0x' or similar flags.
To get it compile with '-std=c++0x' it will probably require a detailed
analysis.


Best,


Jakob

Reply all
Reply to author
Forward
0 new messages