GNU bug report logs - #60200
Incompatibilities between gcc-toolchain and R packages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Lars-Dominik Braun <lars@HIDDEN>; dated Mon, 19 Dec 2022 12:01:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 19 Dec 2022 12:00:29 +0000
From debbugs-submit-bounces <at> Mon Dec 19 07:00:28 2022
Received: from localhost ([]:38338
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1p7Eom-0005CQ-FL
	for submit <at>; Mon, 19 Dec 2022 07:00:28 -0500
Received: from ([]:45904)
 by with esmtp (Exim 4.84_2)
 (envelope-from <lars@HIDDEN>) id 1p7Eok-0005CK-Id
 for submit <at>; Mon, 19 Dec 2022 07:00:27 -0500
Received: from ([2001:470:142:3::10])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <lars@HIDDEN>) id 1p7Eoi-0002B0-Bx
 for bug-guix@HIDDEN; Mon, 19 Dec 2022 07:00:26 -0500
Received: from ([])
 by with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <lars@HIDDEN>) id 1p7Eof-0001DM-Gr
 for bug-guix@HIDDEN; Mon, 19 Dec 2022 07:00:23 -0500
Received: from (
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by (Postfix) with ESMTPS id 4NbJDN1tJ2z9sqw
 for <bug-guix@HIDDEN>; Mon, 19 Dec 2022 13:00:04 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=MBO0001;
Date: Mon, 19 Dec 2022 13:00:02 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
To: bug-guix@HIDDEN
Subject: Incompatibilities between gcc-toolchain and R packages
Message-ID: <Y6BSQpbK7BgW5Idk@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Rspamd-Queue-Id: 4NbJDN1tJ2z9sqw
Received-SPF: pass client-ip=; envelope-from=lars@HIDDEN;
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -2.6 (--)


I ran into issues with the package r-brms. Take the following reproducer as an example:

    $ guix shell r-brms r make sed gcc-toolchain bash -C --no-cwd --share=/tmp
	$ R
	> library(brms)
	> fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient), data = epilepsy, family = poisson())
	Compiling Stan program...
    Error in dyn.load(libLFile) :
	  unable to load shared object '/tmp/RtmpKqzbYg/':
	  /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/ version `GLIBCXX_3.4.29' not found (required by /tmp/RtmpKqzbYg/
	Error in sink(type = "output") : invalid connection

The same code works well with gcc-toolchain@10 instead of gcc-toolchain
(@12, which is the default). As we can see the generated shared library
above depends on GCC 12, 10 and GFortran 10 at the same time:

	$ ldd /tmp/RtmpKqzbYg/ | grep -e gcc -e fortran => /gnu/store/4zvswpr2h3b7dvqpvjcdam8vfhyjrmgl-gcc-12.2.0-lib/lib/ (0x00007f69bd9fc000) => /gnu/store/4zvswpr2h3b7dvqpvjcdam8vfhyjrmgl-gcc-12.2.0-lib/lib/ (0x00007f69bd898000) => /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/ (0x00007f69bd3e6000) => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/ (0x00007f69bd39b000) => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/ (0x00007f69bccf9000)

The command used to link that .so is revealed by strace to be (filenames
are random and may differ between runs):

	["g++", "-std=gnu++14", "-shared", "-L/gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib", "-L/usr/local/lib", "-o", "", "file3373276d0.o", "/gnu/store/5rdg6sv1nrg1ikqxcykvdh9g4yd2xjvy-r-rstan-2.21.7/site-library/rstan/lib//libStanServices.a", "-L/gnu/store/y7rvp47mz3hcnpvnqsx42qz5yvs10pnl-r-stanheaders-2.21.0-7/site-library/StanHeaders/lib/", "-lStanHeaders", "-L/gnu/store/01lhjrrkvrnsjd8xh4ssdn3bgxc422jl-r-rcppparallel-5.1.5/site-library/RcppParallel/lib/", "-ltbb", "-L/gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib", "-lR"]

So it links against libStanServices.a, libStanHeaders(.a), libtbb(.so) and
libR(.so) of which only libR has a reference to gfortran:

	$ ldd /gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib/ | grep -i fortran => /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/ (0x00007f5be49db000)

That means every software linking against R is also incompatible with
the current default gcc-toolchain (when using the command line or
specifications; different story when writing package recipes).

Possible solutions:

- Make gcc-toolchain@10 the default and rename gcc-toolchain@12 to
  gcc-toolchain-next@12, like we do for Haskell and (sometimes) Python.
- Update, both, the default GCC and GFortran to version 12.
- Explicitly depend on the correct gcc-toolchain in packages that need
  a compiler.


Acknowledgement sent to Lars-Dominik Braun <lars@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#60200; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 19 Dec 2022 12:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.