On Sun, Sep 24, 2023 at 03:42:02PM +0200, Waldek Hebisch wrote:
> On Sun, Sep 24, 2023 at 08:20:45AM +0800, Qian Yun wrote:
> > On one hand, this is the behavior described in comment:
> > $spadroot was $FRICAS during build time.
> > 
> > ;;; Sets up the system to use the {\bf FRICAS} shell variable if we can
> > ;;; and default to the {\bf \$spadroot} variable (which was the value
> > ;;; of the {\bf FRICAS} shell variable at build time) if we can't.
> > ;;; Use the parent directory of FRICASsys binary as fallback.
> > (defun initroot (&optional (newroot nil))
> > 
> > On the other hand, this mechanism seems not used during build:
> > It is called in "interpsys-image-init" which involves INTERPSYS,
> > but all INTERPSYS calls have valid $FRICAS to it.
> 
> This behaviour clearly was intended as a convenience feature for
> developers.  But times have changed and FriCAS code changed,
> so it is now not needed.
> 
> ATM it is not clear to me what should we write in the comment.
> Most of the comment is redundant, it repeats in impreciase
> way what is clearly expressed by code.  And extra info
> (about $spadroot) is going to be invalid.
> 
> To say the truth, it is not clear to me if initroot should
> look at $spadroot at all.
> 
> Currently we have 4 ways to get base location of FriCAS:
> 
> 1) FRICAS environment variable
> 2) argument to build-interpsys
> 3) location inferred from path to FriCASsys
> 4) remembered value of $spadroot
> 
> ATM I do not know if remembered $spadroot can be used except for
> values restored from an image (which is currently used but should
> be not used).

Removing use of $spadroot from initroot gives sucessful build and
testsuite passes.  Starting FRICASsys without seting FRICAS
gives

FRICAS="target/x86_64-linux-gnu/bin//../"
spad-lib="target/x86_64-linux-gnu/bin//..//lib/libspad.so"

which works, but since paths are relative could be broken by
change of current directory:

(1) -> )cd ..
   The current FriCAS default directory is /home/hebisch/fricas/axp1 
(1) -> integrate(sin(x), x)
 
   >> System error:
   Couldn't load "target/x86_64-linux-gnu/bin//..//algebra/EXPR.fasl": file does
not exist.

Also, double slashes may cause trouble (IIRC GCL had trouble with
double slashes.

-- 
                              Waldek Hebisch

-- 
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/ZRBKhYMMFmkMigoq%40fricas.org.

Reply via email to