all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to compile native?
@ 2021-04-06 23:10 Charles Direg
  2021-04-14 18:31 ` Joshua Branson
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Direg @ 2021-04-06 23:10 UTC (permalink / raw)
  To: help-guix

Hi,

How can I do a compilation of the packages natively?

What I mean is that, for example in Gentoo it can be used inside
/etc/portage/make.conf: CFLAGS="-O2 -march=native -mtune=native" Is that
possible in guix?

Thank you very much for your time, I will be waiting for your kind
responses.

Greetings.

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

* Re: How to compile native?
  2021-04-06 23:10 How to compile native? Charles Direg
@ 2021-04-14 18:31 ` Joshua Branson
  2021-04-14 18:45   ` Vincent Legoll
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Branson @ 2021-04-14 18:31 UTC (permalink / raw)
  To: Charles Direg; +Cc: help-guix

Charles Direg <carloshujara@gmail.com> writes:

> Hi,
>
> How can I do a compilation of the packages natively?

Yes this is possible!  You can disable substitutes to compile all
packages natively.

>
> What I mean is that, for example in Gentoo it can be used inside
> /etc/portage/make.conf: CFLAGS="-O2 -march=native -mtune=native" Is that
> possible in guix?

Currently guix does not support gentoo style flags..yet.  Though there
are talks to do something like that. If you wanted to compile packages
with specific compile flags, then you'll need to make custom package
definitions.

>
> Thank you very much for your time, I will be waiting for your kind
> responses.
>
> Greetings.

-- 
Joshua Branson (joshuaBPMan in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar
  


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

* Re: How to compile native?
  2021-04-14 18:31 ` Joshua Branson
@ 2021-04-14 18:45   ` Vincent Legoll
  2021-04-14 19:18     ` Xinglu Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Legoll @ 2021-04-14 18:45 UTC (permalink / raw)
  To: Charles Direg, help-guix

Hello,

On Wed, Apr 14, 2021 at 8:32 PM Joshua Branson <jbranso@dismail.de> wrote:
>
> Charles Direg <carloshujara@gmail.com> writes:
>
> > Hi,
> >
> > How can I do a compilation of the packages natively?
>
> Yes this is possible!  You can disable substitutes to compile all
> packages natively.

I think Charles meant compilation optimized for his actual processor
instead of being compatible with all x86_64. Like with the following
CFLAGS:

> > What I mean is that, for example in Gentoo it can be used inside
> > /etc/portage/make.conf: CFLAGS="-O2 -march=native -mtune=native"

I think there's no use of giving "-mtune" when you have "-march", c.f.:
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#index-march-14

> > Is that possible in guix?

I've heard it is, but not seen the recipe.

> Currently guix does not support gentoo style flags..yet.  Though there
> are talks to do something like that.

Gentoo use flags are something different, used to disable things in
packages.

> If you wanted to compile packages
> with specific compile flags, then you'll need to make custom package
> definitions.

That's probably what Charles wants, but in a global way, settings CFLAGS once
for the whole distro.

-- 
Vincent Legoll


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

* Re: How to compile native?
  2021-04-14 18:45   ` Vincent Legoll
@ 2021-04-14 19:18     ` Xinglu Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Xinglu Chen @ 2021-04-14 19:18 UTC (permalink / raw)
  To: Vincent Legoll, Charles Direg, help-guix

On Wed, Apr 14 2021, Vincent Legoll wrote:

>> If you wanted to compile packages with specific compile flags, then
>> you'll need to make custom package definitions.
>
> That's probably what Charles wants, but in a global way, settings
> CFLAGS once for the whole distro.

The manual mentions the ‘package-input-rewriting’ procedure in section
“8.3 Defining Package Variants”.  I guess you could write something like
this in a manifest file:

--8<---------------cut here---------------start------------->8---
(define custom-package
  (package
    (inherit some-package)
    ...))
    
(define package-custom-cflags
  ;; This is a procedure to replace SOME-PACKAGE by CUSTOM-PACKAGE
  ;; recursively.
  (package-input-rewriting `((,some-package . ,custom-package))))

(packages->manifest
  (map package-custom-cflags (list package1 package2 ...)))
--8<---------------cut here---------------end--------------->8---

Totally untested though.



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

end of thread, other threads:[~2021-04-14 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 23:10 How to compile native? Charles Direg
2021-04-14 18:31 ` Joshua Branson
2021-04-14 18:45   ` Vincent Legoll
2021-04-14 19:18     ` Xinglu Chen

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.