|
2 | 2 | ;;;;
|
3 | 3 | ;;;; This is loaded (as with CL:LOAD) before the final image is saved.
|
4 | 4 | ;;;;
|
5 |
| -;;;; Rewrites shared library references to libblas.dylib and |
6 |
| -;;;; liblapack.dylib on Mac SDK targets to use the Rigetti package |
7 |
| -;;;; path /usr/local/lib/rigetti. This is so the exact |
8 |
| -;;;; Rigetti-provided versions of these libraries are found when the |
9 |
| -;;;; SDK binary starts up. If these were not rewritten, the SDK binary |
10 |
| -;;;; could try to load from non-existent Brew paths or inadequate |
11 |
| -;;;; Accelerate-related system paths. |
| 5 | +;;;; This file rewrites shared library references on Mac SDK targets |
| 6 | +;;;; to use the Rigetti package path /usr/local/lib/rigetti. This is |
| 7 | +;;;; so the exact Rigetti-provided versions of these libraries are |
| 8 | +;;;; found when the SDK binary starts up. If these were not rewritten, |
| 9 | +;;;; the SDK binary could try to load from non-existent Brew paths or |
| 10 | +;;;; inadequate system paths. |
| 11 | +;;;; |
| 12 | +;;;; This file used to rewrite libblas.dylib and liblapack.dylib. |
12 | 13 | ;;;;
|
13 | 14 | ;;;; Has no effect on non-Mac targets.
|
14 | 15 |
|
15 | 16 | (in-package #:cl-user)
|
16 | 17 |
|
| 18 | +(defvar *dylibs-to-replace* '() |
| 19 | + "A list of dylib filenames (with extensions) that need replacement.") |
| 20 | + |
17 | 21 | (dolist (shared-object sb-sys:*shared-objects*)
|
18 |
| - (let ((dylibs-to-replace '("libblas.dylib" |
19 |
| - "liblapack.dylib")) |
| 22 | + (let ((dylibs-to-replace *dylibs-to-replace*) |
20 | 23 | (original-path (sb-alien::shared-object-pathname shared-object)))
|
21 | 24 | (let ((dylib (first (member (file-namestring original-path)
|
22 | 25 | dylibs-to-replace
|
|
0 commit comments