Le lun. 3 juil. 2023 à 09:42, Ralf Hemmecke <[email protected]> a écrit :
>
> On 03.07.23 09:21, Grégory Vanuxem wrote:
> > Just built using SBCL-2.3.6 (dynamic-space-size=4Gb) with GMP and Aldor
> > support.
>
> > It is just a pity from my point of view there is no support of Hunchentoot
> > in it.
>
> > I mean having an option for it.
>
> Well, there is no option for it in the FriCAS build machinery, because
> the need of Hunchentoot is currently somewhat orthogonal to the main
> FriCAS area, i.e., you can work perfectly fine with FriCAS even if you
> do not have Hunchentoot.

Yes, I know, I was not clear.

>
>
> Hunchentoot is only needed if one wants the jFriCAS interface. And for
> that one just needs to provide and use HSBCL during the build of FriCAS.
> So in some sense there is a configure option, but agreed, the burden to
> build/fetch HBCL is completely put onto the user.


I think it does not need to be absolutely necessary if you want
to use FriCAS Jupyter's notebook. I agree that with Debian like systems
for example it is not easy to _install_ hunchentoot support if necessary,
so hsbcl is of help. And I do not suggest to delete the HSBCL possibility
to build FriCAS. As I said, it cans help (a lot). But this is a strong
requirement,
It requires a custom SBCL image. So I suggest to  add an option if you already
have the hunchentoot package in your Lisp settings. You suggested that too
previously if memory does not deserve me.

Attached is a proof of concept patch that can be applied on fricas-1.3.9-pre.
I tried this with :
$./configure --enable-gmp --enable-aldor --with-lisp='ros run'
and
$./configure --enable-gmp --enable-aldor --enable-webspad --with-lisp='ros run'

'make check' gives no unexpected failure.
sieve.as can be compiled and returns 25 with 'sieve(100)'
and if --enable-webpad is added I can smoothly run the
FriCAS kernel with:
$jupyrer notebook

Even with ')set message time on' in my $HOME/.fricas.input.

'--enable-webspad' should be renamed though.

You can check that with:
(see https://github.com/roswell/roswell/releases/tag/v22.12.14.113)
Here it's for an AMD64 Debian like system.

$ wget 
https://github.com/roswell/roswell/releases/download/v22.12.14.113/roswell_22.12.14.113-1_amd64.deb
$ sudo dpkg -i roswell_22.12.14.113-1_amd64.deb
$ ros install hunchentoot

and in the patched source tree
$./configure --enable-gmp --enable-aldor --enable-webspad --with-lisp='ros run'
make and sudo make install as usual.

It's really easy to return to the previous Linux configuration with
'dpkg --purge roswell'  and 'rm -Rf .$HOME/.roswell'

I have followed your discussion with Waldek on this, and
I agree, having Hunchentoot using Internet access etc.
is really not convenient. Here this is just another option,
simpler with correct Lisp settings if available.
Personally I would prefer to use, say
'sudo apt install cl-hunchentoot' but my Linux distribution
does not have this package for now.

> See (currently, till the official docs are build):
>
> https://hemmecke.github.io/fricas/install.html#hunchentoot-optional
>
> Until the official distribution of hsbcl-1.3.9.tar is put onto the
> release page you can use this:
>
>
> wget http://www.math.uni.wroc.pl/~hebisch/fricas/hsbcl.tar
> tar -xf hsbcl.tar
> cd hsbcl
> time ./build_hsbcl > rap1 2>&1
>
> as written here:
>
> https://groups.google.com/g/fricas-devel/c/ixaDVZ6inxw/m/KY4WWapYAwAJ

Yes, that's very handy. I didn't notice it in fact. Thanks.

> I find hsbcl-1.3.9.tar a bit misleading, because the version number
> refers to FriCAS and not SBCL. In fact, hsbcl-1.3.9.tar just contains
> build instructions to build an SBCL image with Hunchentoot included.
> What version of SBCL you use is completely up to what the user provides
> on his/her system.
>
> Can you try out whether the build instructions on
>
> https://hemmecke.github.io/fricas/install.html
>
> work for you to build FriCAS with the jFriCAS interface? Maybe there is
> still something unclear that we could fix before release.

For sure I will.
__
Greg

PS: The patch needs to be modified if one use '--enable-webspad' with an already
included Hunchentoot SBCL

-- 
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/CAHnU2dZmT%3DoC6MV%3DOS2k5hRBxRjm5ybYwNT0rpi4uGWhmkigUg%40mail.gmail.com.
diff '--color=auto' -aur ../orig/fricas-1.3.9-pre/configure ./configure
--- ../orig/fricas-1.3.9-pre/configure	2023-07-02 19:43:36.000000000 +0200
+++ ./configure	2023-07-03 09:34:04.590580642 +0200
@@ -631,6 +631,8 @@
 ALDOR
 ALDOR_datadir
 sys_ALDOR
+WEBSPAD_REQUIREMENTS
+SBCL_HOME
 LDF
 CCF
 FRICAS
@@ -725,7 +727,6 @@
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -759,6 +760,9 @@
 enable_debug_compiler
 enable_algebra_optimization
 with_x
+with_quicklisp
+enable_webspad
+with_sbcl_home
 enable_aldor
 with_aldor_binary
 '
@@ -810,7 +814,6 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1063,15 +1066,6 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1209,7 +1203,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir runstatedir
+		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1362,7 +1356,6 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1410,6 +1403,7 @@
   --enable-algebra-optimization=S
                           use S as Lisp optimize declaration for compiling the
                           algebra
+  --enable-webspad        include a webserver into FriCASsys, (yes/no)
   --enable-aldor          build an interface to the Aldor compiler, (yes/no)
 
 Optional Packages:
@@ -1426,6 +1420,9 @@
   --with-gmp-include=PATH specify directory for installed GMP include files
   --with-gmp-lib=PATH     specify directory for the installed GMP library
   --with-x                use the X Window System
+  --with-quicklisp=PATH   use quicklisp installation path (default
+                          "~/quicklisp")
+  --with-sbcl-home=PATH   Value for SBCL_HOME.
   --with-aldor-binary=PATH
                           use the aldor binary given
 
@@ -6440,6 +6437,169 @@
 
 
 
+###################################################################
+## The following section deals with the inclusion of the hunchentoot
+## webserver which can be used for the jupyter interface for FriCAS.
+## It is currently only supported on Linux for SBCL.
+
+## There are, in fact, two switches.
+## --with-quicklisp="/absolute/path-to-quicklisp"
+## and
+## --enable-webspad.
+## Whereas --enable-webspad deals with the actual inclusion of
+## hunchentoot into FriCASsys, --with-quicklisp specifies that
+## hunchentoot should be loaded via quicklisp.
+
+## Since by default hunchentoot (apt install cl-hunchentoot) comes
+## with ssl support, which might cause problems loading the right
+## version of libssl.so, namely
+##: Error opening shared object "libssl.so.1.0.0":
+##: libssl.so.1.0.0: cannot open shared object file: No such file or directory.
+## and the local FriCAS-Jupyter connection does not need ssl,
+## we prefer that hunchentoot is installed via quicklisp into
+## a distinguished path via
+##   sbcl --load quicklisp.lisp
+##   (quicklisp-quickstart:install :path "/absolute/path-to-quicklisp/")
+##   (push :hunchentoot-no-ssl *features*)
+##   (ql:quickload "hunchentoot")
+
+# Check whether --with-quicklisp was given.
+if test "${with_quicklisp+set}" = set; then :
+  withval=$with_quicklisp; USE_QUICKLISP=yes
+     if test -d $withval; then :
+  QUICKLISPPATH=$withval
+else
+  if test -d ~/quicklisp; then :
+  QUICKLISPPATH=~/quicklisp
+else
+  as_fn_error $? "quicklisp path not available" "$LINENO" 5
+fi
+fi
+else
+  USE_QUICKLISP=no
+fi
+
+
+###################################################################
+## Default is --enable-webspad=no which means hunchentoot will
+## not be included into FRICASsys and thus jfricas will not work.
+## With --enable-webspad, configure checks whether hunchentoot is
+## available for inclusion into FRICASsys.
+
+## If hunchentoot is included into FRICASsys in the binary
+## distribution, then the target system does not need to have
+## hunchentoot installed, but must provide jupyter so that the jfricas
+## interface can work.
+INCLUDE_WEBSPAD=no
+# Check whether --enable-webspad was given.
+if test "${enable_webspad+set}" = set; then :
+  enableval=$enable_webspad; case $enableval in #(
+  yes) :
+    if test "$fricas_lisp_flavor" = "sbcl" \
+     			|| test "$fricas_lisp_flavor" = "openmcl" \
+				|| test "$fricas_lisp_flavor" = "ecl"; then :
+  INCLUDE_WEBSPAD=yes
+else
+  INCLUDE_WEBSPAD=no
+        as_fn_error $? "webspad only available for SBCL or Clozure CL" "$LINENO" 5
+fi ;; #(
+  no) :
+    INCLUDE_WEBSPAD=no ;; #(
+  *) :
+    as_fn_error $? "only yes/no allowed as value for --enable-webspad" "$LINENO" 5
+   ;;
+esac
+
+fi
+
+
+# Now Check that Hunchentoot is available.
+WEBSPAD_REQUIREMENTS=
+if test x"$USE_QUICKLISP" = xyes; then :
+  WEBSPAD_REQUIREMENTS="(load \"$QUICKLISPPATH/setup.lisp\")(require :hunchentoot)"
+else
+  WEBSPAD_REQUIREMENTS="(require :asdf)(require :hunchentoot)"
+fi
+
+if test x"$INCLUDE_WEBSPAD" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asdf and hunchentoot" >&5
+$as_echo_n "checking for asdf and hunchentoot... " >&6; }
+  if $fricas_lisp --non-interactive --eval "(progn $WEBSPAD_REQUIREMENTS)"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     as_fn_error $? "asdf and hunchentoot are required for --enable-webspad" "$LINENO" 5
+     INCLUDE_WEBSPAD=no
+fi
+
+fi
+
+if test x"$INCLUDE_WEBSPAD" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Webserver hunchentoot will be included into FRICASsys." >&5
+$as_echo "$as_me: Webserver hunchentoot will be included into FRICASsys." >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No webserver will be included into FRICASsys." >&5
+$as_echo "$as_me: WARNING: No webserver will be included into FRICASsys." >&2;}
+   WEBSPAD_REQUIREMENTS=""
+
+fi
+
+
+# The reason why we need SBCL_HOME is that FRICASsys is generated by
+# using the bootsys image and not by the sbcl itself. The bootsys
+# image, however, lost the strategy to find sbcl.core if SBCL_HOME is
+# not set. (See below.)
+
+# Check whether --with-sbcl-home was given.
+if test "${with_sbcl_home+set}" = set; then :
+  withval=$with_sbcl_home; # Action if --with-sbcl-home is given.
+    if test -d "$withval"; then :
+  SBCL_HOME=$withval
+else
+  as_fn_error $? "--with-sbcl-home directory does not exist." "$LINENO" 5
+fi
+else
+  # Action if --with-sbcl-home is not given.
+    # If the path of sbcl is P, then SBCL_HOME will be P/../lib/sbcl.
+    # This is in line with https://github.com/sbcl/sbcl/blob/master/INSTALL.
+    #
+    ## The SBCL runtime needs to be able to find the ancillary files
+    ## associated with it: the "sbcl.core" file, and the contrib modules.
+    ## Finding sbcl.core can happen in the following ways:
+    ##
+    ##   * By default, in a location configured when the system was built.
+    ##     For binary distributions this is in "/usr/local/lib/sbcl".
+    ##
+    ##   * In the directory ../lib/sbcl relative to the executable.
+    ##
+    ##   * In the current directory.
+    ##
+    ##   * By environment variable, in the directory named by the
+    ##     environment variable "SBCL_HOME". Example:
+    ##
+    ##        $ export SBCL_HOME=/bar/bar/lib/sbcl
+    ##        $ sbcl
+    ##
+    ##     If your "INSTALL_ROOT" was FOO, then your "SBCL_HOME" is
+    ##     "FOO/lib/sbcl".
+    ##
+    ##   * By command line option:
+    ##
+    ##         $ sbcl --core /bar/bar/sbcl.core
+
+    lisp_prog=`echo $fricas_lisp | sed 's/ .*//'` # remove parameters
+     lisp_path=`which $lisp_prog` # cannot be empty
+     SBCL_HOME="${lisp_path%sbcl}../lib/sbcl"
+
+fi
+
+
+#AC_MSG_NOTICE([SBCL_HOME=$SBCL_HOME])
+
+
+
 ac_config_files="$ac_config_files Makefile:config/var-def.mk:Makefile.in:config/setup-dep.mk"
 
 ac_config_files="$ac_config_files src/Makefile:config/var-def.mk:src/Makefile.in:config/setup-dep.mk"
diff '--color=auto' -aur ../orig/fricas-1.3.9-pre/configure.ac ./configure.ac
--- ../orig/fricas-1.3.9-pre/configure.ac	2023-07-02 19:43:36.000000000 +0200
+++ ./configure.ac	2023-07-03 09:30:57.770571418 +0200
@@ -793,6 +793,138 @@
 AC_SUBST(CCF)
 AC_SUBST(LDF)
 
+###################################################################
+## The following section deals with the inclusion of the hunchentoot
+## webserver which can be used for the jupyter interface for FriCAS.
+## It is currently only supported on Linux for SBCL.
+
+## There are, in fact, two switches.
+## --with-quicklisp="/absolute/path-to-quicklisp"
+## and
+## --enable-webspad.
+## Whereas --enable-webspad deals with the actual inclusion of
+## hunchentoot into FriCASsys, --with-quicklisp specifies that
+## hunchentoot should be loaded via quicklisp.
+
+## Since by default hunchentoot (apt install cl-hunchentoot) comes
+## with ssl support, which might cause problems loading the right
+## version of libssl.so, namely
+##: Error opening shared object "libssl.so.1.0.0":
+##: libssl.so.1.0.0: cannot open shared object file: No such file or directory.
+## and the local FriCAS-Jupyter connection does not need ssl,
+## we prefer that hunchentoot is installed via quicklisp into
+## a distinguished path via
+##   sbcl --load quicklisp.lisp
+##   (quicklisp-quickstart:install :path "/absolute/path-to-quicklisp/")
+##   (push :hunchentoot-no-ssl *features*)
+##   (ql:quickload "hunchentoot")
+AC_ARG_WITH([quicklisp],
+    [AS_HELP_STRING([--with-quicklisp=PATH],
+        [use quicklisp installation path (default "~/quicklisp")])],
+    [USE_QUICKLISP=yes
+     AS_IF([test -d $withval],
+       [QUICKLISPPATH=$withval],
+       [AS_IF([test -d ~/quicklisp],
+          [QUICKLISPPATH=~/quicklisp],
+          [AC_MSG_ERROR([quicklisp path not available])])])],
+    [USE_QUICKLISP=no])
+
+###################################################################
+## Default is --enable-webspad=no which means hunchentoot will
+## not be included into FRICASsys and thus jfricas will not work.
+## With --enable-webspad, configure checks whether hunchentoot is
+## available for inclusion into FRICASsys.
+
+## If hunchentoot is included into FRICASsys in the binary
+## distribution, then the target system does not need to have
+## hunchentoot installed, but must provide jupyter so that the jfricas
+## interface can work.
+INCLUDE_WEBSPAD=no
+AC_ARG_ENABLE(webspad,
+  [AS_HELP_STRING([--enable-webspad],
+                  [include a webserver into FriCASsys, (yes/no)])],
+  [AS_CASE([$enableval],
+    [yes], [AS_IF([test "$fricas_lisp_flavor" = "sbcl" \ 
+     			|| test "$fricas_lisp_flavor" = "openmcl" \
+				|| test "$fricas_lisp_flavor" = "ecl"],
+       [INCLUDE_WEBSPAD=yes],
+       [INCLUDE_WEBSPAD=no
+        AC_MSG_ERROR([webspad only available for SBCL or Clozure CL])])],
+    [no], [INCLUDE_WEBSPAD=no],
+    [AC_MSG_ERROR([only yes/no allowed as value for --enable-webspad])]
+  )]
+)
+
+# Now Check that Hunchentoot is available.
+WEBSPAD_REQUIREMENTS=
+AS_IF([test x"$USE_QUICKLISP" = xyes],
+       [WEBSPAD_REQUIREMENTS="(load \"$QUICKLISPPATH/setup.lisp\")(require :hunchentoot)"],
+       [WEBSPAD_REQUIREMENTS="(require :asdf)(require :hunchentoot)"])
+
+AS_IF([test x"$INCLUDE_WEBSPAD" = xyes],
+  [AC_MSG_CHECKING([for asdf and hunchentoot])
+  AS_IF([$fricas_lisp --non-interactive --eval "(progn $WEBSPAD_REQUIREMENTS)"],
+    [AC_MSG_RESULT([yes])],
+    [AC_MSG_RESULT([no])
+     AC_MSG_ERROR([asdf and hunchentoot are required for --enable-webspad])
+     INCLUDE_WEBSPAD=no])]
+)
+
+AS_IF([test x"$INCLUDE_WEBSPAD" = xyes],
+  [AC_MSG_NOTICE([Webserver hunchentoot will be included into FRICASsys.])],
+  [AC_MSG_WARN([No webserver will be included into FRICASsys.])
+   WEBSPAD_REQUIREMENTS=""]
+)
+
+
+# The reason why we need SBCL_HOME is that FRICASsys is generated by
+# using the bootsys image and not by the sbcl itself. The bootsys
+# image, however, lost the strategy to find sbcl.core if SBCL_HOME is
+# not set. (See below.)
+AC_ARG_WITH([sbcl-home],
+    [AS_HELP_STRING([--with-sbcl-home=PATH],
+                    [Value for SBCL_HOME.])],
+    # Action if --with-sbcl-home is given.
+    [AS_IF([test -d "$withval"],
+           [SBCL_HOME=$withval],
+           [AC_MSG_ERROR([--with-sbcl-home directory does not exist.])])],
+    # Action if --with-sbcl-home is not given.
+    # If the path of sbcl is P, then SBCL_HOME will be P/../lib/sbcl.
+    # This is in line with https://github.com/sbcl/sbcl/blob/master/INSTALL.
+    #
+    ## The SBCL runtime needs to be able to find the ancillary files
+    ## associated with it: the "sbcl.core" file, and the contrib modules.
+    ## Finding sbcl.core can happen in the following ways:
+    ##
+    ##   * By default, in a location configured when the system was built.
+    ##     For binary distributions this is in "/usr/local/lib/sbcl".
+    ##
+    ##   * In the directory ../lib/sbcl relative to the executable.
+    ##
+    ##   * In the current directory.
+    ##
+    ##   * By environment variable, in the directory named by the
+    ##     environment variable "SBCL_HOME". Example:
+    ##
+    ##        $ export SBCL_HOME=/bar/bar/lib/sbcl
+    ##        $ sbcl
+    ##
+    ##     If your "INSTALL_ROOT" was FOO, then your "SBCL_HOME" is
+    ##     "FOO/lib/sbcl".
+    ##
+    ##   * By command line option:
+    ##
+    ##         $ sbcl --core /bar/bar/sbcl.core
+
+    [lisp_prog=`echo $fricas_lisp | sed 's/ .*//'` # remove parameters
+     lisp_path=`which $lisp_prog` # cannot be empty
+     SBCL_HOME="${lisp_path%sbcl}../lib/sbcl"]
+)
+
+#AC_MSG_NOTICE([SBCL_HOME=$SBCL_HOME])
+AC_SUBST(SBCL_HOME)
+AC_SUBST(WEBSPAD_REQUIREMENTS)
+
 FRICAS_MAKEFILE([Makefile])
 FRICAS_MAKEFILE([src/Makefile])
 FRICAS_MAKEFILE([src/lib/Makefile])
Seulement dans .: hunchentoot_conf.patch
Seulement dans .: pre-gen
diff '--color=auto' -aur ../orig/fricas-1.3.9-pre/src/interp/Makefile.in ./src/interp/Makefile.in
--- ../orig/fricas-1.3.9-pre/src/interp/Makefile.in	2023-07-02 19:43:36.000000000 +0200
+++ ./src/interp/Makefile.in	2023-07-03 09:32:05.490570631 +0200
@@ -1,3 +1,6 @@
+WEBSPAD_REQUIREMENTS = @WEBSPAD_REQUIREMENTS@
+SBCL_HOME = @SBCL_HOME@
+export SBCL_HOME
 
 subdir = src/interp/
 
@@ -158,6 +161,7 @@
 	   '#+:cmu (setq *compile-verbose* nil)' \
 	   '#+:cmu (setq *compile-print* nil)' \
 	   '#+:cmu (declaim (optimize (ext:inhibit-warnings 3)))' \
+	   '${WEBSPAD_REQUIREMENTS}' \
 	   '#+:ecl(FRICAS-LISP::make-program "$(BASE)$@" nil)' \
 	   '#-:ecl(BOOT::spad-save "$(BASE)$@" t)' \
              | DAASE="$(BASE)$(fricas_targetdir)" ${BOOTSYS}

Reply via email to