Skip to content

Commit 1a21781

Browse files
committed
tweak icc check
1 parent 229c08b commit 1a21781

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/config/configure.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
# defualt compiler unset
3+
define(COMPILER = "")
4+
25
# check whether user has Makevars file that might cause trouble
36
makevars <- Sys.getenv("R_MAKEVARS_USER", unset = "~/.R/Makevars")
47
if (file.exists(makevars)) {
@@ -29,16 +32,14 @@ candidates <- c("CXX11", "CXX1X", "CXX")
2932
for (candidate in candidates) {
3033
value <- r_cmd_config(candidate)
3134
if (!is.null(value)) {
35+
if (any(grepl("icpc", value))) {
36+
define(COMPILER = "icc")
37+
}
3238
cxx <- candidate
3339
break
3440
}
3541
}
3642

37-
# Check for the intel compiler
38-
if (any(grepl("icpc", cxx, fixed = TRUE))) {
39-
define(COMPILER = "icpc")
40-
}
41-
4243
# work around issue with '-Werror=format-security' being specified without
4344
# a prior '-Wformat', which makes gcc angry
4445
cxxflags <- read_r_config(sprintf("%sFLAGS", cxx), envir = NULL)[[1]]
@@ -121,7 +122,6 @@ if (getRversion() < "4.0") {
121122
}
122123

123124
# on Solaris, check if we're using gcc or g++
124-
define(COMPILER = "")
125125
if (Sys.info()[["sysname"]] == "SunOS") {
126126
cxx <- r_cmd_config("CXX")
127127
version <- system(paste(cxx, "--version"), intern = TRUE)

0 commit comments

Comments
 (0)