Skip to content

Commit

Permalink
Merge pull request #2 from nmfs-fish-tools/debug-rcmdcheck
Browse files Browse the repository at this point in the history
changes to r pkg, and cmake file
  • Loading branch information
msupernaw authored Oct 11, 2023
2 parents fcb2e1c + b766eda commit 297245f
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
^README\.md$
^\.devcontainer$
64 changes: 53 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion .github/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.html
*.html
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
src/*.o
src/*.so
src/*.dll
_builds/
_install/
.DS_Store
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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})

Expand All @@ -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)


Expand Down
24 changes: 14 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Authors@R:
person("Matthew", "Supernaw", , "[email protected]", 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
File renamed without changes.

0 comments on commit 297245f

Please sign in to comment.