1
1
2
2
PKG_CXXFLAGS = @CXX11STD@
3
3
4
+ # If TBB_LIB is defined by TBB_INC is not, make a guess.
5
+ ifdef TBB_LIB
6
+ ifndef TBB_INC
7
+ TBB_INC = $(TBB_LIB)/../include
8
+ endif
9
+ endif
10
+
4
11
ifdef TBB_INC
5
12
PKG_CPPFLAGS = -I../inst/include -I$(TBB_INC)
6
13
else
@@ -11,17 +18,13 @@ ifdef TBB_LIB
11
18
PKG_LIBS = -Wl,-L,"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc
12
19
endif
13
20
14
- ifeq ($(VERBOSE),)
15
- SILENT = -s
16
- endif
17
-
18
21
ifeq ($(OS), Windows_NT)
19
22
20
23
USE_TBB=Windows
21
24
TBB_COPY_PATTERN=tbb*.dll
22
25
23
26
MAKE = make
24
- MAKEFLAGS = -e $(SILENT) -j1
27
+ MAKEFLAGS = -e -j1
25
28
MAKE_CMD = \
26
29
MSYS2_ARG_CONV_EXCL="*" \
27
30
CYGWIN=nodosfilewarning \
36
39
37
40
UNAME := $(shell uname)
38
41
TBB_COPY_PATTERN=libtbb*.*
42
+
39
43
ifeq ($(UNAME), Darwin)
40
44
USE_TBB=Mac
41
45
endif
46
+
42
47
ifeq ($(UNAME), Linux)
43
48
USE_TBB=Linux
44
49
endif
50
+
45
51
ifeq ($(UNAME), SunOS)
46
52
SUNOS_ARCH = $(shell uname -p)
47
53
ifeq ($(SUNOS_ARCH), i386)
48
54
USE_TBB=SunOS
49
55
endif
50
56
endif
51
57
52
- MAKEFLAGS += -e $(SILENT)
58
+ MAKEFLAGS += -e
53
59
MAKE_CMD = \
54
60
CONLY="@CC@ $(PKG_CPPFLAGS) @CPPFLAGS@" \
55
61
CPLUS="@CXX11@ $(PKG_CPPFLAGS) @CPPFLAGS@" \
@@ -71,7 +77,7 @@ ifeq ($(USE_TBB), Windows)
71
77
# rtools: turn on hacks to compensate for make and shell differences rtools<=>MinGW
72
78
# compiler: overwrite default (which is cl = MS compiler)
73
79
MAKE_ARGS += rtools=true compiler=gcc
74
- ifeq (" $(WIN)", "64" )
80
+ ifeq ($(WIN), 64 )
75
81
MAKE_ARGS += arch=intel64 runtime=mingw
76
82
ARCH_DIR=x64/
77
83
else
@@ -93,15 +99,9 @@ ifeq ($(USE_TBB), SunOS)
93
99
endif
94
100
endif
95
101
96
- # Silence some compilation warnings. This is a dirty trick, but is necessary
97
- # as TBB uses a number of #pragmas and compiler-specific switches depending
98
- # on the compiler and machine being compiled for, and it selects and activates
99
- # those switches only after confirming the specific compiler features it needs.
100
- # Set VERBOSE=1 to have a more verbose install.
102
+ # Write compilation output to file, and log it if installation fails.
101
103
ifneq ($(OS), Windows_NT)
102
- ifeq ($(VERBOSE),)
103
- MAKE_ARGS += >/dev/null 2>&1
104
- endif
104
+ MAKE_ARGS += > tbb.log 2>&1 || cat tbb.log; rm -f tbb.log
105
105
endif
106
106
107
107
.PHONY: all tbb
113
113
ifdef TBB_LIB
114
114
echo "Using system (Intel/OneAPI) TBB library ..."; \
115
115
mkdir -p ../inst/lib/$(ARCH_DIR); \
116
- cp $(TBB_LIB)/libtbb.so ../inst/lib/$(ARCH_DIR)/libtbb.so 2>/dev/null || :; \
117
- cp $(TBB_LIB)/libtbbmalloc.so ../inst/lib/$(ARCH_DIR)/libtbbmalloc.so 2>/dev/null || :; \
116
+ ln -nfs $(TBB_LIB)/libtbb.so ../inst/lib/$(ARCH_DIR)/libtbb.so 2>/dev/null || :; \
117
+ ln -nfs $(TBB_LIB)/libtbbmalloc.so ../inst/lib/$(ARCH_DIR)/libtbbmalloc.so 2>/dev/null || :; \
118
118
rm -Rf ../inst/include/serial/; \
119
119
rm -Rf ../inst/include/tbb/; \
120
120
rm -Rf ../inst/include/tbb_local/; \
0 commit comments