From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6384 invoked by alias); 16 Aug 2008 11:38:35 -0000 Received: (qmail 6376 invoked by uid 22791); 16 Aug 2008 11:38:34 -0000 X-Spam-Check-By: sourceware.org Received: from ws6-6.us4.outblaze.com (HELO ws6-6.us4.outblaze.com) (205.158.62.215) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 16 Aug 2008 11:37:45 +0000 Received: (qmail 25407 invoked from network); 16 Aug 2008 11:37:43 -0000 Received: from unknown (HELO X61s) (jean-paul.devooght@smallrivers.com@83.76.53.49) by ws6-6.us4.outblaze.com with SMTP; 16 Aug 2008 11:37:40 -0000 From: "Jean-Paul de Vooght" To: References: <003001c8fec6$b217c0e0$164742a0$@de> In-Reply-To: <003001c8fec6$b217c0e0$164742a0$@de> Subject: RE: use of fabsl and logbl builtins Date: Sat, 16 Aug 2008 11:43:00 -0000 Message-ID: <000101c8ff94$6d943010$48bc9030$@devooght@smallrivers.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-gb Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00154.txt.bz2 Just to close this post, I eventually figured out that gcc built-ins are really a library matter and that cygwin does not provide an implementation for the ones below. MinGW does. Eventually I found my salvation through the use of GNU MP BugNum library which has been ported to cygwin. - JP > -----Original Message----- > From: JP de Vooght [mailto:jp@vooght.de] > Sent: 15 August 2008 13:05 > To: gcc-help@gcc.gnu.org > Subject: use of fabsl and logbl builtins > > Hello, > I recently discovered the world of GNU R and its optional packages. > While > trying to install igraph, gcc 3.4.4 on cygwin generated the following > output: > > g++ -I/usr/local/lib/R/include -I/usr/local/include -DUSING_R -g - > O2 -c > bliss.cc -o bliss.o > In file included from bliss_graph.hh:32, > from bliss.cc:19: > bliss_bignum.hh: In member function `int > igraph::BigNum::tostring(char**)': > bliss_bignum.hh:76: error: `fabsl' undeclared (first use this function) > bliss_bignum.hh:76: error: (Each undeclared identifier is reported only > once > for each function it appears in.) > bliss_bignum.hh:76: error: `logbl' undeclared (first use this function) > make: *** [bliss.o] Error 1 > chmod: cannot access `/usr/local/lib/R/library/igraph/libs/*': No such > file > or directory > ERROR: compilation failed for package 'igraph' > ** Removing '/usr/local/lib/R/library/igraph' > > The error is related to the use of two built-ins fabsl and logbl. > Replacing > these functions with their __builtin_ homologues just defers the > problem to > ld which fails with undefined _logbl. > > Any suggestion on how to work around this? The header file imports > math.h > and uses fabsl and logbl as follows: > > > 67 class BigNum > 68 { > 69 long double v; > 70 public: > 71 BigNum(): v(0.0) {} > 72 void assign(const int n) {v = (long double)n; } > 73 void multiply(const int n) {v *= (long double)n; } > 74 int print(FILE *fp) {return fprintf(fp, "%Lg", v); } > 75 int tostring(char **str) { > 76 int size=static_cast( (logbl(fabsl(v))/log(10.0))+4 ); > 77 *str=igraph_Calloc(size, char ); > 78 if (! *str) { > 79 IGRAPH_ERROR("Cannot convert big number to string", > IGRAPH_ENOMEM); > 80 } > 81 snprintf(*str, size, "%.0Lf", v); > 82 return 0; > 83 } > 84 }; > > > TIA > - JP > > > > >