Changeset 14411 in project for release/4/mpi/trunk/mpi.setup


Ignore:
Timestamp:
04/24/09 07:35:08 (11 years ago)
Author:
Ivan Raikov
Message:

mpi ported to Chicken 4

Location:
release/4/mpi
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/mpi/trunk/mpi.setup

    r10914 r14411  
    1 
    2 (define has-exports? (string>=? (chicken-version) "2.310"))
     1;; -*- Hen -*-
    32
    43(define (dynld-name fn)         
     
    1413       (cons ldflags cppflags)))
    1514
    16 (define-macro (mpi-test . rest)
    17   `(or (any identity (map (lambda (p) (mpi-try-compile (first p) (second p) (third p))) ',rest))
    18        (error "unable to figure out location of MPI library")))
     15(define-syntax mpi-test
     16  (syntax-rules ()
     17    ((_ (flags ...))
     18     (condition-case (mpi-try-compile flags ...)
     19                     (t ()    #f)))))
    1920
    2021(define ld+cpp-options
    21   (mpi-test ("#include <mpi.h>" "-lmpi" "")
    22             ("#include <mpi.h>" "-lmpi" "-I/usr/include/mpi")
    23             ("#include <mpi.h>" "-lmpi" "-I/usr/lib/openmpi/include")))
     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")))
    2426
    25 (compile -O -d2 -s -o ,(dynld-name "mpi")
    26          ,@(if has-exports? '(-check-imports -emit-exports mpi.exports) '())
    27          mpi.scm  -lchicken -ldl  -L "\"" ,(car ld+cpp-options) "\""
     27(compile -O2 -d0 -I. -s mpi.scm  -j mpi
     28         -L "\"" ,(car ld+cpp-options) "\""
    2829         -C "\"" ,(cdr ld+cpp-options) "\"")
     30(compile -O2 -d0 -s mpi.import.scm)
    2931
    3032(run (csi -qbs mpi-eggdoc.scm > mpi.html))
     
    3638
    3739  ; Files to install for your extension:
    38   `(,(dynld-name "mpi") "mpi.html"
    39     ,@(if has-exports? '("mpi.exports") (list)) )
     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    ))
    4046
    41   ; Assoc list with properties for your extension:
    42   `((version 1.5)
    43     (documentation "mpi.html")
    44     ,@(if has-exports? `((exports "mpi.exports")) (list)) ))
Note: See TracChangeset for help on using the changeset viewer.