all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#27628] Fix compilation features of GCL and Maxima
@ 2017-07-09  1:12 Kei Kebreau
  2017-07-09  1:16 ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime Kei Kebreau
  0 siblings, 1 reply; 18+ messages in thread
From: Kei Kebreau @ 2017-07-09  1:12 UTC (permalink / raw)
  To: 27628

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

These patches are the best solution I've come upon so far to enable GCL
and Maxima to compile functions. The current issue is that GCL (and, by
proxy, Maxima) requires GCC to compile functions, but GCC and binutils
are not available to GCL at runtime. This issue in GCL causes issues in
Maxima (e.g. the graphing package "draw" does not function).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime.
  2017-07-09  1:12 [bug#27628] Fix compilation features of GCL and Maxima Kei Kebreau
@ 2017-07-09  1:16 ` Kei Kebreau
  2017-07-09  1:16   ` [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime." Kei Kebreau
                     ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-09  1:16 UTC (permalink / raw)
  To: 27628; +Cc: Kei Kebreau

* gnu/packages/lisp.scm (gcl)[arguments]: Add -fgnu89-inline to CFLAGS.
Add GCC path to make-flags. Modify 'pre-conf' phase. Add 'wrap' phase.
---
 gnu/packages/lisp.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index e92ae2ebf..6bd9e94a7 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -88,6 +88,10 @@
      `(#:parallel-build? #f  ; The build system seems not to be thread safe.
        #:tests? #f  ; There does not seem to be make check or anything similar.
        #:configure-flags '("--enable-ansi") ; required for use by the maxima package
+       #:make-flags (list
+                     "CFLAGS=-fgnu89-inline" ; removes inline function warnings
+                     (string-append "GCC=" (assoc-ref %build-inputs "gcc")
+                                    "/bin/gcc"))
        #:phases (modify-phases %standard-phases
                   (add-before 'configure 'pre-conf
                     (lambda _
@@ -104,6 +108,24 @@
                          (string-append "SHELL=" (which "bash")))
                         (("SHELL=/bin/sh")
                          (string-append "SHELL=" (which "sh"))))
+                      (substitute* "h/linux.defs"
+                        (("#CC") "CC")
+                        (("-fwritable-strings") "")
+                        (("-Werror") ""))
+                      #t))
+                  (add-after 'install 'wrap
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((gcl (assoc-ref outputs "out"))
+                             (input-path (lambda (lib path)
+                                           (string-append
+                                            (assoc-ref inputs lib) path)))
+                             (binaries  '("gcc" "ld-wrapper" "binutils")))
+
+                        (wrap-program (string-append gcl "/bin/gcl")
+                          `("PATH" prefix
+                            ,(map (lambda (binary)
+                                    (input-path binary "/bin"))
+                                  binaries))))
                       #t))
                   ;; drop strip phase to make maxima build, see
                   ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime."
  2017-07-09  1:16 ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime Kei Kebreau
@ 2017-07-09  1:16   ` Kei Kebreau
  2017-07-12 12:05     ` Ludovic Courtès
  2017-07-09  1:16   ` [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime Kei Kebreau
  2017-07-12 12:04   ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are " Ludovic Courtès
  2 siblings, 1 reply; 18+ messages in thread
From: Kei Kebreau @ 2017-07-09  1:16 UTC (permalink / raw)
  To: 27628; +Cc: Kei Kebreau

This reverts commit f2fa86cc82b5941bde63b666337eea59aa609e55.
---
 gnu/packages/maths.scm | 71 ++++++++++++++++++++++----------------------------
 1 file changed, 31 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1bf049fc4..0b738e6a2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2075,8 +2075,7 @@ to BMP, JPEG or PNG image formats.")
        (patches (search-patches "maxima-defsystem-mkdir.patch"))))
     (build-system gnu-build-system)
     (inputs
-     `(("gcc" ,gcc)
-       ("gcl" ,gcl)
+     `(("gcl" ,gcl)
        ("gnuplot" ,gnuplot)                       ;for plots
        ("tk" ,tk)))                               ;Tcl/Tk is used by 'xmaxima'
     (native-inputs
@@ -2098,44 +2097,36 @@ to BMP, JPEG or PNG image formats.")
        ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
        ;; Work around that.
        #:make-flags (list "TMPDIR=/tmp")
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'set-gcc-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "lisp-utils/defsystem.lisp"
-               (("\\(defparameter \\*c-compiler\\* \"gcc\"\\)")
-                (string-append "(defparameter *c-compiler* \""
-                               (assoc-ref inputs "gcc") "/bin/gcc\")")))
-             #t))
-         (add-before 'check 'pre-check
-           (lambda _
-             (chmod "src/maxima" #o555)
-             #t))
-         ;; Make sure the doc and emacs files are found in the
-         ;; standard location.  Also configure maxima to find gnuplot
-         ;; without having it on the PATH.
-         (add-after 'install 'post-install
-           (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let* ((gnuplot (assoc-ref inputs "gnuplot"))
-                    (out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/maxima/" ,version)))
-               (with-directory-excursion out
-                 (mkdir-p "share/emacs")
-                 (mkdir-p "share/doc")
-                 (symlink
-                  (string-append datadir "/emacs/")
-                  (string-append out "/share/emacs/site-lisp"))
-                 (symlink
-                  (string-append datadir "/doc/")
-                  (string-append out "/share/doc/maxima"))
-                 (with-atomic-file-replacement
-                  (string-append datadir "/share/maxima-init.lisp")
-                  (lambda (in out)
-                    (format out "~a ~s~a~%"
-                            "(setf $gnuplot_command "
-                            (string-append gnuplot "/bin/gnuplot") ")")
-                    (dump-port in out)))))
-             #t)))))
+       #:phases (alist-cons-before
+                 'check 'pre-check
+                 (lambda _
+                   (chmod "src/maxima" #o555))
+                 ;; Make sure the doc and emacs files are found in the
+                 ;; standard location.  Also configure maxima to find gnuplot
+                 ;; without having it on the PATH.
+                 (alist-cons-after
+                  'install 'post-install
+                  (lambda* (#:key outputs inputs #:allow-other-keys)
+                    (let* ((gnuplot (assoc-ref inputs "gnuplot"))
+                          (out (assoc-ref outputs "out"))
+                          (datadir (string-append out "/share/maxima/" ,version)))
+                      (with-directory-excursion out
+                        (mkdir-p "share/emacs")
+                        (mkdir-p "share/doc")
+                        (symlink
+                         (string-append datadir "/emacs/")
+                         (string-append out "/share/emacs/site-lisp"))
+                        (symlink
+                         (string-append datadir "/doc/")
+                         (string-append out "/share/doc/maxima"))
+                        (with-atomic-file-replacement
+                         (string-append datadir "/share/maxima-init.lisp")
+                         (lambda (in out)
+                           (format out "~a ~s~a~%"
+                                   "(setf $gnuplot_command "
+                                   (string-append gnuplot "/bin/gnuplot") ")")
+                           (dump-port in out))))))
+                  %standard-phases))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-09  1:16 ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime Kei Kebreau
  2017-07-09  1:16   ` [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime." Kei Kebreau
@ 2017-07-09  1:16   ` Kei Kebreau
  2017-07-12 12:06     ` Ludovic Courtès
  2017-07-12 12:07     ` Ludovic Courtès
  2017-07-12 12:04   ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are " Ludovic Courtès
  2 siblings, 2 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-09  1:16 UTC (permalink / raw)
  To: 27628; +Cc: Kei Kebreau

* gnu/packages/maths.scm (maxima)[arguments]: Use modify-phases syntax.
Modify 'post-install' phase.
---
 gnu/packages/maths.scm | 72 +++++++++++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0b738e6a2..cfc4cafd2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2097,36 +2097,48 @@ to BMP, JPEG or PNG image formats.")
        ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
        ;; Work around that.
        #:make-flags (list "TMPDIR=/tmp")
-       #:phases (alist-cons-before
-                 'check 'pre-check
-                 (lambda _
-                   (chmod "src/maxima" #o555))
-                 ;; Make sure the doc and emacs files are found in the
-                 ;; standard location.  Also configure maxima to find gnuplot
-                 ;; without having it on the PATH.
-                 (alist-cons-after
-                  'install 'post-install
-                  (lambda* (#:key outputs inputs #:allow-other-keys)
-                    (let* ((gnuplot (assoc-ref inputs "gnuplot"))
-                          (out (assoc-ref outputs "out"))
-                          (datadir (string-append out "/share/maxima/" ,version)))
-                      (with-directory-excursion out
-                        (mkdir-p "share/emacs")
-                        (mkdir-p "share/doc")
-                        (symlink
-                         (string-append datadir "/emacs/")
-                         (string-append out "/share/emacs/site-lisp"))
-                        (symlink
-                         (string-append datadir "/doc/")
-                         (string-append out "/share/doc/maxima"))
-                        (with-atomic-file-replacement
-                         (string-append datadir "/share/maxima-init.lisp")
-                         (lambda (in out)
-                           (format out "~a ~s~a~%"
-                                   "(setf $gnuplot_command "
-                                   (string-append gnuplot "/bin/gnuplot") ")")
-                           (dump-port in out))))))
-                  %standard-phases))))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda _
+             (chmod "src/maxima" #o555)
+             #t))
+         ;; Make sure the doc and emacs files are found in the
+         ;; standard location.  Also configure maxima to find gnuplot
+         ;; without having it on the PATH.
+         (add-after 'install 'post-install
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((gnuplot (assoc-ref inputs "gnuplot"))
+                    (out (assoc-ref outputs "out"))
+                    (datadir (string-append out "/share/maxima/" ,version))
+                    (input-path (lambda (lib path)
+                                  (string-append
+                                   (assoc-ref inputs lib) path)))
+                    (binaries '("gcc" "ld-wrapper" "binutils")))
+               (with-directory-excursion out
+                 (mkdir-p "share/emacs")
+                 (mkdir-p "share/doc")
+                 (symlink
+                  (string-append datadir "/emacs/")
+                  (string-append out "/share/emacs/site-lisp"))
+                 (symlink
+                  (string-append datadir "/doc/")
+                  (string-append out "/share/doc/maxima"))
+                 (with-atomic-file-replacement
+                  (string-append datadir "/share/maxima-init.lisp")
+                  (lambda (in out)
+                    (format out "~a ~s~a~%"
+                            "(setf $gnuplot_command "
+                            (string-append gnuplot "/bin/gnuplot") ")")
+                    (dump-port in out))))
+               ;; Ensure that Maxima will have access to GCC and its required
+               ;; components at runtime.
+               (wrap-program (string-append out "/bin/maxima")
+                 `("PATH" prefix
+                   ,(map (lambda (binary)
+                           (input-path binary "/bin"))
+                         binaries))))
+             #t)))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime.
  2017-07-09  1:16 ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime Kei Kebreau
  2017-07-09  1:16   ` [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime." Kei Kebreau
  2017-07-09  1:16   ` [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime Kei Kebreau
@ 2017-07-12 12:04   ` Ludovic Courtès
  2 siblings, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-12 12:04 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Kei Kebreau <kei@openmailbox.org> skribis:

> * gnu/packages/lisp.scm (gcl)[arguments]: Add -fgnu89-inline to CFLAGS.
> Add GCC path to make-flags. Modify 'pre-conf' phase. Add 'wrap' phase.
> ---
>  gnu/packages/lisp.scm | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> index e92ae2ebf..6bd9e94a7 100644
> --- a/gnu/packages/lisp.scm
> +++ b/gnu/packages/lisp.scm
> @@ -88,6 +88,10 @@
>       `(#:parallel-build? #f  ; The build system seems not to be thread safe.
>         #:tests? #f  ; There does not seem to be make check or anything similar.
>         #:configure-flags '("--enable-ansi") ; required for use by the maxima package
> +       #:make-flags (list
> +                     "CFLAGS=-fgnu89-inline" ; removes inline function warnings
> +                     (string-append "GCC=" (assoc-ref %build-inputs "gcc")
> +                                    "/bin/gcc"))
>         #:phases (modify-phases %standard-phases
>                    (add-before 'configure 'pre-conf
>                      (lambda _
> @@ -104,6 +108,24 @@
>                           (string-append "SHELL=" (which "bash")))
>                          (("SHELL=/bin/sh")
>                           (string-append "SHELL=" (which "sh"))))
> +                      (substitute* "h/linux.defs"
> +                        (("#CC") "CC")
> +                        (("-fwritable-strings") "")
> +                        (("-Werror") ""))
> +                      #t))
> +                  (add-after 'install 'wrap
> +                    (lambda* (#:key inputs outputs #:allow-other-keys)
> +                      (let* ((gcl (assoc-ref outputs "out"))
> +                             (input-path (lambda (lib path)
> +                                           (string-append
> +                                            (assoc-ref inputs lib) path)))
> +                             (binaries  '("gcc" "ld-wrapper" "binutils")))
> +
> +                        (wrap-program (string-append gcl "/bin/gcl")
> +                          `("PATH" prefix
> +                            ,(map (lambda (binary)
> +                                    (input-path binary "/bin"))
> +                                  binaries))))

Please add comments explaining why GCC and Binutils need to be available
at run time (and also libc and ld-wrapper?).  In the absence of an
explanation, my natural reaction would be to think this is a bug.  :-)

OK with this change, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime."
  2017-07-09  1:16   ` [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime." Kei Kebreau
@ 2017-07-12 12:05     ` Ludovic Courtès
  0 siblings, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-12 12:05 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Kei Kebreau <kei@openmailbox.org> skribis:

> This reverts commit f2fa86cc82b5941bde63b666337eea59aa609e55.

Please briefly explain why in the commit log (I assume that’s because
this is now done at the gcl level, right?).

OK with this change.

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-09  1:16   ` [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime Kei Kebreau
@ 2017-07-12 12:06     ` Ludovic Courtès
  2017-07-12 12:07     ` Ludovic Courtès
  1 sibling, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-12 12:06 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Kei Kebreau <kei@openmailbox.org> skribis:

> * gnu/packages/maths.scm (maxima)[arguments]: Use modify-phases syntax.
> Modify 'post-install' phase.

[...]

> +               ;; Ensure that Maxima will have access to GCC and its required
> +               ;; components at runtime.

Please explain why it’s necessary, and why the fact that gcl does the
same is insufficient.

Otherwise LGTM, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-09  1:16   ` [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime Kei Kebreau
  2017-07-12 12:06     ` Ludovic Courtès
@ 2017-07-12 12:07     ` Ludovic Courtès
  2017-07-12 23:31       ` Kei Kebreau
  1 sibling, 1 reply; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-12 12:07 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Kei Kebreau <kei@openmailbox.org> skribis:

> +               ;; Ensure that Maxima will have access to GCC and its required
> +               ;; components at runtime.

In fact, if it’s an optional feature, it would be better to take GCC &
co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
change.)

Thoughts?

Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-12 12:07     ` Ludovic Courtès
@ 2017-07-12 23:31       ` Kei Kebreau
  2017-07-17  8:19         ` Ludovic Courtès
  0 siblings, 1 reply; 18+ messages in thread
From: Kei Kebreau @ 2017-07-12 23:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Kei Kebreau <kei@openmailbox.org> skribis:
>
>> +               ;; Ensure that Maxima will have access to GCC and its required
>> +               ;; components at runtime.
>
> In fact, if it’s an optional feature, it would be better to take GCC &
> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
> change.)
>
> Thoughts?
>

I started on this patchset because Guix's Maxima cannot graph functions.
This feature relies on GCL's 'compile' function. The 'compile' function
seems to be a Common Lisp standard since at least the publication of the
CLtL2 standard. Maxima assumes (correctly) that this function is present
and relies on it for various base functionalities (compiling Maxima math
functions to compiled Lisp functions, graphing, etc.).

I turns out that fixing the underlying issue with GCL removes the need
for GCC's presence at runtime, but binutils is still necessary due to
Maxima using the 'compile' function from GCL directly. This stems from
the GCC package not finding the binutils at runtime, i.e.

    guix environment --pure --ad-hoc gcc -- gcc hello-world.c

returns

    gcc: error trying to exec 'as': execvp: No such file or directory

but

    guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c

compiles hello-world.c to its assembly language equivalent. Whether or
not this is intended is unclear to me. FWIW, if the GCC package itself
has access to the binutils at runtime, wrapping GCL and Maxima is unnecessary.

> Ludo’.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-12 23:31       ` Kei Kebreau
@ 2017-07-17  8:19         ` Ludovic Courtès
  2017-07-18 14:11           ` Kei Kebreau
  2017-07-25 13:13           ` bug#27628: " Kei Kebreau
  0 siblings, 2 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-17  8:19 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Hi Kei,

Kei Kebreau <kei@openmailbox.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Kei Kebreau <kei@openmailbox.org> skribis:
>>
>>> +               ;; Ensure that Maxima will have access to GCC and its required
>>> +               ;; components at runtime.
>>
>> In fact, if it’s an optional feature, it would be better to take GCC &
>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>> change.)
>>
>> Thoughts?
>>
>
> I started on this patchset because Guix's Maxima cannot graph functions.
> This feature relies on GCL's 'compile' function. The 'compile' function
> seems to be a Common Lisp standard since at least the publication of the
> CLtL2 standard. Maxima assumes (correctly) that this function is present
> and relies on it for various base functionalities (compiling Maxima math
> functions to compiled Lisp functions, graphing, etc.).

Good point, ‘compile’ is standard CL.

So yes, that alone is probably a good reason to keep references to GCC
and Binutils (maybe add a comment explaining this.)  Sorry for holding
it back!

> I turns out that fixing the underlying issue with GCL removes the need
> for GCC's presence at runtime, but binutils is still necessary due to
> Maxima using the 'compile' function from GCL directly. This stems from
> the GCC package not finding the binutils at runtime, i.e.
>
>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>
> returns
>
>     gcc: error trying to exec 'as': execvp: No such file or directory
>
> but
>
>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c

You would need ‘gcc-toolchain’ rather than ‘gcc’ here.

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-17  8:19         ` Ludovic Courtès
@ 2017-07-18 14:11           ` Kei Kebreau
  2017-07-18 14:53             ` Ludovic Courtès
  2017-07-25 13:13           ` bug#27628: " Kei Kebreau
  1 sibling, 1 reply; 18+ messages in thread
From: Kei Kebreau @ 2017-07-18 14:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Hi Kei,
>
> Kei Kebreau <kei@openmailbox.org> skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>
>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>> +               ;; components at runtime.
>>>
>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>> change.)
>>>
>>> Thoughts?
>>>
>>
>> I started on this patchset because Guix's Maxima cannot graph functions.
>> This feature relies on GCL's 'compile' function. The 'compile' function
>> seems to be a Common Lisp standard since at least the publication of the
>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>> and relies on it for various base functionalities (compiling Maxima math
>> functions to compiled Lisp functions, graphing, etc.).
>
> Good point, ‘compile’ is standard CL.
>
> So yes, that alone is probably a good reason to keep references to GCC
> and Binutils (maybe add a comment explaining this.)  Sorry for holding
> it back!
>
>> I turns out that fixing the underlying issue with GCL removes the need
>> for GCC's presence at runtime, but binutils is still necessary due to
>> Maxima using the 'compile' function from GCL directly. This stems from
>> the GCC package not finding the binutils at runtime, i.e.
>>
>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>
>> returns
>>
>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>
>> but
>>
>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>
> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>
> Thank you,
> Ludo’.

Is gcc-toolchain a package one can use as an input? lisp.scm fails to
load properly when I use the commencement.scm module. Could this be due
to the circular dependency problem mentioned in the "Commentary" section
of commencement.scm?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 14:11           ` Kei Kebreau
@ 2017-07-18 14:53             ` Ludovic Courtès
  2017-07-18 22:10               ` Kei Kebreau
  0 siblings, 1 reply; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-18 14:53 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Kei Kebreau <kei@openmailbox.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Hi Kei,
>>
>> Kei Kebreau <kei@openmailbox.org> skribis:
>>
>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>
>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>> +               ;; components at runtime.
>>>>
>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>> change.)
>>>>
>>>> Thoughts?
>>>>
>>>
>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>> seems to be a Common Lisp standard since at least the publication of the
>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>> and relies on it for various base functionalities (compiling Maxima math
>>> functions to compiled Lisp functions, graphing, etc.).
>>
>> Good point, ‘compile’ is standard CL.
>>
>> So yes, that alone is probably a good reason to keep references to GCC
>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>> it back!
>>
>>> I turns out that fixing the underlying issue with GCL removes the need
>>> for GCC's presence at runtime, but binutils is still necessary due to
>>> Maxima using the 'compile' function from GCL directly. This stems from
>>> the GCC package not finding the binutils at runtime, i.e.
>>>
>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>
>>> returns
>>>
>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>
>>> but
>>>
>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>
>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>
>> Thank you,
>> Ludo’.
>
> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
> load properly when I use the commencement.scm module. Could this be due
> to the circular dependency problem mentioned in the "Commentary" section
> of commencement.scm?

Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
‘gcc-toolchain’ is rather for users.

Thanks,
LUdo’.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 14:53             ` Ludovic Courtès
@ 2017-07-18 22:10               ` Kei Kebreau
  2017-07-18 23:34                 ` Marius Bakke
  2017-07-19  8:55                 ` Ludovic Courtès
  0 siblings, 2 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-18 22:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Kei Kebreau <kei@openmailbox.org> skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Hi Kei,
>>>
>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>
>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>
>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>> +               ;; components at runtime.
>>>>>
>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>> change.)
>>>>>
>>>>> Thoughts?
>>>>>
>>>>
>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>> seems to be a Common Lisp standard since at least the publication of the
>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>> and relies on it for various base functionalities (compiling Maxima math
>>>> functions to compiled Lisp functions, graphing, etc.).
>>>
>>> Good point, ‘compile’ is standard CL.
>>>
>>> So yes, that alone is probably a good reason to keep references to GCC
>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>> it back!
>>>
>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>
>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>
>>>> returns
>>>>
>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>
>>>> but
>>>>
>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>
>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>
>>> Thank you,
>>> Ludo’.
>>
>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>> load properly when I use the commencement.scm module. Could this be due
>> to the circular dependency problem mentioned in the "Commentary" section
>> of commencement.scm?
>
> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
> ‘gcc-toolchain’ is rather for users.

When I do this, GCL still gives me the

  "gcc: error trying to exec 'as': execvp: No such file or directory"

error if I don't wrap the binary with the binutils $PATH. The same has to
be done for Maxima. I'm trying to find a way to package GCL in such a
way that either (1) wrapping the GCL binary is unnecessary or (2)
wrapping the GCL binary and *only* the GCL binary is necessary for the
'compile' function to work.

>
> Thanks,
> LUdo’.

P.S. Sorry for dragging this out for so long. I'm just trying to
understand how I can minimize the package size of GCL-dependent packages.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 22:10               ` Kei Kebreau
@ 2017-07-18 23:34                 ` Marius Bakke
  2017-07-20  2:03                   ` Kei Kebreau
  2017-07-24 16:08                   ` Kei Kebreau
  2017-07-19  8:55                 ` Ludovic Courtès
  1 sibling, 2 replies; 18+ messages in thread
From: Marius Bakke @ 2017-07-18 23:34 UTC (permalink / raw)
  To: Kei Kebreau, Ludovic Courtès; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 3798 bytes --]

Kei Kebreau <kei@openmailbox.org> writes:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Kei Kebreau <kei@openmailbox.org> skribis:
>>
>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> Hi Kei,
>>>>
>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>
>>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>>
>>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>>
>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>> +               ;; components at runtime.
>>>>>>
>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>> change.)
>>>>>>
>>>>>> Thoughts?
>>>>>>
>>>>>
>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>
>>>> Good point, ‘compile’ is standard CL.
>>>>
>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>> it back!
>>>>
>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>
>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>
>>>>> returns
>>>>>
>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>
>>>>> but
>>>>>
>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>
>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>
>>>> Thank you,
>>>> Ludo’.
>>>
>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>> load properly when I use the commencement.scm module. Could this be due
>>> to the circular dependency problem mentioned in the "Commentary" section
>>> of commencement.scm?
>>
>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>> ‘gcc-toolchain’ is rather for users.
>
> When I do this, GCL still gives me the
>
>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>
> error if I don't wrap the binary with the binutils $PATH. The same has to
> be done for Maxima. I'm trying to find a way to package GCL in such a
> way that either (1) wrapping the GCL binary is unnecessary or (2)
> wrapping the GCL binary and *only* the GCL binary is necessary for the
> 'compile' function to work.

This is because GCC does not retain an absolute reference to binutils'
'as'. I came across this too in:

https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html

If you have some cycles to spare, it could be interesting to try and
use a GCC built with '--with-as=<absolute binutils path>'. E.g.

(define-public gcc-with-as
  (package
    (inherit gcc)
    (arguments
      `(,@(substitute-keyword-arguments (package-arguments grub)
            ((#:configure-flags flags ''())
            `(cons (string-append "--with-as="
                                  (assoc-ref %build-inputs "binutils")
                                  "/bin/as")
                   ,flags)))))))

(define-public gcl
  (package ...
    (native-inputs `(("gcc" ,gcc-with-as)))))

I've been meaning to try this a while, but you know... ;)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 22:10               ` Kei Kebreau
  2017-07-18 23:34                 ` Marius Bakke
@ 2017-07-19  8:55                 ` Ludovic Courtès
  1 sibling, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2017-07-19  8:55 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 27628

Hi Kei,

Kei Kebreau <kei@openmailbox.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>> load properly when I use the commencement.scm module. Could this be due
>>> to the circular dependency problem mentioned in the "Commentary" section
>>> of commencement.scm?
>>
>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>> ‘gcc-toolchain’ is rather for users.
>
> When I do this, GCL still gives me the
>
>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>
> error if I don't wrap the binary with the binutils $PATH. The same has to
> be done for Maxima.

Right, sorry for the confusion: you also need Binutils in $PATH.

> I'm trying to find a way to package GCL in such a way that either (1)
> wrapping the GCL binary is unnecessary or (2) wrapping the GCL binary
> and *only* the GCL binary is necessary for the 'compile' function to
> work.

Wrapping the ‘gcl’ binary alone is probably not enough, because a
program like Maxima compiled with ‘gcl’ does not invoke the ‘gcl’
binary.

Perhaps instead of wrapping we should patch references to “gcc” in the
source with their absolute file name or something along these lines?

Ludo’.

PS: Apologies for making hand-wavy comments and letting you do the
    actual work.  :-)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 23:34                 ` Marius Bakke
@ 2017-07-20  2:03                   ` Kei Kebreau
  2017-07-24 16:08                   ` Kei Kebreau
  1 sibling, 0 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-20  2:03 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 4168 bytes --]

Marius Bakke <mbakke@fastmail.com> writes:

> Kei Kebreau <kei@openmailbox.org> writes:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>
>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Hi Kei,
>>>>>
>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>
>>>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>>>
>>>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>>>
>>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>>> +               ;; components at runtime.
>>>>>>>
>>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>>> change.)
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>
>>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>>
>>>>> Good point, ‘compile’ is standard CL.
>>>>>
>>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>>> it back!
>>>>>
>>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>>
>>>>>> returns
>>>>>>
>>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>>
>>>>>> but
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>>
>>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>>
>>>>> Thank you,
>>>>> Ludo’.
>>>>
>>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>>> load properly when I use the commencement.scm module. Could this be due
>>>> to the circular dependency problem mentioned in the "Commentary" section
>>>> of commencement.scm?
>>>
>>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>>> ‘gcc-toolchain’ is rather for users.
>>
>> When I do this, GCL still gives me the
>>
>>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>>
>> error if I don't wrap the binary with the binutils $PATH. The same has to
>> be done for Maxima. I'm trying to find a way to package GCL in such a
>> way that either (1) wrapping the GCL binary is unnecessary or (2)
>> wrapping the GCL binary and *only* the GCL binary is necessary for the
>> 'compile' function to work.
>
> This is because GCC does not retain an absolute reference to binutils'
> 'as'. I came across this too in:
>
> https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html
>
> If you have some cycles to spare, it could be interesting to try and
> use a GCC built with '--with-as=<absolute binutils path>'. E.g.
>
> (define-public gcc-with-as
>   (package
>     (inherit gcc)
>     (arguments
>       `(,@(substitute-keyword-arguments (package-arguments grub)
>             ((#:configure-flags flags ''())
>             `(cons (string-append "--with-as="
>                                   (assoc-ref %build-inputs "binutils")
>                                   "/bin/as")
>                    ,flags)))))))
>
> (define-public gcl
>   (package ...
>     (native-inputs `(("gcc" ,gcc-with-as)))))
>
> I've been meaning to try this a while, but you know... ;)

I had the oppurtunity to try this earlier and gcc finds its assembler,
but not the linker! The package size increase is about 25% (255.9 MiB up
from 206.6 MiB). I'm going to look into this further.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-18 23:34                 ` Marius Bakke
  2017-07-20  2:03                   ` Kei Kebreau
@ 2017-07-24 16:08                   ` Kei Kebreau
  1 sibling, 0 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-24 16:08 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 27628

[-- Attachment #1: Type: text/plain, Size: 4508 bytes --]

Marius Bakke <mbakke@fastmail.com> writes:

> Kei Kebreau <kei@openmailbox.org> writes:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>
>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>
>>>>> Hi Kei,
>>>>>
>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>
>>>>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>>>>
>>>>>>> Kei Kebreau <kei@openmailbox.org> skribis:
>>>>>>>
>>>>>>>> + ;; Ensure that Maxima will have access to GCC and its required
>>>>>>>> +               ;; components at runtime.
>>>>>>>
>>>>>>> In fact, if it’s an optional feature, it would be better to take GCC &
>>>>>>> co. from $PATH, because GCC is a huge dependency.  (Same for the gcl
>>>>>>> change.)
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>
>>>>>> I started on this patchset because Guix's Maxima cannot graph functions.
>>>>>> This feature relies on GCL's 'compile' function. The 'compile' function
>>>>>> seems to be a Common Lisp standard since at least the publication of the
>>>>>> CLtL2 standard. Maxima assumes (correctly) that this function is present
>>>>>> and relies on it for various base functionalities (compiling Maxima math
>>>>>> functions to compiled Lisp functions, graphing, etc.).
>>>>>
>>>>> Good point, ‘compile’ is standard CL.
>>>>>
>>>>> So yes, that alone is probably a good reason to keep references to GCC
>>>>> and Binutils (maybe add a comment explaining this.)  Sorry for holding
>>>>> it back!
>>>>>
>>>>>> I turns out that fixing the underlying issue with GCL removes the need
>>>>>> for GCC's presence at runtime, but binutils is still necessary due to
>>>>>> Maxima using the 'compile' function from GCL directly. This stems from
>>>>>> the GCC package not finding the binutils at runtime, i.e.
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc hello-world.c
>>>>>>
>>>>>> returns
>>>>>>
>>>>>>     gcc: error trying to exec 'as': execvp: No such file or directory
>>>>>>
>>>>>> but
>>>>>>
>>>>>>     guix environment --pure --ad-hoc gcc -- gcc -S hello-world.c
>>>>>
>>>>> You would need ‘gcc-toolchain’ rather than ‘gcc’ here.
>>>>>
>>>>> Thank you,
>>>>> Ludo’.
>>>>
>>>> Is gcc-toolchain a package one can use as an input? lisp.scm fails to
>>>> load properly when I use the commencement.scm module. Could this be due
>>>> to the circular dependency problem mentioned in the "Commentary" section
>>>> of commencement.scm?
>>>
>>> Yeah, rather use gcc/ld-wrapper/glibc as inputs to avoid this problem.
>>> ‘gcc-toolchain’ is rather for users.
>>
>> When I do this, GCL still gives me the
>>
>>   "gcc: error trying to exec 'as': execvp: No such file or directory"
>>
>> error if I don't wrap the binary with the binutils $PATH. The same has to
>> be done for Maxima. I'm trying to find a way to package GCL in such a
>> way that either (1) wrapping the GCL binary is unnecessary or (2)
>> wrapping the GCL binary and *only* the GCL binary is necessary for the
>> 'compile' function to work.
>
> This is because GCC does not retain an absolute reference to binutils'
> 'as'. I came across this too in:
>
> https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01104.html
>
> If you have some cycles to spare, it could be interesting to try and
> use a GCC built with '--with-as=<absolute binutils path>'. E.g.
>
> (define-public gcc-with-as
>   (package
>     (inherit gcc)
>     (arguments
>       `(,@(substitute-keyword-arguments (package-arguments grub)
>             ((#:configure-flags flags ''())
>             `(cons (string-append "--with-as="
>                                   (assoc-ref %build-inputs "binutils")
>                                   "/bin/as")
>                    ,flags)))))))
>
> (define-public gcl
>   (package ...
>     (native-inputs `(("gcc" ,gcc-with-as)))))
>
> I've been meaning to try this a while, but you know... ;)

Based on playing around with this for a while, I'm concluding that the
core issue here is that the GCC binary from our GCC package for whatever
reason doesn't retain an absolute path to the GNU binutils binaries.

I have a hunch that Marius' solution could work, but I haven't been able
to get GCC to build with the necessary "--with-as" and "--with-ld" flags
yet. If no one has a better idea, I will push the 'binary-wrapping'
patches that at least get GCL and Maxima to compile things successfully.

Thanks to all involved,
Kei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* bug#27628: [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime.
  2017-07-17  8:19         ` Ludovic Courtès
  2017-07-18 14:11           ` Kei Kebreau
@ 2017-07-25 13:13           ` Kei Kebreau
  1 sibling, 0 replies; 18+ messages in thread
From: Kei Kebreau @ 2017-07-25 13:13 UTC (permalink / raw)
  To: 27628-done

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]

Changes pushed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-07-25 13:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-09  1:12 [bug#27628] Fix compilation features of GCL and Maxima Kei Kebreau
2017-07-09  1:16 ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are available at runtime Kei Kebreau
2017-07-09  1:16   ` [bug#27628] [PATCH 2/3] Revert "gnu: maxima: Ensure gcc is available at runtime." Kei Kebreau
2017-07-12 12:05     ` Ludovic Courtès
2017-07-09  1:16   ` [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils available at runtime Kei Kebreau
2017-07-12 12:06     ` Ludovic Courtès
2017-07-12 12:07     ` Ludovic Courtès
2017-07-12 23:31       ` Kei Kebreau
2017-07-17  8:19         ` Ludovic Courtès
2017-07-18 14:11           ` Kei Kebreau
2017-07-18 14:53             ` Ludovic Courtès
2017-07-18 22:10               ` Kei Kebreau
2017-07-18 23:34                 ` Marius Bakke
2017-07-20  2:03                   ` Kei Kebreau
2017-07-24 16:08                   ` Kei Kebreau
2017-07-19  8:55                 ` Ludovic Courtès
2017-07-25 13:13           ` bug#27628: " Kei Kebreau
2017-07-12 12:04   ` [bug#27628] [PATCH 1/3] gnu: gcl: Ensure gcc and binutils are " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.