source: project/release/4/mpi/trunk/mpi.setup @ 14411

Last change on this file since 14411 was 14411, checked in by Ivan Raikov, 11 years ago

mpi ported to Chicken 4

File size: 1.2 KB
Line 
1;; -*- Hen -*-
2
3(define (dynld-name fn)         
4  (make-pathname #f fn ##sys#load-dynamic-extension))   
5
6(define (mpi-try-compile header ldflags cppflags)
7  (and (try-compile
8        (string-append header "\n"
9                        "int main(int argc, char **argv) { MPI_Init(&argc, &argv); return 0; }\n")
10        ldflags: ldflags
11        cflags: cppflags
12        )
13       (cons ldflags cppflags)))
14
15(define-syntax mpi-test
16  (syntax-rules ()
17    ((_ (flags ...))
18     (condition-case (mpi-try-compile flags ...)
19                     (t ()    #f)))))
20
21(define ld+cpp-options
22  (or (mpi-test ("#include <mpi.h>" "-lmpi" ""))
23      (mpi-test ("#include <mpi.h>" "-lmpi" "-I/usr/include/mpi"))
24      (mpi-test ("#include <mpi.h>" "-lmpi" "-I/usr/lib/openmpi/include"))
25      (error "unable to figure out location of MPI library")))
26
27(compile -O2 -d0 -I. -s mpi.scm  -j mpi
28         -L "\"" ,(car ld+cpp-options) "\""
29         -C "\"" ,(cdr ld+cpp-options) "\"")
30(compile -O2 -d0 -s mpi.import.scm)
31
32(run (csi -qbs mpi-eggdoc.scm > mpi.html))
33
34(install-extension
35
36  ; Name of your extension:
37  'mpi
38
39  ; Files to install for your extension:
40  `(,(dynld-name "mpi") ,(dynld-name "mpi.import") "mpi.html" )
41   
42  ; Assoc list with properties for your extension:
43  `((version 1.6)
44    (documentation "mpi.html")
45    ))
46
Note: See TracBrowser for help on using the repository browser.