all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kei Kebreau <kei@openmailbox.org>
To: Marius Bakke <mbakke@fastmail.com>
Cc: 27628@debbugs.gnu.org
Subject: [bug#27628] [PATCH 3/3] gnu: maxima: Ensure gcc and binutils	available at runtime.
Date: Mon, 24 Jul 2017 12:08:37 -0400	[thread overview]
Message-ID: <87bmo9u8ai.fsf@openmailbox.org> (raw)
In-Reply-To: <87h8y95ng2.fsf@fastmail.com> (Marius Bakke's message of "Wed, 19 Jul 2017 01:34:37 +0200")

[-- 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 --]

  parent reply	other threads:[~2017-07-24 18:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmo9u8ai.fsf@openmailbox.org \
    --to=kei@openmailbox.org \
    --cc=27628@debbugs.gnu.org \
    --cc=mbakke@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.