[R-pkg-devel] Reliably detecting FLIBS on source build of R (w.r.t Rust packages)

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Sun Jan 26 04:59:26 CET 2025


Naras,

sorry, but since this involves some Rust code, I fear that you'll have to discuss it with Brian directly. FWIW on the CRAN M1 build machine it seems to use the correct flags:

$ grep fortran/lib /Volumes/Builds/packages/big-sur-arm64/results/4.5/clarabel.Rcheck/00install.out 
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o clarabel.so init.o -L/Volumes/Builds/packages/big-sur-arm64/results/4.5/clarabel.Rcheck/00_pkg_src/clarabel/src/rust/target/release -lclarabel -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/14.2.0 -L/opt/gfortran/lib -lemutls_w -lheapt_w -lgfortran -lquadmath -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
$ R CMD config FLIBS
-L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/14.2.0 -L/opt/gfortran/lib -lemutls_w -lheapt_w -lgfortran -lquadmath

I have no idea why it would drop the arch+version specific path (which is the crucial one here - the /opt/gfortran/lib is just a generic fall-back that doesn't have any libraries in our setup).

Cheers,
Simon


> On Jan 26, 2025, at 5:54 AM, Balasubramanian Narasimhan <naras using stanford.edu> wrote:
> 
> I got the note below from Prof. Ripley on my package 'clarabel' failing 
> M1mac checks.
> 
> This puzzles me because I am using FLIBS determined via`R CMD config 
> FLIBS` using the crate I wrote for this very purpose 
> (https://github.com/blas-lapack-rs/r-src/blob/966266425b1a21a1e979f767c6023e6bf00616fc/build.rs#L160). 
> 
> 
> The only thing I can think of is that FLIBS is being set outside 
> config.site or Makevars during the R build.
> 
> What could I be missing? (As is remarked, the M1Mac/README.txt may not 
> be up to date re: toolchain details.)
> 
> Thank you.
> 
> -Naras
> 
>> Dear maintainer,
>> 
>> Please see the problems shown on
>> <https://cran.r-project.org/web/checks/check_results_clarabel.html>.
>> 
>> Please correct before 2025-02-08 to safely retain your package on CRAN.
>> 
>> There is a check service for M1mac issues: see
>> https://www.stats.ox.ac.uk/pub/bdr/M1mac/README.txt .
>> However, it is running a much older version of the OS
>> and toolchain -- and the latter often matters.
>> 
>> The CRAN Team
> 
> gfortran is not a system library everywhere so you need to use FLIBS. On 
> my macOS box that is
> 
> FLIBS =  -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/14.2.0 
> -L/opt/gfortran/lib -lemutls_w -lheapt_w -lgfortran -lquadmath
> 
> On CRAN distributions these libraries may be found in R_HOME/lib, but 
> not when building from sources.
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 



More information about the R-package-devel mailing list