-R does not seem to be an option for g++ or gcc anywhere. -R may be a linker option on some platforms that is equivalent of -rpath to gnu ld, ... This seems to be a known bug in boost builds ... have a look at Use -Wl to pass arguments to the linker.

It actually has the patch available there

I am re-posting it for convenience, however PLEASE PLEASE look at the original URL linked above for official patch!

--- ../gnote/m4/boost.m4    2011-01-25 14:30:18.000000000 +0200
+++ m4/boost.m4 2011-02-27 20:57:11.686221539 +0200
@@ -403,7 +403,7 @@
       LDFLAGS=$boost_save_LDFLAGS
       LIBS=$boost_save_LIBS
       if test x"$Boost_lib" = xyes; then
-        Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath"
+        Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"
         Boost_lib_LDPATH="$boost_ldpath"
         break 6
       else
Answer from Ahmed Masud on Stack Overflow
๐ŸŒ
Rdrr.io
rdrr.io โ€บ rforge โ€บ GCC โ€บ src โ€บ R โ€บ gcc.R
GCC source: R/gcc.R
rdrr.io Find an R package R language docs Run R in your browser ... Browse all... ... #' Genetic Correlation heterogeneity test for Causality (GCC) #' #' This function tests the difference between genetic correlation estimates #' reported by LD Score regression (LDSC), to infer causality.
Discussions

R Packages Fail to Compile with gcc - Stack Overflow
I downloaded bioconductor and attempted to install a package ("limma") which installed successfully, however when I tried to update bioconductor I keep getting errors relating to invalid compiler o... More on stackoverflow.com
๐ŸŒ stackoverflow.com
bash - Building R Packages using Alternate GCC - Stack Overflow
The systems I work with have GCC 4.5 (experimental) in /usr/local/bin/gcc which has proven to be problematic for some R packages. I would like to instead use system GCC in /usr/bin/gcc. I have tried More on stackoverflow.com
๐ŸŒ stackoverflow.com
cc/gcc -R flag to linker - Unix & Linux Stack Exchange
Reference: Weak symbol In the link the following linker option is mentioned: cc main.o -L`pwd` -Wl,-R`pwd` -lpowerslow -o main2 The purpose of all of the above flags have been documented in the GCC More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
February 13, 2025
Where is the gcc library link stored in Rstudio
I am working with a Rstudio installed on a Centos server. The default gcc is version 4.4.7 but the lubridate package needs a higher version. I now have one installed but Rstudio still is pointing to the old one. When I rโ€ฆ More on forum.posit.co
๐ŸŒ forum.posit.co
1
0
August 29, 2020
๐ŸŒ
GitHub
github.com โ€บ r-lib โ€บ rlang โ€บ issues โ€บ 754
issues with gcc 7.2 in the new version of R ยท Issue #754 ยท r-lib/rlang
April 2, 2019 - /usr/local/Cellar/gcc/7.2.0/bin/gcc-7 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./lib/ -I/usr/local/include -fPIC -Wall -g -O2 -c capture.c -o capture.o /bin/sh: /usr/local/Cellar/gcc/7.2.0/bin/gcc-7: No such file or directory make: *** [capture.o] Error 127 ERROR: compilation failed for package โ€˜rlangโ€™
Author ย  r-lib
๐ŸŒ
R-bloggers
r-bloggers.com โ€บ r bloggers โ€บ coping with varying `gcc` versions and capabilities in r packages
Coping with varying `gcc` versions and capabilities in R packages | R-bloggers
June 30, 2019 - I decided that the default code in the package would be for people with an up to date gcc and that the configure step would make alterations to the code for people with an old gcc. Hence, for people with an old gcc, configure needed to remove all of the C++ code that required C++ regex and then replace the body of the R function which .Call()ed that (now removed) C++ code with R code that performed the same function.
๐ŸŒ
Reddit
reddit.com โ€บ r โ€บ gcc
r/gcc
August 11, 2010 - r/gcc: Created by the GNU project GCC is a compiler system for C, C++, Objective-C, Fortran, Java, Ada, and Go.
Find elsewhere
๐ŸŒ
Rockefelleruniversity
rockefelleruniversity.github.io โ€บ Herper_Page โ€บ vignettes โ€บ SetupForOutdatedGCC.html
Reticulate and old GCC
March 29, 2022 - We use the reticulate package to allow Herper to communicate with conda through R. The reticulate package depends on the RcppTOML, which in turn require a GCC compiler that is >= 4.9. Though this GCC version was published in 2014, older systems may not have updated their GCC since prior to ...
๐ŸŒ
GNU
gcc.gnu.org โ€บ onlinedocs โ€บ gcc
Top (Using the GNU Compiler Collection (GCC))
This manual documents how to use the GNU compilers, as well as their features and incompatibilities, and how to report bugs. It corresponds to the compilers (GCC) version 17.0.0. The internals of the GNU compilers, including how to port them to new targets and some information about how to ...
๐ŸŒ
roryverse
rorynolan.rbind.io โ€บ 2019 โ€บ 06 โ€บ 30 โ€บ strexgcc
Coping with varying `gcc` versions and capabilities in R packages | roryverse
I decided that the default code in the package would be for people with an up to date gcc and that the configure step would make alterations to the code for people with an old gcc. Hence, for people with an old gcc, configure needed to remove all of the C++ code that required C++ regex and then replace the body of the R function which .Call()ed that (now removed) C++ code with R code that performed the same function.
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ GNU_Compiler_Collection
GNU Compiler Collection - Wikipedia
2 days ago - The GNU Compiler Collection (GCC; formerly GNU C Compiler) is a collection of compilers from the GNU Project that support various programming languages, hardware architectures, and operating systems.
๐ŸŒ
CRAN
cran.r-project.org โ€บ package=GCCfactor
GCCfactor: GCC Estimation of the Multilevel Factor Model
June 27, 2025 - Provides methods for model selection, estimation, inference, and simulation for the multilevel factor model, based on the principal component estimation and generalised canonical correlation approach.
Top answer
1 of 2
2

For GCC, this is just one option, not two:

-Wl,-R`pwd` 

The -Wl,<something> construct is used to pass the <something> part as option(s) to the linker (ld). In this case, it tells gcc to invoke ld as:

ld -R`pwd` <other parameters...>

And if you look at man ld in Linux, you'll find (emphasis mine):

-R filename

[...]

Read symbol names and their addresses from filename, but do not relocate it or include it in the output. This allows your output file to refer symbolically to absolute locations of memory defined in other programs. You may use this option more than once.

For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option.

And the -rpath option is:

-rpath=dir

Add a directory to the runtime library search path. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime. [...]

So the entire construct means "tell the runtime linker to search shared objects for linking in the current working directory".

The ld man page also notes:

The -rpath option may also be used on SunOS. By default, on SunOS, the linker will form a runtime search path out of all the -L options it is given. If a -rpath option is used, the runtime search path will be formed exclusively using the -rpath options, ignoring the -L options. This can be useful when using gcc, which adds many -L options which may be on NFS mounted file systems.

So, the overall goal for this option construct in e.g.

cc -g -c -o main.o main.c
cc -g -fpic -c -o power_slow.po power_slow.c
cc -shared -fpic -o libpowerslow.so power_slow.po
cc  main.o -L`pwd` -Wl,-R`pwd` -lpowerslow -o main

is to ensure the resulting main binary will search for libpowerslow.so only in the current working directory, so it will pick the exact version compiled by the third command, and not any other version of libpowerslow.so that might exist elsewhere on the system.

You should realize that while "baking in" the current working directory is useful with short-lived example binaries like the one built here, you should specify something else as the runtime library search path when building something to be installed for system-wide use.

2 of 2
0

From the ld manual page

-R filename
--just-symbols=filename
.....
For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option.

It means that the executable will add the current directory to the list of places that the runtime linker will search for shared libraries, which will help it locate the powerslow library.

It would be less confusing to use -rpath rather than -R.

๐ŸŒ
Posit Community
forum.posit.co โ€บ rstudio ide
Where is the gcc library link stored in Rstudio - RStudio IDE - Posit Community
August 29, 2020 - I am working with a Rstudio installed on a Centos server. The default gcc is version 4.4.7 but the lubridate package needs a higher version. I now have one installed but Rstudio still is pointing to the old one. When I run system2("gcc", "--version") in the console I get gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) But when I runR in the Rstudio terminal and then enter the system2 code I get gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) How do I change the gcc that Rstudio uses when it c...
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 71025101 โ€บ r-install-packages-unable-to-find-gcc
R install.packages unable to find gcc - Stack Overflow
February 7, 2022 - ** package 'jsonlite' successfully unpacked and MD5 sums checked ** using staged installation ** libs *** arch - i386 C:\Rtools\mingw_64gcc -I"C:/Users/<username>/DOCUME~1/R/R-41~1.2/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o sh: line 1: C:Rtoolsmingw_64gcc: command not found make: *** [C:/Users/<username>/DOCUME~1/R/R-41~1.2/etc/i386/Makeconf:238: base64.o] Error 127 ERROR: compilation failed for package 'jsonlite' * removing 'C:/Users/<username>/Documents/R/R-4.1.2/library/jsonlite' * restoring previou
๐ŸŒ
Arm Developer
developer.arm.com โ€บ downloads โ€บ - โ€บ gnu-rm
Downloads | GNU Arm Embedded Toolchain Downloads โ€“ Arm Developer
The GNU Arm Embedded Toolchain targets the 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families. The GNU Arm Embedded Toolchain includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux, and Mac OS X operating systems.
๐ŸŒ
GNU
gcc.gnu.org โ€บ onlinedocs
GCC online documentation - GNU Project
May 6, 2026 - GCC 16.1 GNU Offloading and Multi Processing Runtime Library Manual (also in PDF or PostScript or an HTML tarball)
๐ŸŒ
GitHub
github.com โ€บ gcc-mirror โ€บ gcc
GitHub - gcc-mirror/gcc ยท GitHub
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different ...
Starred by 11K users
Forked by 4.8K users
Languages ย  C++ 30.0% | C 29.4% | Ada 13.9% | D 5.9% | Go 5.2% | HTML 3.6%
๐ŸŒ
GitHub
github.com โ€บ gcc-mirror โ€บ gcc โ€บ releases
Releases ยท gcc-mirror/gcc
You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert ยท {{ message }} gcc-mirror / gcc Public mirror mirrored from git://gcc.gnu.org/git/gcc.git ยท
Author ย  gcc-mirror