Skip to content

Commit

Permalink
Added CxxFlags internal function similar to RcppEigen to facilitate l…
Browse files Browse the repository at this point in the history
…inking with other packages
  • Loading branch information
cdeterman committed Jun 14, 2018
1 parent 3eb930b commit 80faef2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions R/flags.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

get_os <- function()
{
os = tolower(Sys.info()["sysname"])
names(os) = NULL

os
}

CxxFlags = function()
{
os = get_os()

libs_dir_rel = system.file("include", package="gpuR")
libs_dir = tools::file_path_as_absolute(libs_dir_rel)

if (os == "linux" || os == "freebsd")
flags = libs_dir
else{
dll.path <- normalizePath(libs_dir)
dll.path <- utils::shortPathName(dll.path)
flags <- gsub("\\\\", "/", dll.path)
}

cat(flags)
}

0 comments on commit 80faef2

Please sign in to comment.