Scilab scientific software

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Nicolas Graves
  • Simon Tournier
Owner
unassigned
Submitted by
Nicolas Graves
Severity
normal
N
N
Nicolas Graves wrote on 1 Feb 2023 02:07
(address . guix-patches@gnu.org)
87h6w6tcqz.fsf@ngraves.fr
Hi guix!

I took a job where I have to use the scientific software suite Scilab in
an old version (5.4.1). I'll probably update it during this job.

I managed to package this version in the non-graphical version of Scilab
5.5.X versions this weekend.

It needs some old software libraries (metis@4, suitesparse@3), which
releases are not even in guix's history, and some compilation errors
fixes.

I go ahead and propose these patches in the next patches. I may continue
to work to propose updates up to the latest versions, but they need some
more work.

--
Best regards,
Nicolas Graves
N
N
Nicolas Graves wrote on 1 Feb 2023 02:12
[PATCH 1/6] gnu: matio: Add header file.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230201011215.13033-1-ngraves@ngraves.fr
* gnu/packages/maths.scm (matio):
[arguments] (phases): Add phase install-matioConfig.h.
---
gnu/packages/maths.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 4640237968..962b7d117c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5922,6 +5922,14 @@ (define-public matio
(base32
"0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
(build-system gnu-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'install 'install-matioConfig.h
+ (lambda _
+ (install-file "src/matioConfig.h"
+ (string-append #$output "/include")))))))
(inputs
(list zlib hdf5-1.8))
(home-page "http://matio.sourceforge.net/")
--
2.39.1
N
N
Nicolas Graves wrote on 1 Feb 2023 02:12
[PATCH 2/6] gnu: Add metis-4.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230201011215.13033-2-ngraves@ngraves.fr
* gnu/packages/maths.scm (metis-4): New variable.
---
gnu/packages/maths.scm | 48 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (61 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 962b7d117c..f00f4f58be 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4354,6 +4354,54 @@ (define-public metis
schemes.")
(license license:asl2.0))) ;As of version 5.0.3
+;; This outdated version contains only library and header files. It is used
+;; to build the scilab package.
+(define-public metis-4
+ (package
+ (inherit metis)
+ (name "metis")
+ (version "4.0.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
+ "metis-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0m8shi202vprs8d9l51178v0skngzgx81q0d9ln1ng3hh3g3byjy"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ;no tests
+ #:make-flags
+ #~(list "CC=gcc"
+ "AR=gcc -shared -o"
+ "RANLIB=touch"
+ "OPTFLAGS= -O3 "
+ "COPTIONS= -fPIC"
+ (string-append
+ "LDOPTIONS=-Wl,rpath," #$output "/lib")
+ "METISLIB=../libmetis.so")
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ ;; Make the library shared.
+ (lambda _
+ (substitute* "Lib/Makefile"
+ (("libmetis\\.a")
+ "libmetis.so"))
+ (chdir "Lib")))
+ (replace 'install
+ (lambda _
+ ;; Library
+ (chdir "..")
+ (install-file "libmetis.so"
+ (string-append #$output "/lib"))
+ ;; Includes
+ (for-each
+ (lambda (x)
+ (install-file x (string-append #$output "/include")))
+ (find-files "Lib" "\\.h$")))))))))
+
(define-public p4est
(package
(name "p4est")
--
2.39.1
N
N
Nicolas Graves wrote on 1 Feb 2023 02:12
[PATCH 3/6] gnu: Add suitesparse-3.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230201011215.13033-3-ngraves@ngraves.fr
* gnu/packages/maths.scm (suitesparse-3): New variable.
---
gnu/packages/maths.scm | 95 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)

Toggle diff (108 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index f00f4f58be..cc138de940 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5116,6 +5116,101 @@ (define-public suitesparse
;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
(license (list license:gpl2+ license:lgpl2.1+))))
+
+;; This outdated version is used to build the scilab package.
+(define-public suitesparse-3
+ (package
+ (inherit suitesparse)
+ (name "suitesparse")
+ (version "3.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0wxk755nzps0c9la24zqknqkzjp6rcj5q9jhd973mff1pqja3clz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;no "check" target
+ #:make-flags
+ ,#~(list
+ (string-append "CC=gcc")
+ "AR=gcc -shared -o"
+ "RANLIB=touch"
+ "CFLAGS=-O3 -fPIC -I../Include"
+ "TBB=-ltbb"
+ (string-append
+ "METIS=" (search-input-file %build-inputs "lib/libmetis.so"))
+ (string-append
+ "METIS_PATH="
+ (string-drop-right
+ (search-input-file %build-inputs "lib/libmetis.so")
+ (string-length "/lib/libmetis.so")))
+
+ ;; The default is to link against netlib lapack. Use OpenBLAS
+ ;; instead.
+ "BLAS=-lopenblas" "LAPACK=-lopenblas"
+
+ (string-append "INSTALL_LIB="
+ (assoc-ref %outputs "out") "/lib")
+ (string-append "INSTALL_INCLUDE="
+ (assoc-ref %outputs "out") "/include")
+ "library")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'correct-build-configuration
+ (lambda _
+ ;; Correct metis path.
+ (substitute* "CHOLMOD/Lib/Makefile"
+ (("\\$\\(METIS_PATH\\)\\/Lib")
+ "$(METIS_PATH)/include"))
+ ;; Invert build order: CHOLMOD before KLU.
+ (substitute* "Makefile"
+ (("\t\\( cd CHOLMOD ; \\$\\(MAKE\\) \\)\n$")
+ "")
+ (("\\( cd KLU ; \\$\\(MAKE\\) \\)")
+ (string-append "( cd CHOLMOD ; $(MAKE) )\n\t"
+ "( cd KLU ; $(MAKE) )")))
+ ;; Build shared libraries.
+ (substitute* (find-files "." "akefile$")
+ (("lib([a-z]+)\\.a" all libname)
+ (string-append "lib" libname ".so")))
+ ;; Delete broken KLU Demo step.
+ (substitute* "KLU/Makefile"
+ (("\\( cd Demo ; \\$\\(MAKE\\) \\)")
+ ""))))
+ (replace 'install
+ (lambda _
+ ;; Install libraries.
+ (for-each
+ (lambda (x)
+ (install-file
+ x
+ (string-append (assoc-ref %outputs "out") "/lib")))
+ (find-files "." "\\.so$"))
+ ;; Install header files.
+ (for-each
+ (lambda (x)
+ (install-file
+ x
+ (string-append (assoc-ref %outputs "out") "/include")))
+ (find-files "." "\\.h$"))))
+ ,@(if (target-riscv64?)
+ ;; GraphBLAS FTBFS on riscv64-linux
+ `((add-after 'unpack 'skip-graphblas
+ (lambda _
+ (substitute* "Makefile"
+ ((".*cd GraphBLAS.*") "")
+ (("metisinstall gbinstall moninstall")
+ "metisinstall moninstall")))))
+ '())
+ (delete 'configure)))) ;no configure script
+ (inputs
+ (list tbb openblas gmp mpfr metis-4))))
+
(define-public atlas
(package
(name "atlas")
--
2.39.1
N
N
Nicolas Graves wrote on 1 Feb 2023 02:12
[PATCH 5/6] gnu: scilab: Update to 5.5.1.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230201011215.13033-5-ngraves@ngraves.fr
* gnu/packages/maths.scm (scilab): Update to 5.5.1.
---
gnu/packages/maths.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 937c829a0b..5f944a1d50 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8324,7 +8324,7 @@ (define-public optizelle
(define-public scilab
(package
(name "scilab")
- (version "5.5.0")
+ (version "5.5.1")
(source
(origin
(method url-fetch)
@@ -8332,7 +8332,7 @@ (define-public scilab
(string-append "https://oos.eu-west-2.outscale.com/scilab-releases/"
version "/scilab-" version "-src.tar.gz"))
(sha256
- (base32 "1hx57aji5d78brwqcf8a34i1hasm3h4nw46xjg7cgxj09s8yz5kq"))))
+ (base32 "0ab7h0hdra4fjy505pivg6dbgcdxa4vd30g8gjhk8x7i28z24mn0"))))
(build-system gnu-build-system)
(native-inputs (list pkg-config gfortran))
(inputs (list libxml2
--
2.39.1
N
N
Nicolas Graves wrote on 1 Feb 2023 02:12
[PATCH 6/6] gnu: scilab: Update to 5.5.2.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230201011215.13033-6-ngraves@ngraves.fr
* gnu/packages/maths.scm (scilab): Update to 5.5.2.
---
gnu/packages/maths.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 5f944a1d50..bdc9e75498 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8324,7 +8324,7 @@ (define-public optizelle
(define-public scilab
(package
(name "scilab")
- (version "5.5.1")
+ (version "5.5.2")
(source
(origin
(method url-fetch)
@@ -8332,7 +8332,7 @@ (define-public scilab
(string-append "https://oos.eu-west-2.outscale.com/scilab-releases/"
version "/scilab-" version "-src.tar.gz"))
(sha256
- (base32 "0ab7h0hdra4fjy505pivg6dbgcdxa4vd30g8gjhk8x7i28z24mn0"))))
+ (base32 "0phg9pn24yw98hbh475ik84dnikf1225b2knh7qbhdbdx6fm2d57"))))
(build-system gnu-build-system)
(native-inputs (list pkg-config gfortran))
(inputs (list libxml2
--
2.39.1
L
L
Ludovic Courtès wrote on 11 Feb 2023 00:08
Re: bug#61204: Scilab scientific software
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 61204@debbugs.gnu.org)
87pmahnmp2.fsf@gnu.org
Hi Nicolas,

Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (3 lines)
> I took a job where I have to use the scientific software suite Scilab in
> an old version (5.4.1). I'll probably update it during this job.

Heh, congrats on the new job, and yay for free software! :-)

Toggle quote (11 lines)
> I managed to package this version in the non-graphical version of Scilab
> 5.5.X versions this weekend.
>
> It needs some old software libraries (metis@4, suitesparse@3), which
> releases are not even in guix's history, and some compilation errors
> fixes.
>
> I go ahead and propose these patches in the next patches. I may continue
> to work to propose updates up to the latest versions, but they need some
> more work.

Looks like we’re missing patch 4/6, which actually adds Scilab.

Did it get stuck on its way?

Ludo’.
N
N
Nicolas Graves wrote on 11 Feb 2023 11:09
[PATCH] gnu: Add scilab.
(address . 61204@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20230211100937.8616-1-ngraves@ngraves.fr
* gnu/packages/maths.scm (scilab): New variable.
---
gnu/packages/maths.scm | 106 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)

Toggle diff (116 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 741ecc2798..81dba14674 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8319,3 +8319,109 @@ (define-public optizelle
provided for applications written in C++ and Python. Parallel
computation is supported via MPI.")
(license license:bsd-2))))
+
+(define-public scilab
+ (package
+ (name "scilab")
+ (version "5.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "https://oos.eu-west-2.outscale.com/scilab-releases/"
+ version "/scilab-" version "-src.tar.gz"))
+ (sha256
+ (base32 "1hx57aji5d78brwqcf8a34i1hasm3h4nw46xjg7cgxj09s8yz5kq"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config gfortran))
+ (inputs (list libxml2
+ `(,pcre "bin")
+ `(,pcre "out")
+ readline
+ hdf5-1.8
+ curl
+ openblas
+ lapack
+ arpack-ng
+ fftw
+ gettext-minimal
+ suitesparse-3
+ tcl
+ tk
+ libx11
+ matio))
+ (arguments
+ `(#:tests? #f
+ #:configure-flags
+ ,#~(list
+ "--enable-relocatable"
+ "--disable-static-system-lib"
+ ;; Disable all java code.
+ "--without-gui"
+ "--without-javasci"
+ "--disable-build-help"
+ "--with-external-scirenderer"
+ ;; Tcl and Tk library locations.
+ (string-append "--with-tcl-include="
+ (string-drop-right
+ (search-input-file %build-inputs "include/tcl.h")
+ (string-length "/tcl.h")))
+ (string-append "--with-tcl-library="
+ (string-drop-right
+ (search-input-directory %build-inputs "lib/tcl8")
+ (string-length "/tcl8")))
+ (string-append "--with-tk-include="
+ (string-drop-right
+ (search-input-file %build-inputs "include/tk.h")
+ (string-length "/tk.h")))
+ (string-append "--with-tk-library="
+ (string-drop-right
+ (search-input-directory %build-inputs "lib/tk8.6")
+ (string-length "/tk8.6")))
+ ;; There are some 2018-fortran errors that are ignored
+ ;; with this fortran compiler flag.
+ "FFLAGS=-fallow-argument-mismatch")
+ #:phases
+ ,#~(modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Fix scilab script.
+ (substitute* "bin/scilab"
+ (("\\/bin\\/ls")
+ (which "ls")))
+ ;; Fix core.start.
+ (substitute* "modules/core/etc/core.start"
+ (("'SCI/modules")
+ "SCI+'/modules"))
+ ;; Fix fortran compilation error.
+ (substitute*
+ "modules/differential_equations/src/fortran/twodq.f"
+ (("node\\(10\\),node1\\(10\\),node2\\(10\\),coef")
+ "node(9),node1(9),node2(9),coef"))
+ ;; Fix C compilation errors.
+ ;; remove &
+ (substitute* "modules/hdf5/src/c/h5_readDataFromFile_v1.c"
+ (("(H5Rdereference\\(_iDatasetId, H5R_OBJECT, )&(.*)\\);$"
+ all common ref)
+ (string-append common ref)))
+ ;; fix multiple definitions
+ (substitute* "modules/tclsci/src/c/TCL_Command.h"
+ (("^__thread")
+ "extern __thread"))
+ (substitute* "modules/tclsci/src/c/InitTclTk.c"
+ (("BOOL TK_Started = FALSE;" all)
+ (string-append all "\n"
+ "__threadId TclThread;" "\n"
+ "__threadSignal InterpReady;" "\n"
+ "__threadSignalLock InterpReadyLock;"
+ "\n")))
+ ;; Set SCIHOME to /tmp before macros compilation.
+ (setenv "SCIHOME" "/tmp"))))))
+ (home-page "https://scilab.org")
+ (synopsis "Software for engineers and scientists")
+ (description "This package provides the non-graphical version of the Scilab
+software for engineers and scientists. Scilab is used for signal processing,
+statistical analysis, image enhancement, fluid dynamics simulations, numerical
+optimization, and modeling, simulation of explicit and implicit dynamical
+systems and symbolic manipulations.")
+ (license license:gpl2)))
--
2.39.1
N
N
Nicolas Graves wrote on 11 Feb 2023 11:11
Re: [bug#61204] Scilab scientific software
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 61204@debbugs.gnu.org)
87ttzsv7dt.fsf@ngraves.fr
On 2023-02-11 00:08, Ludovic Courtès wrote:

Toggle quote (2 lines)
> Heh, congrats on the new job, and yay for free software! :-)

Thanks!

Toggle quote (3 lines)
> Looks like we’re missing patch 4/6, which actually adds Scilab.
> Did it get stuck on its way?

Most likely yes, I've just resent this patch here.

--
Best regards,
Nicolas Graves
S
S
Simon Tournier wrote on 15 Feb 2023 16:57
86o7pudiqo.fsf@gmail.com
Hi,

On Wed, 01 Feb 2023 at 02:07, Nicolas Graves via Guix-patches via <guix-patches@gnu.org> wrote:

Toggle quote (3 lines)
> I took a job where I have to use the scientific software suite Scilab in
> an old version (5.4.1). I'll probably update it during this job.

Congrats!


Toggle quote (3 lines)
> I managed to package this version in the non-graphical version of Scilab
> 5.5.X versions this weekend.

Cool! Well, I was tweaking and reviewing the series when…

Toggle quote (4 lines)
> It needs some old software libraries (metis@4, suitesparse@3), which
> releases are not even in guix's history, and some compilation errors
> fixes.

…I see two issues about licenses:

1. Metis 4 is not free software
2. Scilab is Cecill v2.1 and not gpl2 as the patch suggests.

About #2, the fix is easy. :-)

About #1, it will be difficult.

Well, maybe these 3 old versions of Scilab could go to the channel
guix-science [1] or guix-science-non-free [2].

If Scilab 6 works with Metis 5, then there is no issue with the licenses
and could be included.

WDYT?


Cheers,
simon
L
L
Ludovic Courtès wrote on 16 Mar 2023 12:26
Re: bug#61204: Scilab scientific software
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87r0tpey2w.fsf_-_@gnu.org
Hi Nicolas,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

Toggle quote (9 lines)
> …I see two issues about licenses:
>
> 1. Metis 4 is not free software
> 2. Scilab is Cecill v2.1 and not gpl2 as the patch suggests.
>
> About #2, the fix is easy. :-)
>
> About #1, it will be difficult.

[...]

Toggle quote (3 lines)
> If Scilab 6 works with Metis 5, then there is no issue with the licenses
> and could be included.

Could you check whether using Metis 5 is possible, or whether Metis is
an optional dependency, or whether scotch:metis can be used (Scotch is
another graph partitioner with a Metis compatibility layer)?

TIA,
Ludo’.
N
N
Nicolas Graves wrote on 25 Mar 2023 15:15
[PATCH v2 1/3] gnu: matio: Add header file.
(address . 61204@debbugs.gnu.org)
20230325141522.28889-1-ngraves@ngraves.fr
* gnu/packages/maths.scm (matio):
[arguments] (phases): Add phase install-matioConfig.h.
---
gnu/packages/maths.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 93afc6ed40..5d8e2f0159 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -6056,6 +6056,14 @@ (define-public matio
(base32
"0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
(build-system gnu-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'install 'install-matioConfig.h
+ (lambda _
+ (install-file "src/matioConfig.h"
+ (string-append #$output "/include")))))))
(inputs
(list zlib hdf5-1.8))
(home-page "http://matio.sourceforge.net/")
--
2.39.2
N
N
Nicolas Graves wrote on 25 Mar 2023 15:15
[PATCH v2 2/3] gnu: Add suitesparse-3.
(address . 61204@debbugs.gnu.org)
20230325141522.28889-2-ngraves@ngraves.fr
* gnu/packages/maths.scm (suitesparse-3): New variable.
---
gnu/packages/maths.scm | 89 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)

Toggle diff (102 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 5d8e2f0159..be20e5b581 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5202,6 +5202,95 @@ (define-public suitesparse
;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
(license (list license:gpl2+ license:lgpl2.1+))))
+
+;; This outdated version is used to build the scilab package.
+(define-public suitesparse-3
+ (package
+ (inherit suitesparse)
+ (name "suitesparse")
+ (version "3.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0wxk755nzps0c9la24zqknqkzjp6rcj5q9jhd973mff1pqja3clz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;no "check" target
+ #:make-flags
+ ,#~(list
+ (string-append "CC=gcc")
+ "AR=gcc -shared -o"
+ "RANLIB=touch"
+ "CFLAGS=-O3 -fPIC -I../Include"
+ "TBB=-ltbb"
+
+ ;; Disable metis@4 (nonfree) support.
+ "CHOLMOD_CONFIG=-DNPARTITION"
+ "METIS="
+ "METIS_PATH="
+
+ ;; The default is to link against netlib lapack. Use OpenBLAS
+ ;; instead.
+ "BLAS=-lopenblas" "LAPACK=-lopenblas"
+
+ (string-append "INSTALL_LIB="
+ (assoc-ref %outputs "out") "/lib")
+ (string-append "INSTALL_INCLUDE="
+ (assoc-ref %outputs "out") "/include")
+ "library")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'correct-build-configuration
+ (lambda _
+ ;; Invert build order: CHOLMOD before KLU.
+ (substitute* "Makefile"
+ (("\t\\( cd CHOLMOD ; \\$\\(MAKE\\) \\)\n$")
+ "")
+ (("\\( cd KLU ; \\$\\(MAKE\\) \\)")
+ (string-append "( cd CHOLMOD ; $(MAKE) )\n\t"
+ "( cd KLU ; $(MAKE) )")))
+ ;; Build shared libraries.
+ (substitute* (find-files "." "akefile$")
+ (("lib([a-z]+)\\.a" all libname)
+ (string-append "lib" libname ".so")))
+ ;; Delete broken KLU Demo step.
+ (substitute* "KLU/Makefile"
+ (("\\( cd Demo ; \\$\\(MAKE\\) \\)")
+ ""))))
+ (replace 'install
+ (lambda _
+ ;; Install libraries.
+ (for-each
+ (lambda (x)
+ (install-file
+ x
+ (string-append (assoc-ref %outputs "out") "/lib")))
+ (find-files "." "\\.so$"))
+ ;; Install header files.
+ (for-each
+ (lambda (x)
+ (install-file
+ x
+ (string-append (assoc-ref %outputs "out") "/include")))
+ (find-files "." "\\.h$"))))
+ ,@(if (target-riscv64?)
+ ;; GraphBLAS FTBFS on riscv64-linux
+ `((add-after 'unpack 'skip-graphblas
+ (lambda _
+ (substitute* "Makefile"
+ ((".*cd GraphBLAS.*") "")
+ (("metisinstall gbinstall moninstall")
+ "moninstall")))))
+ '())
+ (delete 'configure)))) ;no configure script
+ (inputs
+ (list tbb openblas gmp mpfr))))
+
(define-public atlas
(package
(name "atlas")
--
2.39.2
N
N
Nicolas Graves wrote on 25 Mar 2023 15:15
[PATCH v2 3/3] gnu: Add scilab.
(address . 61204@debbugs.gnu.org)
20230325141522.28889-3-ngraves@ngraves.fr
* gnu/packages/maths.scm (scilab): New variable.
---
gnu/packages/maths.scm | 106 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)

Toggle diff (116 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index be20e5b581..2bebc51bf9 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8650,3 +8650,109 @@ (define-public optizelle
provided for applications written in C++ and Python. Parallel
computation is supported via MPI.")
(license license:bsd-2))))
+
+(define-public scilab
+ (package
+ (name "scilab")
+ (version "5.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "https://oos.eu-west-2.outscale.com/scilab-releases/"
+ version "/scilab-" version "-src.tar.gz"))
+ (sha256
+ (base32 "1hx57aji5d78brwqcf8a34i1hasm3h4nw46xjg7cgxj09s8yz5kq"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config gfortran))
+ (inputs (list libxml2
+ `(,pcre "bin")
+ `(,pcre "out")
+ readline
+ hdf5-1.8
+ curl
+ openblas
+ lapack
+ arpack-ng
+ fftw
+ gettext-minimal
+ suitesparse-3
+ tcl
+ tk
+ libx11
+ matio))
+ (arguments
+ `(#:tests? #f
+ #:configure-flags
+ ,#~(list
+ "--enable-relocatable"
+ "--disable-static-system-lib"
+ ;; Disable all java code.
+ "--without-gui"
+ "--without-javasci"
+ "--disable-build-help"
+ "--with-external-scirenderer"
+ ;; Tcl and Tk library locations.
+ (string-append "--with-tcl-include="
+ (string-drop-right
+ (search-input-file %build-inputs "include/tcl.h")
+ (string-length "/tcl.h")))
+ (string-append "--with-tcl-library="
+ (string-drop-right
+ (search-input-directory %build-inputs "lib/tcl8")
+ (string-length "/tcl8")))
+ (string-append "--with-tk-include="
+ (string-drop-right
+ (search-input-file %build-inputs "include/tk.h")
+ (string-length "/tk.h")))
+ (string-append "--with-tk-library="
+ (string-drop-right
+ (search-input-directory %build-inputs "lib/tk8.6")
+ (string-length "/tk8.6")))
+ ;; There are some 2018-fortran errors that are ignored
+ ;; with this fortran compiler flag.
+ "FFLAGS=-fallow-argument-mismatch")
+ #:phases
+ ,#~(modify-phases %standard-phases
+ (add-before 'build 'pre-build
+ (lambda _
+ ;; Fix scilab script.
+ (substitute* "bin/scilab"
+ (("\\/bin\\/ls")
+ (which "ls")))
+ ;; Fix core.start.
+ (substitute* "modules/core/etc/core.start"
+ (("'SCI/modules")
+ "SCI+'/modules"))
+ ;; Fix fortran compilation error.
+ (substitute*
+ "modules/differential_equations/src/fortran/twodq.f"
+ (("node\\(10\\),node1\\(10\\),node2\\(10\\),coef")
+ "node(9),node1(9),node2(9),coef"))
+ ;; Fix C compilation errors.
+ ;; remove &
+ (substitute* "modules/hdf5/src/c/h5_readDataFromFile_v1.c"
+ (("(H5Rdereference\\(_iDatasetId, H5R_OBJECT, )&(.*)\\);$"
+ all common ref)
+ (string-append common ref)))
+ ;; fix multiple definitions
+ (substitute* "modules/tclsci/src/c/TCL_Command.h"
+ (("^__thread")
+ "extern __thread"))
+ (substitute* "modules/tclsci/src/c/InitTclTk.c"
+ (("BOOL TK_Started = FALSE;" all)
+ (string-append all "\n"
+ "__threadId TclThread;" "\n"
+ "__threadSignal InterpReady;" "\n"
+ "__threadSignalLock InterpReadyLock;"
+ "\n")))
+ ;; Set SCIHOME to /tmp before macros compilation.
+ (setenv "SCIHOME" "/tmp"))))))
+ (home-page "https://scilab.org")
+ (synopsis "Software for engineers and scientists")
+ (description "This package provides the non-graphical version of the Scilab
+software for engineers and scientists. Scilab is used for signal processing,
+statistical analysis, image enhancement, fluid dynamics simulations, numerical
+optimization, and modeling, simulation of explicit and implicit dynamical
+systems and symbolic manipulations.")
+ (license license:gpl2)))
--
2.39.2
N
N
Nicolas Graves wrote on 25 Mar 2023 15:17
Re: [bug#61204] Scilab scientific software
(name . Ludovic Courtès)(address . ludo@gnu.org)
87bkkg3ofc.fsf@ngraves.fr
On 2023-03-16 12:26, Ludovic Courtès wrote:

Toggle quote (22 lines)
> Hi Nicolas,
>
> Simon Tournier <zimon.toutoune@gmail.com> skribis:
>
>> …I see two issues about licenses:
>>
>> 1. Metis 4 is not free software
>> 2. Scilab is Cecill v2.1 and not gpl2 as the patch suggests.
>>
>> About #2, the fix is easy. :-)
>>
>> About #1, it will be difficult.
>
> [...]
>
>> If Scilab 6 works with Metis 5, then there is no issue with the licenses
>> and could be included.
>
> Could you check whether using Metis 5 is possible, or whether Metis is
> an optional dependency, or whether scotch:metis can be used (Scotch is
> another graph partitioner with a Metis compatibility layer)?

Actually, I've seen that it's possible to compile Suitesparse@3 without
support for Metis@4. Scilab seems to work correctly, so I'll stop here
for this version ;)

I've just send a v2 patch thread.

Toggle quote (7 lines)
>
> TIA,
> Ludo’.
>
>
>

--
Best regards,
Nicolas Graves
L
L
Ludovic Courtès wrote on 30 Mar 2023 22:43
Re: [PATCH v2 3/3] gnu: Add scilab.
(name . Nicolas Graves)(address . ngraves@ngraves.fr)(address . 61204-done@debbugs.gnu.org)
87zg7uhswr.fsf@gnu.org
Hi Nicolas,

Nicolas Graves <ngraves@ngraves.fr> skribis:

Toggle quote (2 lines)
> * gnu/packages/maths.scm (scilab): New variable.

Applied all three patches with the license change below: I checked
‘COPYING’ and scanned a bunch of files, and it’s consistently
CeCILL v2.1.

Thanks!

Ludo’.
Toggle diff (10 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0d7035df4e..72dccd04bf 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8755,4 +8755,4 @@ (define-public scilab
statistical analysis, image enhancement, fluid dynamics simulations, numerical
optimization, and modeling, simulation of explicit and implicit dynamical
systems and symbolic manipulations.")
- (license license:gpl2)))
+ (license license:cecill))) ;CeCILL v2.1
Closed
S
S
Simon Tournier wrote on 3 Apr 2023 17:43
Re: [bug#61204] Scilab scientific software
(address . 61204@debbugs.gnu.org)
877cutezta.fsf@gmail.com
Hi,

On sam., 25 mars 2023 at 15:17, Nicolas Graves via Guix-patches via <guix-patches@gnu.org> wrote:

Toggle quote (4 lines)
> Actually, I've seen that it's possible to compile Suitesparse@3 without
> support for Metis@4. Scilab seems to work correctly, so I'll stop here
> for this version ;)

Cool!

Just a remark about [PATCH v2 3/3] gnu: Add scilab.

+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ version "/scilab-" version "-src.tar.gz"))
+ (sha256
+ (base32 "1hx57aji5d78brwqcf8a34i1hasm3h4nw46xjg7cgxj09s8yz5kq"))))

Is the URL stable? It looks like the Cloud solution of Dassault
Systèmes, right? Dassault Systèmes being the maintainer, right?

Well, the main development repository seems gitlab.com, right?


Why not rely on this gitlab.com URL? Tarball if the Git history of the
repository is too heavy. For example,


Although some files are only in the outscale link,

Toggle snippet (62 lines)
$ diff -r --no-dereference scilab-5.5.0-{1,2}
Only in scilab-5.5.0-1: ACKNOWLEDGEMENTS
Only in scilab-5.5.0-1: aclocal.m4
Only in scilab-5.5.0-1: bin
Only in scilab-5.5.0-1: build.incl.xml
Only in scilab-5.5.0-1: build.qa.incl.xml
Only in scilab-5.5.0-1: CHANGES_2.X
Only in scilab-5.5.0-1: CHANGES_3.X
Only in scilab-5.5.0-1: CHANGES_4.X
Only in scilab-5.5.0-1: CHANGES_5.0.X
Only in scilab-5.5.0-1: CHANGES_5.1.X
Only in scilab-5.5.0-1: CHANGES_5.2.X
Only in scilab-5.5.0-1: CHANGES_5.3.X
Only in scilab-5.5.0-1: CHANGES_5.4.X
Only in scilab-5.5.0-1: CHANGES_5.5.X
Only in scilab-5.5.0-1: checkstyle
Only in scilab-5.5.0-1: config
Only in scilab-5.5.0-1: configure
Only in scilab-5.5.0-1: configure.ac
Only in scilab-5.5.0-1: contrib
Only in scilab-5.5.0-1: COPYING
Only in scilab-5.5.0-1: COPYING-BSD
Only in scilab-5.5.0-1: COPYING-FR
Only in scilab-5.5.0-1: desktop
Only in scilab-5.5.0-1: etc
Only in scilab-5.5.0-2: git_hooks
Only in scilab-5.5.0-2: .gitignore
Only in scilab-5.5.0-1: GIT_info.incl
Only in scilab-5.5.0-1: libs
Only in scilab-5.5.0-1: license.txt
Only in scilab-5.5.0-1: locale
Only in scilab-5.5.0-1: m4
Only in scilab-5.5.0-1: Makefile.am
Only in scilab-5.5.0-1: Makefile.call_scilab.am
Only in scilab-5.5.0-1: Makefile.in
Only in scilab-5.5.0-1: Makefile.incl.am
Only in scilab-5.5.0-1: Makefile.incl.in
Only in scilab-5.5.0-1: modules
Only in scilab-5.5.0-1: README_Unix
Only in scilab-5.5.0-1: Readme_Visual.txt
Only in scilab-5.5.0-1: README_Windows.txt
Only in scilab-5.5.0-1: RELEASE_NOTES_5.0.X
Only in scilab-5.5.0-1: RELEASE_NOTES_5.1.X
Only in scilab-5.5.0-1: RELEASE_NOTES_5.2.X
Only in scilab-5.5.0-1: RELEASE_NOTES_5.3.X
Only in scilab-5.5.0-2: scilab
Only in scilab-5.5.0-1: Scilab_f2c.sln
Only in scilab-5.5.0-1: scilab-lib-doc.properties.in
Only in scilab-5.5.0-1: scilab-lib-doc.properties.vc
Only in scilab-5.5.0-1: scilab-lib.properties.in
Only in scilab-5.5.0-1: scilab-lib.properties.vc
Only in scilab-5.5.0-1: scilab.pc.in
Only in scilab-5.5.0-1: scilab.properties.in
Only in scilab-5.5.0-1: scilab.properties.vc
Only in scilab-5.5.0-1: Scilab.sln
Only in scilab-5.5.0-2: SEP
Only in scilab-5.5.0-1: SVN_revision.incl
Only in scilab-5.5.0-1: tools
Only in scilab-5.5.0-1: Version.incl
Only in scilab-5.5.0-1: Visual-Studio-settings

Ah, weird! :-)

Cheers,
simon
?