From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22748 invoked by alias); 15 Aug 2008 11:08:01 -0000 Received: (qmail 22693 invoked by uid 22791); 15 Aug 2008 11:08:00 -0000 X-Spam-Check-By: sourceware.org Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.187) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Aug 2008 11:05:17 +0000 Received: from X61s (smallrivers1.epfl.ch [128.179.67.51]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1KTx732GPr-0006SG; Fri, 15 Aug 2008 13:04:57 +0200 From: "JP de Vooght" To: Subject: use of fabsl and logbl builtins Date: Fri, 15 Aug 2008 14:25:00 -0000 Message-ID: <003001c8fec6$b217c0e0$164742a0$@de> 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/msg00149.txt.bz2 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