diff --git a/.Rbuildignore b/.Rbuildignore index 3912071b..e3cef9fd 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.github$ +^README\.md$ +^\.devcontainer$ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f746e555..2a0f7dbe 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,13 +1,55 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/r { - "name": "my-project-devcontainer", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", // Any generic, debian-based image. - "features": { - "ghcr.io/devcontainers/features/go:1": { - "version": "1.18" - }, - "ghcr.io/devcontainers/features/docker-in-docker:1": { - "version": "latest", - "moby": true - } - } + "name": "R (rocker/r-ver base)", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "ghcr.io/rocker-org/devcontainer/r-ver:4.3", //commma needed if other sections are used. + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + // if we want to install r packages using pak + // more info: https://github.com/rocker-org/devcontainer-features/blob/main/src/r-packages/README.md + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "make,gcc,g++,cmake,clang-tidy,clang-format,clang,doxygen,libxtst6,libxt6" + }, + "ghcr.io/rocker-org/devcontainer-features/r-packages:1": { + "packages": "methods,Rcpp,RInside,BH", + "installSystemRequirements": true + } + }, + // // if we want quarto cli + // more info: https://github.com/rocker-org/devcontainer-features/blob/main/src/quarto-cli/README.md + // "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {} + // }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "echo 'options(repos = c(CRAN = \"https://cloud.r-project.org\"))' | sudo sh -c 'cat - >>\"${R_HOME}/etc/Rprofile.site\"'", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + // Set *default* container specific settings.json values on container create. + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + // if we want liveshare. + "ms-vsliveshare.vsliveshare", + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "GitHub.codespaces", + "bbenoist.Doxygen", + "matepek.vscode-catch2-text-adapter", + "hbenl.vscode-test-explorer", + "reditorsupport.r", + "rdebugger.r-debugger", + "github.vscode-pull-request-github" + ] + } + + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } +} \ No newline at end of file diff --git a/.github/.gitignore b/.github/.gitignore index 2d19fc76..0b84df0f 100644 --- a/.github/.gitignore +++ b/.github/.gitignore @@ -1 +1 @@ -*.html +*.html \ No newline at end of file diff --git a/.gitignore b/.gitignore index 56843bca..f04aad11 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ src/*.o src/*.so src/*.dll +_builds/ +_install/ +.DS_Store \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d4d9cb5..b921f473 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,14 @@ ELSEIF(EXISTS ${R_USER}/Rcpp) SET(RCPP_INCLUDE ${RCPP_HOME}/include) include_directories("${RCPP_INCLUDE}") SET(_LIB_RCPP ${RCPP_HOME}/libs/Rcpp.so) - + +ELSEIF(EXISTS ${R_HOME}/site-library/Rcpp) + + SET(RCPP_HOME ${R_HOME}/site-library/Rcpp) + SET(RCPP_INCLUDE ${RCPP_HOME}/include) + include_directories("${RCPP_INCLUDE}") + SET(_LIB_RCPP ${RCPP_HOME}/libs/Rcpp.so) + ELSE() MESSAGE(FATAL_ERROR "Package Rcpp not found at ${R_HOME} or ${R_USER}") ENDIF() @@ -82,12 +89,17 @@ ELSEIF(EXISTS ${R_USER}/BH) SET(BOOST_HOME ${R_USER}/BH) SET(BOOST_INCLUDE ${BOOST_HOME}/include) include_directories("${BOOST_INCLUDE}") + +ELSEIF(EXISTS ${R_HOME}/site-library/BH) + + SET(BOOST_HOME ${R_HOME}/site-library/BH) + SET(BOOST_INCLUDE ${BOOST_HOME}/include) + include_directories("${BOOST_INCLUDE}") ELSE() MESSAGE(FATAL_ERROR "Package BH not found") ENDIF() - SET(LIB_DIR ${CMAKE_INSTALL_PREFIX}/libs) file(MAKE_DIRECTORY ${LIB_DIR}) @@ -111,7 +123,7 @@ link_directories(${R_HOME}/lib) include(GenerateExportHeader) include_directories("${CMAKE_CURRENT_BINARY_DIR}") -add_library(processR SHARED src/processR.cpp) +add_library(processR SHARED src/ProcessR.cpp) generate_export_header(processR) diff --git a/DESCRIPTION b/DESCRIPTION index e182a245..f361e1a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,18 +1,22 @@ Package: processR -Type: Package Title: Concurrent processing in R Version: 1.0 -Date: 2023-09-15 -Author: Matthew Supernaw -Maintainer: Matthew Supernaw +Authors@R: + person("Matthew", "Supernaw", , "matthew.supernaw@noaa.gov", role = c("aut", "cre")) Description: A multi-process package for R. License: GPL (>= 2) +URL: https://github.com/nmfs-fish-tools/processR +BugReports: https://github.com/nmfs-fish-tools/processR/issues Depends: - R (>= 4.0) + R (>= 4.0.0) Imports: - Rcpp (>= 1.0.10), - methods, - RInside, - BH -LinkingTo: Rcpp, RInside + BH, + methods, + Rcpp (>= 1.0.10), + RInside +LinkingTo: + Rcpp, + RInside +Encoding: UTF-8 RoxygenNote: 7.2.3 +SystemRequirements: C++17 diff --git a/README b/README.md similarity index 100% rename from README rename to README.md