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

Last change on this file since 27408 was 27408, checked in by Ivan Raikov, 7 years ago

atlas-lapack: extended setup script to try to link with libsatlas.dylib (useful under MacPorts?)

File size: 1.5 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      (atlas-test ("<atlas/clapack.h>"   " -lsatlas -lm"))
36      (atlas-test ("<clapack.h>"         " -lsatlas -lm"))
37
38      (error "unable to figure out location of ATLAS library")
39      ))
40
41
42(compile -O3 -d0 -s atlas-lapack.scm -j atlas-lapack -L "\"" ,ld-options "\"" )
43(compile -O2 -d0 -s atlas-lapack.import.scm)
44
45(install-extension
46 'atlas-lapack
47 `(,(dynld-name "atlas-lapack") ,(dynld-name "atlas-lapack.import") )
48 `((version 3.1)
49   ))
50
Note: See TracBrowser for help on using the repository browser.