source: project/release/4/atlas-lapack/trunk/atlas-lapack.setup @ 26341

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

atlas-lapack: using bind instead of easyffi

File size: 1.4 KB
Line 
1;; -*- Hen -*-
2
3(define (dynld-name fn)         
4  (make-pathname #f fn ##sys#load-dynamic-extension))   
5
6
7(define (atlas-try-compile header ldflags)
8  (and (try-compile
9        (string-append "#include <stdlib.h>\n"
10                       "#include " header "\n"
11                       "int main() { clapack_sgetrf(0, 0, 0, NULL, 0, NULL) ; return 0; }\n")
12        ldflags: ldflags)
13       ldflags ))
14
15
16(define-syntax atlas-test
17  (syntax-rules ()
18    ((_ (flags ...))
19     (condition-case (atlas-try-compile flags ...)
20                     (t ()    #f)))))
21
22(define ld-options
23  (or (atlas-test ("<atlas/clapack.h>"   " -llapack_atlas -latlas -lm"))
24      (atlas-test ("<clapack.h>"         " -llapack_atlas -latlas -lm"))
25   
26      (atlas-test ("<atlas/clapack.h>"   " -latlas -lm"))
27      (atlas-test ("<clapack.h>"         " -latlas -lm"))
28   
29      (atlas-test ("<atlas/clapack.h>"   " -llapack_atlas -latlas -lm -lg2c"))
30      (atlas-test ("<clapack.h>"         " -llapack_atlas -latlas -lm -lg2c"))
31   
32      (atlas-test ("<atlas/clapack.h>"   " -latlas -lm -lg2c"))
33      (atlas-test ("<clapack.h>"         " -latlas -lm -lg2c"))
34
35      (error "unable to figure out location of ATLAS library")
36      ))
37
38
39(compile -O3 -d0 -s atlas-lapack.scm -j atlas-lapack -L "\"" ,ld-options "\"" )
40(compile -O2 -d0 -s atlas-lapack.import.scm)
41
42(install-extension
43 'atlas-lapack
44 `(,(dynld-name "atlas-lapack") ,(dynld-name "atlas-lapack.import") )
45 `((version 3.0)
46   ))
47
Note: See TracBrowser for help on using the repository browser.