forked from quil-lang/magicl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagicl-transcendental.asd
61 lines (55 loc) · 2.01 KB
/
magicl-transcendental.asd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;;; magicl-transcendental.asd
;;;;
;;;; Author: Robert Smith
;;; Adapted from commonqt's qt.asd
(defclass f->so (asdf:source-file)
()
(:default-initargs
:type "f"))
(defmethod output-files ((operation compile-op) (component f->so))
(values (list (make-pathname :name "libexpokit"
:type #-darwin "so" #+darwin "dylib"
:defaults (component-pathname component)))
t))
(defmethod perform ((operation load-op) (component f->so))
t)
(defmethod perform ((operation compile-op) (component f->so))
(flet ((nn (x) (uiop:native-namestring x)))
(let* ((fortran-file (component-pathname component))
(object-file (make-pathname :type "o" :defaults fortran-file))
(shared-object (make-pathname :type #+darwin "dylib" #-darwin "so"
:name "libexpokit"
:defaults fortran-file)))
(uiop:run-program
(list "gfortran" "-fPIC" "-std=legacy"
"-c"
(nn fortran-file)
"-o"
(nn object-file)))
(uiop:run-program
(list "gfortran" #+darwin "-dynamiclib" #-darwin "-shared"
"-o" (nn shared-object)
(nn object-file)
#+darwin "-lblas"
#+darwin "-llapack"))
(delete-file object-file))))
(asdf:defsystem #:magicl-transcendental
:license "BSD 3-Clause (See LICENSE.txt)"
:maintainer "Rigetti Computing"
:author "Rigetti Computing"
:description "Transcendental functionality for MAGICL"
:version (:read-file-form "VERSION.txt")
:depends-on (#:alexandria
#:cffi
#:cffi-libffi
#:magicl)
:in-order-to ((asdf:test-op (asdf:test-op #:magicl-tests)))
:serial t
:components
((:module "transcendental"
:serial t
:components ((f->so "expokit")
(:file "package")
(:file "load-libs")
(:file "transcendental")))
(:file "src/bindings/expokit-cffi")))