[CLN-list] CLN vs Cygwin [Was: cln compile error]

cbouchrd at uiuc.edu cbouchrd at uiuc.edu
Fri Oct 19 05:07:06 CEST 2007


Made suggested changes.  Compiler appeared to make it past this point and crash in new spot.  On-screen indications point to problem with generation of CLN documentation.

I've attached compile.log.gz.

Thanks for help to date.

Regards,
Chris

---- Original message ----
>Date: Thu, 18 Oct 2007 15:21:59 +0400
>From: Alexei Sheplyakov <varg at theor.jinr.ru>  
>Subject: Re: [CLN-list] CLN vs Cygwin [Was: cln compile error]  
>To: CLN discussion list <cln-list at ginac.de>
>
>Hello!
>
>On Tue, Oct 16, 2007 at 08:05:43PM -0500, cbouchrd at uiuc.edu wrote:
>
>> >Do you have the same problem when compiling static library only? i.e.
>> >make clean &&./configure --disable-shared && make
>> 
>> Yes.  I've now compiled both ways and the on screen indications are identical.
>
>Could you please try this patch:
>
>[PATCH] zerop(cl_I& const): be more ISO C++ friendly.
>
>CLN's MAYBE_INLINE violates ISO C++, which demands (in 7.1.2.4)
>"If a function with external linkage is declared inline in one translation
>unit, it shall be declared inline in all translation units in which it
>appears; no diagnostic is required."
>This results in link errors on non-ELF platforms (MinGW, Cygwin, Darwin).
>In particular, cl_I_ring.cc contains the following code:
>extern bool zerop (const cl_I& x); // from <cln/integer.h>
>inline bool zerop (const cl_I& x) // from cl_I.h
>{
>       return x.word == cl_combine(cl_FN_tag,0);
>}
>
>static cl_number_ring_ops<cl_I> I_ops = {
>       cl_I_p,
>       equal,
>       zerop, // ...
>
>Since the address of zerop is taken here, the compiler is forced to emit
>zerop function out-of-line. This results in duplicate symbols (which is
>an error).
>
>---
> src/integer/ring/cl_I_ring.cc |    5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
>diff --git a/src/integer/ring/cl_I_ring.cc b/src/integer/ring/cl_I_ring.cc
>index 416738a..fd96c12 100644
>--- a/src/integer/ring/cl_I_ring.cc
>+++ b/src/integer/ring/cl_I_ring.cc
>@@ -13,7 +13,9 @@ CL_PROVIDE(cl_I_ring)
> 
> #include "cln/integer.h"
> #include "cln/integer_io.h"
>+#define zerop inline_zerop
> #include "cl_I.h"
>+#undef zerop
> 
> namespace cln {
> 
>@@ -34,10 +36,11 @@ static const _cl_ring_element I_zero (cl_heap_ring* R)
> 	return _cl_ring_element(R, (cl_I)0);
> }
> 
>+static bool I_zerop (cl_heap_ring* R, const _cl_ring_element& x) __attribute__((flatten));
> static bool I_zerop (cl_heap_ring* R, const _cl_ring_element& x)
> {
> 	unused R;
>-	return zerop(The(cl_I)(x));
>+	return inline_zerop(The(cl_I)(x));
> }
> 
> static const _cl_ring_element I_plus (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y)
>-- 
>1.5.3.2
>
>Best regards,
>	Alexei
>
>-- 
>All science is either physics or stamp collecting.
>
>________________
>signature.asc (1k bytes)
>________________
>_______________________________________________
>CLN-list mailing list
>CLN-list at ginac.de
>https://www.cebix.net/mailman/listinfo/cln-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile.log.gz
Type: application/x-gzip-compressed
Size: 1070 bytes
Desc: not available
Url : http://www.cebix.net/pipermail/cln-list/attachments/20071019/667753a8/compile.log.bin


More information about the CLN-list mailing list