Rcpp compilation error
0
0
Entering edit mode
@robert-k-bradley-5997
Last seen 8 months ago
United States

Hello,

I've encountered an error with Rcpp on Mac OS X (14.3.1, with the latest version of Xcode tools installed). Here is a reproducible example:

R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> setwd('/Users/rbradley')

> library (Rcpp)

library (Rcpp)

> sourceCpp ("bug.cpp")

sourceCpp ("bug.cpp")
using C++ compiler: 'Apple clang version 15.0.0 (clang-1500.3.9.4)'
using SDK: 'MacOSX14.4.sdk'
clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I"/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include" -I"/Users/rbradley" -I/opt/R/arm64/include    -fPIC  -mtune=core2  -O0  -g   -c bug.cpp -o bug.o
clang: error: unsupported argument 'core2' to option '-mtune='
make: *** [bug.o] Error 1
Error in sourceCpp("bug.cpp") : Error 1 occurred building shared library.
> sessionInfo()

sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.3.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] grDevices utils     datasets  stats     graphics  methods   base     

other attached packages:
[1] Rcpp_1.0.12    dplyr_1.1.4    tidyr_1.3.1    readr_2.1.5    tibble_3.2.1   magrittr_2.0.3

loaded via a namespace (and not attached):
 [1] utf8_1.2.4       R6_2.5.1         tidyselect_1.2.0 tzdb_0.4.0       glue_1.7.0       pkgconfig_2.0.3  generics_0.1.3   lifecycle_1.0.4  cli_3.6.2        fansi_1.0.6     
[11] vctrs_0.6.5      compiler_4.3.3   tools_4.3.3      purrr_1.0.2      hms_1.1.3        pillar_1.9.0     rlang_1.1.3

The contents of the example file bug.cpp are:

#include <Rcpp.h>

using namespace Rcpp;

1;

I would be grateful for any help! I have used Rcpp extensively in the past but not in approximately one year, so I'm unsure when this compilation problem appeared.

Thank you, Rob

Release Rcpp • 595 views
ADD COMMENT
0
Entering edit mode

Since this is not a Bioconductor package it should be posted at StackOverflow.

ADD REPLY

Login before adding your answer.

Traffic: 633 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6