[bugs][ bogofilter-Bugs-833645 ] build fails because of gsl/gsl_math.h inlines
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: SourceForge.net <no...@so...> - 2003-10-31 14:09:33
|
Bugs item #833645, was opened at 2003-10-31 15:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=499997&aid=833645&group_id=62265 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Gert-Jan Vons (gjvons) Assigned to: Nobody/Anonymous (nobody) Summary: build fails because of gsl/gsl_math.h inlines Initial Comment: When compiling bogofilter 0.15.7 or 0.15.8 under FreeBSD 4.7 (gcc 2.95.4, no GSL installed) or under Solaris7 (gcc 3.2, no GSL installed), the bogofilter build fails, and in both cases for the same reason. Under FreebSD: gcc -DBOGOFILTER -I/usr/local/include/db4 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wnested-externs -ggdb -fno-common -Wchar-subscripts -Wcomment -Wimplicit -Wreturn-type -Wpointer-arith -L/usr/local/lib -o bogofilter bogofilter.o main.o method.o graham.o robinson.o fisher.o libbogofilter.a libbf_gsl.a -lm -ldb4 libbf_gsl.a(libbf_gsl_a-gamma.o): In function `gammastar_ser': /tmp/x/bogofilter-0.15.8/src/../gsl/cdf/../specfunc/gamma.c:976: undefined reference to `GSL_MAX_DBL' libbf_gsl.a(libbf_gsl_a-exp.o): In function `gsl_sf_exp_err_e': /tmp/x/bogofilter-0.15.8/src/../gsl/specfunc/exp.c:547: undefined reference to `GSL_MAX_DBL' libbf_gsl.a(libbf_gsl_a-trig.o): In function `gsl_sf_hypot_e': /tmp/x/bogofilter-0.15.8/src/../gsl/specfunc/trig.c:324: undefined reference to`GSL_MIN_DBL' /tmp/x/bogofilter-0.15.8/src/../gsl/specfunc/trig.c:325: undefined reference to`GSL_MAX_DBL' libbf_gsl.a(libbf_gsl_a-elementary.o): In function `gsl_sf_multiply_e': /tmp/x/bogofilter-0.15.8/src/../gsl/specfunc/elementary.c:52: undefined reference to `GSL_MIN_DBL' /tmp/x/bogofilter-0.15.8/src/../gsl/specfunc/elementary.c:53: undefined reference to `GSL_MAX_DBL' Under Solaris: gcc -DBOGOFILTER -I/usr/local/BerkeleyDB.3.3/include -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -ggdb -fno-common -Wchar-subscripts -Wcomment -Wimplicit -Wsequence-point -Wreturn-type -Wfloat-equal -Wpointer-arith -Wno-system-headers -L/usr/local/BerkeleyDB.3.3/lib/ -o bogofilter bogofilter.o main.o method.o graham.o robinson.o fisher.o libbogofilter.a strlcpy.o strlcat.o /usr/local/BerkeleyDB.3.3/lib//libdb.so -R/usr/local/BerkeleyDB.3.3/lib/ libbf_gsl.a -lm Undefined first referenced symbol in file GSL_MAX_DBL libbf_gsl.a(libbf_gsl_a-gamma.o) GSL_MIN_DBL libbf_gsl.a(libbf_gsl_a-trig.o) ld: fatal: Symbol referencing errors. No output written to bogofilter collect2: ld returned 1 exit status This seems to be a problem related to the use of inline code in gsl/gsl_math.h. configure checks for inline support, adds "#define HAVE_INLINE 1" to src/config.h, and then the build fails. If I remove this define from config.h, everything compiles ok. A simplified example based on gsl/gsl_math.h: -----8<----- #define GSL_MAX(a,b) ((a) > (b) ? (a) : (b)) #if HAVE_INLINE extern inline double GSL_MAX_DBL (double a, double b); extern inline double GSL_MAX_DBL (double a, double b) { return GSL_MAX (a, b); } #else #define GSL_MAX_DBL(a,b) GSL_MAX(a,b) #endif /* HAVE_INLINE */ int main() { double a,b; double c = GSL_MAX_DBL(a,b); return 0; } -----8<----- Compiling with inline: freebsd$ gcc -DHAVE_INLINE foo.c -o foo /tmp/ccjP0chh.o: In function `main': /tmp/ccjP0chh.o(.text+0x19): undefined reference to `GSL_MAX_DBL' solaris$ gcc -DHAVE_INLINE foo.c -o foo Undefined first referenced symbol in file GSL_MAX_DBL /tmp/ccP54RB7.o ld: fatal: Symbol referencing errors. No output written to foo Compiling without inline works fine in both cases. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=499997&aid=833645&group_id=62265 |