utils/debug.h: multiple definitions of Failure::_errorStream

137 views
Skip to first unread message

jack1977

unread,
Oct 17, 2011, 4:47:32 AM10/17/11
to ffpack-devel
Hello,


when including "fflas-ffpack/field/modular-balanced.h" in several
files,
a multiple definition error for 'Failure::_errorStream' (defined in
debug.h) occurs.

To overcome this error it is seems to be sufficient to put
the 'Failure' class and the 'std::ostream *Failure::_errorStream;'
definition into an anonymous namespace:

namespace FFPACK
{
namespace
{

class Failure {..};

std::ostream *Failure::_errorStream;

};// anonymous namespace
}; //namespace FFPACK



Best,


Jack

Brice Boyer

unread,
Oct 17, 2011, 5:40:28 AM10/17/11
to ffpack...@googlegroups.com
hello,

yes indeed we seem to be missing a debug.C somewhere !

thank you !

2011/10/17 jack1977 <kro...@uni-math.gwdg.de>

--
You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
To post to this group, send email to ffpack...@googlegroups.com.
To unsubscribe from this group, send email to ffpack-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ffpack-devel?hl=en.




--
                                                      Brice Boyer.
____________________________________________________________
brice...@imag.fr                                     Tél. +33(0)4 76 51 45 61
Université Joseph Fourier, Grenoble I.
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
LJK - UJF  BP53 38041 Grenoble cedex FRANCE
http://ljk.imag.fr/membres/Brice.Boyer
____________________________________________________________

"Jakob Kröker"

unread,
Oct 17, 2011, 5:46:43 AM10/17/11
to ffpack...@googlegroups.com
Hello,


> yes indeed we seem to be missing a debug.C somewhere !

I am not sure if that is the case:

one of the ideas behind fflas-ffpack was
that no compilation is required at all,
so adding 'debug.C' would break up that design philosophy.

Best,


Jack

jack1977

unread,
Nov 18, 2013, 4:58:54 AM11/18/13
to ffpack...@googlegroups.com

when including "fflas-ffpack/field/modular-balanced.h" in several
files,
 a multiple definition error for 'Failure::_errorStream'  (defined in
debug.h)  occurs.



 Hello,

the issue with multiple definitions of "Failure::_errorStream" seems not fixed
neither in the newest release nor in the recent development version.

Could someone look at it?


Thanks,


Jack

Brice Boyer

unread,
Nov 18, 2013, 11:42:50 AM11/18/13
to ffpack...@googlegroups.com
I guess I totally forgot about that. Can you send me a minimal set of files reproducing the error and I'll work on this ?


2013/11/18 jack1977 <kro...@uni-math.gwdg.de>

--
You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ffpack-devel...@googlegroups.com.

To post to this group, send email to ffpack...@googlegroups.com.



--
Brice Boyer                   http://www4.ncsu.edu/~bbboyer/         
Mathematics department, NCSU. (+1)919-515-7241

jack1977

unread,
Nov 19, 2013, 10:04:44 AM11/19/13
to ffpack...@googlegroups.com
Can you send me a minimal set of files reproducing the error and I'll work on this ? 
 
-- Brice Boyer

main.cpp:
#include <fflas-ffpack/ffpack/ffpack.h>
int main() {  return 0;  }
 
f1.cpp:
using namespace std;
#include <fflas-ffpack/ffpack/ffpack.h>

Compiling with e.g.
g++ -c f1.cpp; g++  main.cpp f1.o
will result in multiple definition errors

I also attached the files.


Jack

main.cpp
f1.cpp

Brice Boyer

unread,
Nov 19, 2013, 12:58:57 PM11/19/13
to ffpack...@googlegroups.com
well, for the moment the simple fix is  g++  main.cpp f1.o -Wl,-zmuldefs (but it does not fix the problem)



2013/11/19 jack1977 <kro...@uni-math.gwdg.de>

--
You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ffpack-devel...@googlegroups.com.
To post to this group, send email to ffpack...@googlegroups.com.
Visit this group at http://groups.google.com/group/ffpack-devel.
For more options, visit https://groups.google.com/groups/opt_out.

jack1977

unread,
Nov 19, 2013, 1:34:00 PM11/19/13
to ffpack...@googlegroups.com
well, for the moment the simple fix is  g++  main.cpp f1.o -Wl,-zmuldefs (but it does not fix the problem)
 
 Brice Boyer 


Hi,

we have a fix and a patch  for it ; I just wanted to remind fflas-ffpack about this issue.


Best,


Jack

Ali Shirvani

unread,
Sep 23, 2014, 6:49:56 AM9/23/14
to ffpack...@googlegroups.com
Hi,

Would you please provide your patch in this thread?

Brice Boyer

unread,
Sep 23, 2014, 10:37:32 AM9/23/14
to ffpack...@googlegroups.com
Hello,

well it seems that noone really wants to do a proper libflasffpack. There are many more (non template) functions that are multiply defined now. The quickfix consists in adding -Wl,-z,muldefs to your flags.

Best,

--
You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ffpack-devel...@googlegroups.com.
To post to this group, send email to ffpack...@googlegroups.com.
Visit this group at http://groups.google.com/group/ffpack-devel.
For more options, visit https://groups.google.com/d/optout.



--
Brice Boyer               http://www-polsys.lip6.fr/~boyer/
Équipe POLSYS, LIP6 UPMC. tel: +33(0)1 44 27 88 76

jack1977

unread,
Nov 18, 2014, 11:37:39 AM11/18/14
to ffpack...@googlegroups.com


Am Dienstag, 23. September 2014 12:49:56 UTC+2 schrieb Ali Shirvani:
Hi,

Would you please provide your patch in this thread?


if for some reasons you don't want or can't use the quickfix by Brice,
my hack to avoid the multiple definition of

Failure::_errorStream

was to introduce anonymous namesaces, see the attached patch
 (put class Failures and the Failure::_errorStream definition into the same anonymous namespace)

and for other multiply defined functions add the inline keyword if appropriate.

Jakob




 
patch.debug.h
Reply all
Reply to author
Forward
0 new messages