Summary

statistics: doesn't build on some platforms due to hardcoded compiler flags

Metadata

Attachments

Description

When I try to compile the statistics egg on my NetBSD box with Chicken built in my homedir, I get this error:

 $ ~/chicken-test/bin/chicken-install
 retrieving ...
 checking platform for `statistics' ...
 checking dependencies for `statistics' ...
 mapped (srfi-1 srfi-69 extras foreign) to ()
 install order:
 ("statistics")
 installing statistics: ...
 changing current directory to .
   /home/sjamaan/chicken-test/bin/csi -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"statistics\" \"\"))" statistics.setup
   /home/sjamaan/chicken-test/bin/csc -feature compiling-extension -setup-mode    -s -O3 -d1 statistics.scm -j statistics -lgsl -lgslcblas
 
 Warning: in toplevel procedure `statistics#mcnemars-test':
   (statistics.scm:1038) in procedure call to `numbers#*', expected argument #2 of type `(or fixnum float (struct bignum) (struct compnum) (struct ratnum))', but was given an argument of type `undefined'
 
 Warning: in local procedure `loop',
   in local procedure `g972',
   in toplevel procedure `statistics#wilcoxon-signed-rank-test':
   (statistics.scm:1130) in procedure call to `list-ref', expected argument #1 of type `list', but was given an argument of type `(or fixnum float (struct bignum) (struct compnum) (struct ratnum))'
 Warning: in toplevel procedure `statistics#wilcoxon-signed-rank-test':
   (statistics.scm:1151) in procedure call to `var-r11108', expected a value of type `(procedure () *)', but was given a value of type `(or fixnum float (struct bignum) (struct compnum) (struct ratnum))'
 statistics.c:14:30: error: gsl/gsl_sf_erf.h: No such file or directory
 statistics.c:15:32: error: gsl/gsl_sf_gamma.h: No such file or directory
 statistics.c: In function 'stub115':
 statistics.c:294: warning: implicit declaration of function 'gsl_sf_lngamma'
 statistics.c: In function 'stub102':
 statistics.c:303: warning: implicit declaration of function 'gsl_sf_gamma_inc_P'
 statistics.c: In function 'stub90':
 statistics.c:313: warning: implicit declaration of function 'gsl_sf_beta_inc'
 
 Error: shell command terminated with non-zero exit status 256: gcc statistics.c -o statistics.o -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -g -Wall -Wno-unused -fPIC -DPIC -DC_SHARED -I"/home/sjamaan/chicken-test/include/chicken"
 
 Error: shell command failed with nonzero exit status 256:
 
   /home/sjamaan/chicken-test/bin/csc -feature compiling-extension -setup-mode    -s -O3 -d1 statistics.scm -j statistics -lgsl -lgslcblas
 
 
 Error: shell command terminated with nonzero exit code
 17920
 "/home/sjamaan/chicken-test/bin/csi -bnq -setup-mode -e \"(require-library setup...

More about those warnings later, in another ticket. The setup-file assumes just passing -lgsl -lgslcblas is enough to pick up on the library, but when it is installed in a nonstandard location (or if, like me, you're on a platform that doesn't automatically add these locations to the include & library search path) this will break.

The fix is simple: just call the gsl-config program that's shipped with GSL to determine the correct flags.

Changes and comments

[2012-05-13 15:50:01 UTC] sjamaan attached config-detection.patch (description=Detect the flags to use for building with GSL)

[2012-05-13 16:29:57 UTC] sjamaan wrote:

For more information about these warnings, see #837. See also #836 for some errors in the tests.

[2015-09-21 15:06:02 UTC] sjamaan changed status from new to closed

[2015-09-21 15:06:02 UTC] sjamaan set resolution to wontfix

[2015-09-21 15:06:02 UTC] sjamaan wrote:

Unmaintained egg