Skip to content

Commit 3ff4a3a

Browse files
committed
Architecture specific library directories for Windows
1 parent e6e5502 commit 3ff4a3a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.Rhistory
33
.RData
44
.DS_Store
5+
src-i386/
6+
src-x64/

R/options.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ dllInfo <- NULL
1010
"Darwin" = "libtbb.dylib", "Linux" = "libtbb.so.2", "Windows" = "tbb.dll"
1111
)
1212
if (sysname %in% names(tbbSupported)) {
13-
dll <- system.file(paste("lib/", tbbSupported[[sysname]], sep = ""), package = "RcppParallel")
13+
libDir <- "lib/"
14+
if (sysname == "Windows")
15+
libDir <- paste(libDir, .Platform$r_arch, "/", sep="")
16+
dll <- system.file(paste(libDir, tbbSupported[[sysname]], sep = ""), package = "RcppParallel")
1417
if (!file.exists(dll)) {
1518
warning(paste("TBB library", dll, "not found."))
1619
} else {

src/Makevars

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ ifeq ($(USE_TBB), Windows)
4040
ifeq ("$(WIN)", "64")
4141
# TBB defaults to ia32
4242
MAKE_ARGS += arch=intel64
43+
ARCH_DIR="x64/"
44+
else
45+
ARCH_DIR="i386/"
4346
endif
4447

4548
# Linker needs access to the tbb dll; otherwise you get errors such as:
4649
# "undefined reference to `tbb::task_scheduler_init::terminate()'"
47-
PKG_LIBS += -L../inst/lib -ltbb
50+
PKG_LIBS += -L../inst/lib/$(ARCH_DIR) -ltbb
4851

4952
endif
5053

@@ -54,9 +57,9 @@ endif
5457
all: tbb $(SHLIB)
5558

5659
tbb:
57-
mkdir -p ../inst/lib
60+
mkdir -p ../inst/lib/$(ARCH_DIR)
5861
( cd tbb/src; make $(MAKE_ARGS) )
59-
cp tbb/build/lib_release/$(TBB_COPY_PATTERN) ../inst/lib
62+
cp tbb/build/lib_release/$(TBB_COPY_PATTERN) ../inst/lib/$(ARCH_DIR)
6063

6164
clean:
6265
(cd tbb/src; make clean)

0 commit comments

Comments
 (0)