Skip to content

Commit 298cef8

Browse files
committed
use resolved cmake path when checking cmake version
cmake is not necessarily on the PATH (e.g. on CRAN's macOS builders, where only /Applications/CMake.app/Contents/bin/cmake is available), so the version check must use the path resolved by configure. Also remove the vestigial CXX prefix / flags detection block; its consumers in src/Makevars.in were removed with the switch to the cmake-driven oneTBB build (fd8f510), and it probed R CMD config variables that are defunct in R (>= 4.6.0).
1 parent aa9c5e2 commit 298cef8

3 files changed

Lines changed: 15 additions & 81 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: RcppParallel
22
Type: Package
33
Title: Parallel Programming Tools for 'Rcpp'
4-
Version: 6.1.0.9000
4+
Version: 6.1.1
55
Authors@R: c(
66
person("Kevin", "Ushey", role = c("aut", "cre"), email = "kevin@rstudio.com",
77
comment = c(ORCID = "0000-0003-2880-7407")),

NEWS.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# RcppParallel (development version)
1+
# RcppParallel 6.1.1
2+
3+
* Fixed an issue where package installation could fail if `cmake` was not
4+
available on the `PATH`, even when it was discoverable at another known
5+
location (e.g. `/Applications/CMake.app/Contents/bin/cmake` on macOS).
6+
This caused installation failures on CRAN's macOS machines, where `cmake`
7+
is not on the `PATH` by default.
8+
9+
* Removed vestigial compiler / flag detection code from the configure
10+
script. This code has been unused since the switch to a cmake-driven
11+
build of the bundled oneTBB, and probed `R CMD config` variables that
12+
are defunct in R (>= 4.6.0).
213

314

415
# RcppParallel 6.1.0

tools/config/configure.R

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -26,84 +26,6 @@ if (file.exists(makevars)) {
2626
}
2727
}
2828

29-
# Figure out the appropriate CXX prefix for the current
30-
# version of R + configuration.
31-
cxx <- "/usr/bin/c++"
32-
candidates <- c("CXX11", "CXX1X", "CXX")
33-
for (candidate in candidates) {
34-
value <- r_cmd_config(candidate)
35-
if (!is.null(value)) {
36-
if (any(grepl("icpc", value))) {
37-
define(COMPILER = "icc")
38-
}
39-
cxx <- candidate
40-
break
41-
}
42-
}
43-
44-
# work around issue with '-Werror=format-security' being specified without
45-
# a prior '-Wformat', which makes gcc angry
46-
cxxflags <- read_r_config(sprintf("%sFLAGS", cxx), envir = NULL)[[1]]
47-
broken <-
48-
grepl(" -Werror=format-security ", cxxflags) &&
49-
!grepl(" -Wformat ", cxxflags)
50-
51-
if (broken)
52-
cxxflags <- gsub("-Werror=format-security", "-Wformat -Werror=format-security", cxxflags)
53-
54-
# add C++ standard if not set
55-
if (!grepl("-std=", cxxflags, fixed = TRUE)) {
56-
stdflag <- if (getRversion() < "4.0") {
57-
"-std=c++0x"
58-
} else {
59-
"$(CXX11STD)"
60-
}
61-
cxxflags <- paste(stdflag, cxxflags)
62-
}
63-
64-
# avoid including /usr/local/include, as this can cause
65-
# RcppParallel to find and use a version of libtbb installed
66-
# there as opposed to the bundled version
67-
cppflags <- read_r_config("CPPFLAGS", envir = NULL)[[1]]
68-
cppflags <- sub("(?: )?-I/usr/local/include", "", cppflags)
69-
cppflags <- sub("(?: )?-I/opt/homebrew/include", "", cppflags)
70-
cppflags <- sub("(?: )?-I/opt/local/libexec/onetbb/include", "", cppflags)
71-
72-
# define the set of flags appropriate to the current
73-
# configuration of R
74-
switch(
75-
cxx,
76-
77-
CXX11 = define(
78-
CC = "$(CC)",
79-
CPPFLAGS = cppflags,
80-
CXX11 = "$(CXX11)",
81-
CXX11FLAGS = cxxflags,
82-
CXX11STD = "$(CXX11STD)",
83-
CXX11PICFLAGS = "$(CXX11PICFLAGS)"
84-
),
85-
86-
CXX1X = define(
87-
CC = "$(CC)",
88-
CPPFLAGS = cppflags,
89-
CXX11 = "$(CXX1X)",
90-
CXX11FLAGS = cxxflags,
91-
CXX11STD = "$(CXX1XSTD)",
92-
CXX11PICFLAGS = "$(CXX1XPICFLAGS)"
93-
),
94-
95-
CXX = define(
96-
CC = "$(CC)",
97-
CPPFLAGS = cppflags,
98-
CXX11 = "$(CXX)",
99-
CXX11FLAGS = cxxflags,
100-
CXX11STD = "-std=c++0x",
101-
CXX11PICFLAGS = "-fPIC"
102-
),
103-
104-
stop("Failed to infer C / C++ compilation flags")
105-
)
106-
10729
# on Windows, check for Rtools; if it exists, and we have tbb, use it
10830
if (.Platform$OS.type == "windows") {
10931

@@ -324,7 +246,8 @@ if (is.na(tbbLib) && .Platform$OS.type != "windows") {
324246
})
325247

326248
# make sure we have an appropriate version of cmake installed
327-
output <- system("cmake --version", intern = TRUE)[[1L]]
249+
# (use the resolved path; cmake may not be on the PATH)
250+
output <- system(paste(shQuote(cmake), "--version"), intern = TRUE)[[1L]]
328251
cmakeVersion <- numeric_version(sub("cmake version ", "", output))
329252
if (cmakeVersion < "3.5") {
330253
stop("error: RcppParallel requires cmake (>= 3.6); you have ", cmakeVersion)

0 commit comments

Comments
 (0)