Skip to content

Commit ef0aec1

Browse files
committed
set RPATH appropriately for Linux
1 parent 31e7d74 commit ef0aec1

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

RcppParallel.Rproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ RnwWeave: Sweave
1414
LaTeX: pdfLaTeX
1515

1616
AutoAppendNewline: Yes
17-
StripTrailingWhitespace: Yes
1817

1918
BuildType: Package
2019
PackageCleanBeforeInstall: No

src/Makevars.in

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

2+
# This needs to expand to something the shell will accept as '$ORIGIN',
3+
# including a literal '$' (no variable expansion)
4+
ORIGIN := \$$ORIGIN
5+
26
CMAKE = @CMAKE@
37
R = @R@
48

tools/config/configure.R

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,19 +237,21 @@ pkgLibs <- if (!is.na(tbbLib)) {
237237

238238
NULL
239239

240+
} else if (R.version$os == "emscripten") {
241+
242+
c(
243+
"-Wl,-Ltbb/build/lib_release",
244+
"-l$(TBB_NAME)"
245+
)
246+
240247
} else {
241-
if (R.version$os == "emscripten") {
242-
c(
243-
"-Wl,-Ltbb/build/lib_release",
244-
"-l$(TBB_NAME)"
245-
)
246-
} else {
247-
c(
248-
"-Wl,-Ltbb/build/lib_release",
249-
"-l$(TBB_NAME)",
250-
"-l$(TBB_MALLOC_NAME)"
251-
)
252-
}
248+
249+
c(
250+
"-Wl,-Ltbb/build/lib_release",
251+
"-l$(TBB_NAME)",
252+
"-l$(TBB_MALLOC_NAME)"
253+
)
254+
253255
}
254256

255257

@@ -300,13 +302,6 @@ if (is.na(tbbLib)) {
300302

301303
}
302304

303-
# set TBB_RPATH
304-
if (!is.na(tbbLib)) {
305-
define(TBB_RPATH = sprintf("-Wl,-rpath,%s", shQuote(tbbLib)))
306-
} else {
307-
define(TBB_RPATH = "")
308-
}
309-
310305

311306
# now, set up PKG_CPPFLAGS
312307
if (!is.na(tbbLib)) {
@@ -327,6 +322,9 @@ if (.Platform$OS.type == "windows" && is.na(tbbLib)) {
327322
# macOS needs some extra flags set
328323
if (Sys.info()[["sysname"]] == "Darwin") {
329324
define(PKG_LIBS_EXTRA = "-Wl,-rpath,@loader_path/../lib")
325+
} else if (Sys.info()[["sysname"]] == "Linux") {
326+
define(PKG_LIBS_EXTRA = "-Wl,-rpath,$(ORIGIN)/../lib")
330327
} else {
331328
define(PKG_LIBS_EXTRA = "")
329+
332330
}

0 commit comments

Comments
 (0)