Skip to content

Commit

Permalink
[fix] numpy-installed-p.txt and recompile manually
Browse files Browse the repository at this point in the history
Making this into a non-lisp file avoids undefined variable warnings when the
case of the readtable changes.
  • Loading branch information
digikar99 committed Apr 30, 2024
1 parent 4d09ece commit 53402f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion py4cl2-cffi.asd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(:file "lisp-utils")
(:static-file "py4cl-utils.c")
(:static-file "py4cl-numpy-utils.c")
(:file "numpy-installed-p")
(:static-file "numpy-installed-p.txt")
(:file "shared-objects")
(:file "gil-gc")
(:file "numpy")
Expand Down
1 change: 0 additions & 1 deletion src/numpy-installed-p.lisp

This file was deleted.

13 changes: 6 additions & 7 deletions src/shared-objects.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,20 @@
(format nil "~{~a~^ ~}" *python-includes*)
(format nil "~A/core/include/"
(string-trim (list #\newline) numpy-path)))))
(setq *numpy-installed-p* numpy-installed-p)
(when numpy-installed-p
(format t "~&~A~%" program-string)
(uiop:run-program program-string
:error-output *error-output*
:output *standard-output*)))))))

(eval-when (:compile-toplevel)
(compile-base-utils-shared-object)
(may-be-compile-numpy-utils-shared-object))
(compile-base-utils-shared-object))

(eval-when (:compile-toplevel :load-toplevel)
(let* ((numpy-installed-p-file
(asdf:component-pathname
(asdf:find-component
"py4cl2-cffi" "numpy-installed-p"))))
"py4cl2-cffi" "numpy-installed-p.txt"))))
(multiple-value-bind (numpy-installed-p-old error)
(ignore-errors
(with-standard-io-syntax
Expand All @@ -74,15 +72,16 @@
:ignore-error-status t))))
(numpy-installed-p-new
(with-standard-io-syntax
(write-to-string `(quote ,numpy-installed-p)))))
(write-to-string numpy-installed-p))))
(setq *numpy-installed-p* numpy-installed-p)
(when (or error
(string/= numpy-installed-p-old
numpy-installed-p-new))
(with-standard-io-syntax
(write-string-into-file numpy-installed-p-new numpy-installed-p-file
:if-exists :supersede
:if-does-not-exist :create)))
(setq *numpy-installed-p* numpy-installed-p)))))
:if-does-not-exist :create))
(may-be-compile-numpy-utils-shared-object))))))

(defvar *python-libraries-loaded-p* nil)
(defun load-python-and-libraries ()
Expand Down

0 comments on commit 53402f3

Please sign in to comment.