From e84e42428d16b7c881df5749fe6ab0a62352e17c Mon Sep 17 00:00:00 2001 From: david-cortes Date: Sat, 24 Jul 2021 22:58:06 +0300 Subject: [PATCH] Fix dynamic linkage on mac I think this should fix dynamic linkage for macOS, at least when using the clang compiler. Fixes #40 . --- R/02-flags.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/02-flags.r b/R/02-flags.r index c09fdb4..7e1e234 100644 --- a/R/02-flags.r +++ b/R/02-flags.r @@ -44,7 +44,7 @@ ldflags_string = function(static=FALSE) if (is.null(libfile)) stop(paste("unable to dynamically link: can't find any of:", paste(libfiles, collapse=", "))) - flags = paste0("-L", float_libs_dir, " ", float_libs_dir, "/", libfile, " -Wl,-rpath ", float_libs_dir) + flags = paste0("-L", float_libs_dir, " -l", gsub("\\.\\w+$", "", libfile), " -Wl,-rpath,", float_libs_dir) } else flags = paste0("-L", float_libs_dir, " -l:float.so -Wl,-rpath=", float_libs_dir)