unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Todor Kondić" <tk.code@protonmail.com>
To: "help-guix\\@gnu.org" <help-guix@gnu.org>
Subject: Re: Why is gfortran at 7.5.0?
Date: Wed, 19 May 2021 09:35:21 +0000	[thread overview]
Message-ID: <VEzZBWYjMn0Pzo72yRnSKxhQCRJiGnQXvnzZ3UyLjypAfyKOgi73q63cPEnHycHG4qmXX1e_JEbjgO_kYJDx2psY1UI5RcbxbzAAL9qx-B0=@protonmail.com> (raw)
In-Reply-To: <YKPkDO3CIOVWxs9S@3900XT>

On Tuesday, May 18, 2021 5:58 PM, Efraim Flashner <efraim@flashner.co.il> wrote:

> On Tue, May 18, 2021 at 03:01:49PM +0000, Todor Kondić wrote:
>
> > Is there any particular reason gfortran toolchain is on v7.5.0 ? I see that gcc advanced to v11.
>
> We used to provide a number of gfortran packages but we discovered that
> they don't play nicely with packages built with other versions. We
> decided to keep gfortran at the same version as the default gcc version,
> although I don't remember why exactly.
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Efraim Flashner efraim@flashner.co.il אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted

---

Hi Efraim,

Thanks for clarification.

Well, it is a shame new versions of GFortran are not supported. This probably means that new hardware is not that well supported (not to mention tracking Fortran standards development).


Based on the practices Guix follows for other gcc versions, I came up with a package definition for fortran v9. Pasting it below in case someone needs it in future. It builds and installs fine, though I get warnings that collisions are detected for ld. Is this something to be concerned about? Normally, I'd make a guix environment or a profile which I'd populate with the same version of gcc and fortran toolchain, so I guess that would fix the warnings.

I won't post the package definition to patches mailing list because,
a) the package is trivial (thanks to previous work)
b) which compilers you decide to have included is probably a system level decision





### Fortran v9.3.0

```fortran
(use-modules (guix packages)
	     (guix inferior)
	     (guix channels)
	     (guix profiles)
	     (guix utils)
	     (guix build-system gnu)
	     (gnu packages commencement)
	     (gnu packages)
	     (gnu packages gcc)

             (srfi srfi-1))

(define %generic-search-paths
  ;; This is the language-neutral search path for GCC.  Entries in $CPATH are
  ;; not considered "system headers", which means GCC can raise warnings for
  ;; issues in those headers.  'CPATH' is the only one that works for
  ;; front-ends not in the C family.
  (list (search-path-specification
         (variable "CPATH")
         (files '("include")))
        (search-path-specification
         (variable "LIBRARY_PATH")
         (files '("lib" "lib64")))))
(define* (custom-gcc gcc name languages
                     #:optional
                     (search-paths (package-native-search-paths gcc))
                     #:key (separate-lib-output? #t))
  "Return a custom version of GCC that supports LANGUAGES.  Use SEARCH-PATHS
as the 'native-search-paths' field."
  (package (inherit gcc)
    (name name)
    (outputs (if separate-lib-output?
                 (package-outputs gcc)
                 (delete "lib" (package-outputs gcc))))
    (native-search-paths search-paths)
    (properties (alist-delete 'hidden? (package-properties gcc)))
    (arguments
     (substitute-keyword-arguments (package-arguments gcc)
       ((#:modules modules %gnu-build-system-modules)
        `(,@modules
          (srfi srfi-1)
          (srfi srfi-26)
          (ice-9 regex)))
       ((#:configure-flags flags)
        `(cons (string-append "--enable-languages="
                              ,(string-join languages ","))
               (remove (cut string-match "--enable-languages.*" <>)
                       ,flags)))
       ((#:phases phases)
        `(modify-phases ,phases
           (add-after 'install 'remove-broken-or-conflicting-files
             (lambda* (#:key outputs #:allow-other-keys)
               (for-each delete-file
                         (find-files (string-append (assoc-ref outputs "out") "/bin")
                                     ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
               #t))))))))

(define-public gfortran-9
  (hidden-package
   (custom-gcc (package
                 (inherit gcc-9)
                 ;; XXX: Remove LIBSTDC++-HEADERS from the inputs just to
                 ;; avoid a rebuild of all the GFORTRAN dependents.
                 ;; TODO: Remove this hack on the next rebuild cycle.
                 (inputs (alist-delete "libstdc++" (package-inputs gcc-9))))
               "gfortran" '("fortran")
               %generic-search-paths)))


;;; Try to make a more up-to-date gfortran package.
(define-public my-gfortran-toolchain
  (package (inherit (make-gcc-toolchain gfortran-9))
    (synopsis "Complete GCC tool chain for Fortran development")
    (description "This package provides a complete GCC tool chain for
Fortran development to be installed in user profiles.  This includes
gfortran, as well as libc (headers and binaries, plus debugging symbols
in the @code{debug} output), and binutils.")))


my-gfortran-toolchain

```




      reply	other threads:[~2021-05-19  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 15:01 Why is gfortran at 7.5.0? Todor Kondić
2021-05-18 15:58 ` Efraim Flashner
2021-05-19  9:35   ` Todor Kondić [this message]

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to='VEzZBWYjMn0Pzo72yRnSKxhQCRJiGnQXvnzZ3UyLjypAfyKOgi73q63cPEnHycHG4qmXX1e_JEbjgO_kYJDx2psY1UI5RcbxbzAAL9qx-B0=@protonmail.com' \
    --to=tk.code@protonmail.com \
    --cc=help-guix@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).