source: project/release/4/blas/trunk/blas.setup @ 26338

Last change on this file since 26338 was 26338, checked in by Ivan Raikov, 9 years ago

blas: using bind instead of easyffi

File size: 1.1 KB
Line 
1;; -*- Hen -*-
2
3(define (dynld-name fn)         
4  (make-pathname #f fn ##sys#load-dynamic-extension))   
5
6(define (blas-try-compile header ldflags)
7  (and (try-compile
8        (string-append "#include " header "\n"
9                       "int main() { cblas_ddot(0, NULL, 0, NULL, 0); return 0; }\n")
10        ldflags: ldflags)
11       ldflags ))
12
13(define-syntax blas-test
14  (syntax-rules ()
15    ((_ (flags ...))
16     (condition-case (blas-try-compile flags ...)
17                     (t ()    #f)))))
18
19(define ld-options
20  (or (blas-test  ("<cblas.h>" "-lblas -lm"))
21      (blas-test  ("<cblas.h>" "-lcblas -lm"))
22      (blas-test  ("<gsl/gsl_cblas.h>" "-lgsl -lgslcblas -lm"))
23      (blas-test  ("<atlas/cblas.h>" "-lcblas -lm"))
24      (blas-test  ("<lapack/cblas.h>" "-lcblas -lm"))
25      (blas-test  ("<Accelerate/Accelerate.h>" "-framework Accelerate"))
26      (error "unable to figure out location of BLAS library")))
27
28(compile -O3 -d0 -s blas.scm -j blas -L "\"" ,ld-options "\"" )
29(compile -O2 -d0 -s blas.import.scm)
30
31(install-extension
32 'blas
33 `(,(dynld-name "blas") ,(dynld-name "blas.import") )
34 '((version 4.0)
35   ))
36
Note: See TracBrowser for help on using the repository browser.