Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependence on lapack #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ system-index.txt: $(QUICKLISP_SETUP)
install-test-deps:
ifeq ($(UNAME_S),Linux)
ifeq ($(shell sed -n "s/^ID=//p" /etc/os-release),debian)
apt-get update && apt-get install -y git libblas-dev libffi-dev liblapack-dev libzmq3-dev
apt-get update && apt-get install -y git libzmq3-dev
else ifeq ($(shell sed -n "s/^ID=//p" /etc/os-release),ubuntu)
apt update && apt install -y git libblas-dev libffi-dev liblapack-dev libzmq3-dev
apt update && apt install -y git libzmq3-dev
else
echo "Centos-based platforms unsupported"
endif
Expand Down
4 changes: 0 additions & 4 deletions app/src/entry-point.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@
#+sbcl
(format t "Loaded libraries:~%~{ ~A~%~}~%"
(mapcar 'sb-alien::shared-object-pathname sb-sys:*shared-objects*))
(unless (magicl.foreign-libraries:foreign-symbol-available-p "zuncsd_"
'magicl.foreign-libraries:liblapack)
(format t "The loaded version of LAPACK is missing necessary functionality.~%")
(quit-nicely 1))
(format t "Library check passed.~%")
(quit-nicely 0))

Expand Down
21 changes: 12 additions & 9 deletions app/src/mangle-shared-objects.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
;;;;
;;;; This is loaded (as with CL:LOAD) before the final image is saved.
;;;;
;;;; Rewrites shared library references to libblas.dylib and
;;;; liblapack.dylib on Mac SDK targets to use the Rigetti package
;;;; path /usr/local/lib/rigetti. This is so the exact
;;;; Rigetti-provided versions of these libraries are found when the
;;;; SDK binary starts up. If these were not rewritten, the SDK binary
;;;; could try to load from non-existent Brew paths or inadequate
;;;; Accelerate-related system paths.
;;;; This file rewrites shared library references on Mac SDK targets
;;;; to use the Rigetti package path /usr/local/lib/rigetti. This is
;;;; so the exact Rigetti-provided versions of these libraries are
;;;; found when the SDK binary starts up. If these were not rewritten,
;;;; the SDK binary could try to load from non-existent Brew paths or
;;;; inadequate system paths.
;;;;
;;;; This file used to rewrite libblas.dylib and liblapack.dylib.
;;;;
;;;; Has no effect on non-Mac targets.

(in-package #:cl-user)

(defvar *dylibs-to-replace* '()
"A list of dylib filenames (with extensions) that need replacement.")

(dolist (shared-object sb-sys:*shared-objects*)
(let ((dylibs-to-replace '("libblas.dylib"
"liblapack.dylib"))
(let ((dylibs-to-replace *dylibs-to-replace*)
(original-path (sb-alien::shared-object-pathname shared-object)))
(let ((dylib (first (member (file-namestring original-path)
dylibs-to-replace
Expand Down
7 changes: 3 additions & 4 deletions qvm.asd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
(values))

(asdf:defsystem #:qvm
:description "An implementation of the Quantum Abstract Machine."
:author "Robert Smith <[email protected]>"
:description "An implementation of the Quantum/Quil Abstract Machine."
:author "Robert Smith, Rigetti Computing, and Quil-Lang Contributors"
:license "Apache License 2.0 (See LICENSE.txt)"
:version (:read-file-form "VERSION.txt")
:defsystem-depends-on (#:cffi-grovel)
Expand All @@ -24,7 +24,6 @@
#:lparallel
;; Matrix algebra
(:version #:magicl/core "0.9.0")
#:magicl/ext-lapack
;; weak hash tables
#:trivial-garbage
;; static globals
Expand All @@ -40,7 +39,7 @@
;; Portable random number generator
#:mt19937
;; For allocation info.
#+sbcl #:sb-introspect
(:feature :sbcl #:sb-introspect)
;; Portable *features*
#:trivial-features)
:in-order-to ((asdf:test-op (asdf:test-op #:qvm-tests)))
Expand Down