When launching "FRICASsys" from terminal without environment variable
"FRICAS" set, you get following message:
Checking for foreign routines
FRICAS=NIL
spad-lib="/lib/libspad.so"
Then it will look for "/lib/libspad.so" to load and will fail.
It will affect functionalities like ")compile", because it will
need the "remove_directory" C function.
This can be a common scenario: during debugging, you may have
multiple directories containing different "FRICASsys", it can
be convenient to run the binary directly without setting different
"FRICAS" first. Also this is the current status of our Windows
distribution: we only have "bin/FRICASsys.exe" and "FRICAS" is not
set in Windows environment variables.
So the following patch is to deal with this case -- when "FRICAS"
is not set. There is already logic in function "initroot" to set
variable "$spadroot" by probing parent directory.
- Qian
====
diff --git a/src/interp/util.lisp b/src/interp/util.lisp
index 63cd20f3..2a6219cd 100644
--- a/src/interp/util.lisp
+++ b/src/interp/util.lisp
@@ -77,7 +77,7 @@
;;; It is set up in the {\bf reroot} function.
(defvar $library-directory-list ())
-;;; Prefix a filename with the {\bf FRICAS} shell variable.
+;;; Prefix a filename with the {\bf $spadroot} variable.
(defun make-absolute-filename (name)
(concatenate 'string $spadroot name))
@@ -88,13 +88,10 @@
be {\bf \$spadroot}. The {\bf reroot} function will change the
system to use a new root directory and will have the same effect
as changing the {\bf FRICAS} shell variable and rerunning the system
-from scratch. A correct call looks like:
-\begin{verbatim}
-(in-package "BOOT")
-(reroot "${FRICAS}")
-\end{verbatim}
-where the [[${FRICAS}]] variable points to installed tree.
+from scratch.
|#
+(defvar $spadroot "")
+
(defun reroot (dir)
(setq $spadroot dir)
(setq $directory-list
@@ -267,10 +264,9 @@
#+:GCL (system:gbc-time 0)
#+(or :sbcl :clisp :openmcl :lispworks)
(if *fricas-load-libspad*
- (let* ((ax-dir (|getEnv| "FRICAS"))
- (spad-lib (concatenate 'string ax-dir "/lib/libspad.so")))
+ (let ((spad-lib (make-absolute-filename "/lib/libspad.so")))
(format t "Checking for foreign routines~%")
- (format t "FRICAS=~S~%" ax-dir)
+ (format t "FRICAS=~S~%" $spadroot)
(format t "spad-lib=~S~%" spad-lib)
(if (|fricas_probe_file| spad-lib)
(progn
@@ -280,7 +276,7 @@
(|quiet_load_alien| spad-lib)
#+(or :sbcl :openmcl)
(fricas-lisp::init-gmp
- (concatenate 'string ax-dir "/lib/gmp_wrap.so"))
+ (make-absolute-filename "/lib/gmp_wrap.so"))
#+(and :clisp :ffi)
(progn
(eval `(FFI:DEFAULT-FOREIGN-LIBRARY ,spad-lib))
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/96fede8a-cba3-4c4a-9a8f-665bfb93d656%40gmail.com.