Skip to content
Back to formatted view

Raw Message

Message-ID: <CALK03d2s7ssS9SELvLedHA0tUkcyqaEJu_0G9p7yAPtoM1WKzA@mail.gmail.com>
Date: 2025-04-14T12:10:56Z
From: Toby Hocking
Subject: R does not build with conda libcurl

Hi all,
I'm not sure if this is an issue with conda or R.
I expected that I should be able to build R from source, with a conda
environment active.
However, I observe that with conda 23.9.0, in an environment with libcurl
package installed, I get a link error.
The configure works fine:

(base) hoct2726 at dinf-thock-02i:~/R/R-4.5.0$ ./configure --prefix=$HOME
--with-cairo --with-blas --with-lapack --enable-R-shlib
--with-valgrind-instrumentation=2 --enable-memory-profiling
...
R is now configured for x86_64-pc-linux-gnu

  Source directory:            .
  Installation directory:      /home/local/USHERBROOKE/hoct2726

  C compiler:                  gcc -std=gnu2x  -g -O2
  Fortran fixed-form compiler: gfortran  -g -O2

  Default C++ compiler:        g++ -std=gnu++17  -g -O2
  Fortran free-form compiler:  gfortran  -g -O2
  Obj-C compiler:

  Interfaces supported:        X11, tcltk
  External libraries:          pcre2, readline, BLAS(generic),
LAPACK(generic), curl, libdeflate
  Additional capabilities:     PNG, JPEG, TIFF, NLS, cairo, ICU
  Options enabled:             shared R library, R profiling, memory
profiling, libdeflate for lazyload

  Capabilities skipped:
  Options not enabled:         shared BLAS

  Recommended packages:        yes



but I got an error from "make" --

(base) hoct2726 at dinf-thock-02i:~/R/R-4.5.0$ make
...
make[3] : on entre dans le r?pertoire
? /home/local/USHERBROOKE/hoct2726/R/R-4.5.0/src/main ?
gcc -std=gnu2x -I../../src/extra -I../../src/extra/xdr -I.
-I../../src/include -I../../src/include
-I/home/local/USHERBROOKE/hoct2726/miniconda3/include -I/usr/local/include
-I../../src/nmath -DHAVE_CONFIG_H   -fopenmp -fpic  -g -O2  -c Rmain.c -o
Rmain.o
gcc -std=gnu2x -Wl,--export-dynamic -fopenmp  -L"../../lib"
-L/usr/local/lib -o R.bin Rmain.o  -lR
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? ucol_setAttribute_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers ? ucol_close_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers ? ucol_open_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? uiter_setUTF8_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? ucol_getLocaleByType_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? ucol_setStrength_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? u_versionToString_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? ucol_strcollIter_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? uloc_setDefault_73 ?
/usr/bin/ld : ../../lib/libR.so : r?f?rence ind?finie vers
? u_getVersion_73 ?
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:150 : R.bin] Erreur 1
make[3] : on quitte le r?pertoire
? /home/local/USHERBROOKE/hoct2726/R/R-4.5.0/src/main ?
make[2]: *** [Makefile:141 : R] Erreur 2
make[2] : on quitte le r?pertoire
? /home/local/USHERBROOKE/hoct2726/R/R-4.5.0/src/main ?
make[1]: *** [Makefile:28 : R] Erreur 1
make[1] : on quitte le r?pertoire
? /home/local/USHERBROOKE/hoct2726/R/R-4.5.0/src ?
make: *** [Makefile:61 : R] Erreur 1


It seems that the libcurl package in conda provides the curl-config command
line program, which R is using to get this flag:
-I/home/local/USHERBROOKE/hoct2726/miniconda3/include
(it goes into CURL_CPPFLAGS variable in config.status)
To fix the build, I did "conda remove libcurl" and then "make clean" and
then "configure" and "make" worked.

It would be more user-friendly if the R build could "just work" even when
the user has activated a conda environment with libcurl package installed.
Is this an issue that R could fix?

Thanks
Toby

	[[alternative HTML version deleted]]