Skip to content

Commit 969cfa6

Browse files
committed
fix compilation on Windows
1 parent 5f680ab commit 969cfa6

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

src/Makevars.in

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ifdef USE_TBB
8484
PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1
8585
PKG_CXXFLAGS += -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1
8686

87-
MAKE_ARGS := tbb_release tbbmalloc_release tbb_build_prefix=lib
87+
MAKE_TARGETS = tbb_build_prefix=lib tbb_release tbbmalloc_release
8888

8989
ifeq ($(USE_TBB), Windows)
9090

@@ -101,7 +101,7 @@ ifeq ($(USE_TBB), Windows)
101101

102102
# Linker needs access to the tbb dll; otherwise you get errors such as:
103103
# "undefined reference to `tbb::task_scheduler_init::terminate()'"
104-
PKG_LIBS += -L../inst/libs/$(ARCH_DIR) -ltbb -ltbbmalloc
104+
PKG_LIBS += -L$(shell pwd)/tbb/build/lib_release -ltbb -ltbbmalloc
105105

106106
endif
107107

@@ -113,15 +113,10 @@ ifeq ($(USE_TBB), SunOS)
113113
endif
114114
endif
115115

116-
# Override arch (mainly for arm64 macOS)
117-
ifneq ("$(ARCH)",)
118-
MAKE_ARGS += $(ARCH)
119-
endif
120-
121116
# Write compilation output to file, and log it if installation fails.
122117
ifeq ($(VERBOSE),)
123-
MAKE_ARGS += > tbb.log 2>&1 \
124-
&& echo "(tbb) TBB successfully built and installed." \
118+
MAKE_LOG = > tbb.log 2>&1 \
119+
&& echo "(tbb) TBB compilation finished successfully." \
125120
|| cat tbb.log; rm -f tbb.log
126121
endif
127122

@@ -138,17 +133,17 @@ $(OBJECTS): tbb
138133
# However, we need to copy headers here so that they are visible during compilation.
139134
tbb: tbb-clean
140135
ifdef TBB_LIB
141-
@echo "(tbb) Using system (Intel/OneAPI) TBB library ..."
136+
@echo "(tbb) Using system (Intel / OneAPI) TBB library."
142137
@echo "(tbb) TBB_LIB = $(TBB_LIB)"
143138
@echo "(tbb) TBB_INC = $(TBB_INC)"
144139
@mkdir -p ../inst/include
145140
@cp -R $(TBB_INC)/* ../inst/include/
146141
else
147-
@echo "(tbb) Using bundled TBB library ..."
142+
@echo "(tbb) Building TBB using bundled sources ..."
148143
@mkdir -p ../inst/include
149144
@cp -R tbb/include/* ../inst/include/
150-
@(cd tbb/src && $(MAKE_CMD) info)
151-
@(cd tbb/src && $(MAKE_CMD) @STDVER@ $(MAKE_ARGS))
145+
@(cd tbb/src && $(MAKE_CMD) $(MAKE_ARGS) info)
146+
@(cd tbb/src && $(MAKE_CMD) @STDVER@ $(MAKE_ARGS) $(MAKE_TARGETS) $(MAKE_LOG))
152147
endif
153148

154149
tbb-clean:
@@ -157,11 +152,11 @@ tbb-clean:
157152
@rm -rf ../inst/include/tbb_local
158153
@rm -rf ../inst/include/serial
159154

160-
clean:
155+
clean: tbb-clean
161156
ifdef TBB_LIB
162-
echo "Nothing to clean for TBB."
157+
@echo "Nothing to clean for TBB."
163158
else
164-
(cd tbb/src; make clean)
159+
@(cd tbb/src; make clean)
165160
endif
166161

167162

tools/config/configure.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ if (info[["sysname"]] == "Windows") {
7676

7777
}
7878

79-
# detect arm64 macOS
80-
if (info[["sysname"]] == "Darwin") {
81-
if (info[["machine"]] == "arm64") {
82-
define(ARCH = "arch=arm64")
83-
} else {
84-
define(ARCH = "")
85-
}
86-
}
8779
# use c++0x for compatibility with older compilers
8880
if (getRversion() < "4.0") {
8981
define(STDVER = "stdver=c++0x")

0 commit comments

Comments
 (0)