Skip to content

Commit

Permalink
fix #49, remove CXX specification
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyhanson authored Feb 14, 2024
1 parent 0929ef2 commit 4b11a57
Show file tree
Hide file tree
Showing 67 changed files with 257 additions and 275 deletions.
53 changes: 20 additions & 33 deletions .github/workflows/R-CMD-check-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,35 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- name: Install system dependencies
run: |
brew install gmp
brew install mpfr
brew install automake
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
any::rcmdcheck
any::covr
any::remotes
gurobi=?ignore
needs: |
check
coverage
- name: Install dependencies
run: |
options("install.packages.compile.from.source" = "never")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
options("install.packages.compile.from.source" = "yes")
remotes::install_cran("sf")
remotes::install_cran("RcppAlgos")
shell: Rscript {0}

Expand All @@ -83,19 +78,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: surveyvoi
Type: Package
Version: 1.0.5.1
Version: 1.0.6
Title: Survey Value of Information
Description: Decision support tool for prioritizing sites for ecological
surveys based on their potential to improve plans for conserving
Expand Down Expand Up @@ -74,7 +74,6 @@ License: GPL-3
LazyData: true
Language: en-US
SystemRequirements:
C++11,
JAGS (>= 4.3.0) (optional),
fftw3 (>= 3.3),
gmp (>= 6.2.1),
Expand All @@ -85,7 +84,7 @@ SystemRequirements:
URL: https://prioritizr.github.io/surveyvoi/
BugReports: https://github.com/prioritizr/surveyvoi/issues
VignetteBuilder: knitr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Encoding: UTF-8
Biarch: true
Collate:
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# surveyvoi 1.0.6

- Fix installation for Windows on arm64 (#50).
- Fix aliasing for package overview help file (#49).
- Remove CXX specification in Makevars to avoid NOTEs in package checks.

# surveyvoi 1.0.5.1

- Update citation.
Expand Down
2 changes: 1 addition & 1 deletion R/env_div_survey_scheme.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ NULL
#' install the [Gurobi optimization software](https://www.gurobi.com/) and the
#' \pkg{gurobi} R package because it can generate survey schemes much faster.
#' Note that special academic licenses are available at no cost.
#' Installation instructions are available online for [Linux](https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html), [Windows](https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html), and [Mac OS](https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html) operating systems.
#' Installation instructions are [available online for Linux, Windows, and Mac OS operating systems](https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer).
#'
#' @references
#' Faith DP & Walker PA (1996) Environmental diversity: on the best-possible
Expand Down
3 changes: 2 additions & 1 deletion R/feasible_survey_schemes.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ NULL
#' Please note that this function requires the Gurobi optimization software
#' (<https://www.gurobi.com/>) and the \pkg{gurobi} R package if different
#' sites have different survey costs. Installation instruction are available
#' online for for [Linux](https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html), [Windows](https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html), and [Mac OS](https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html).
#' online for Linux, Windows, and Mac OS
#' (see <https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer>).
#'
#' @examples
#' \dontrun{
Expand Down
16 changes: 12 additions & 4 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ NULL
#' @details
#' Please note that several functions depend on
#' the 'Gurobi' optimization software (available from <https://www.gurobi.com>)
#' and the \pkg{gurobi} R package (installation instructions available for
#' [Linux](https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html), [Windows](https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html), and [Mac OS](https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html)).
#' and the \pkg{gurobi} R package (installation instructions
#' [available online for Linux, Windows, and Mac OS](https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer)).
#' Additionally, the JAGS software
#' (available from <https://mcmc-jags.sourceforge.io/>) is required to fit
#' hierarchical generalized linear models.
Expand All @@ -38,8 +38,16 @@ NULL
#' (accessible using the code `vignettes("surveyvoi")`).
#'
#' @name surveyvoi
#' @docType package
NULL
#'
#' @aliases surveyvoi-package
#'
#' @author
#' Package authors:
#' * Jeffrey O. Hanson \email{[email protected]} [ORCID](https://orcid.org/0000-0002-4716-6134)
#' * Iadine Chadès \email{[email protected]} [ORCID](https://orcid.org/0000-0002-7442-2850)
#' * Emma J. Hudgins \email{[email protected]} [ORCID](https://orcid.org/0000-0002-8402-5111)
#' * Joseph R. Bennett \email{[email protected]} [ORCID](https://orcid.org/0000-0002-3901-9513)
"_PACKAGE"

# ensure package checks pass
#' @importFrom utils zip
Expand Down
66 changes: 14 additions & 52 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Dear CRAN volunteers,

Thank you very much for reviewing this submission. This submission aims to fix the issues causing the package to fail CRAN checks. Specifically, it fixes the compiler warnings (e.g., on Debian-clang flavor) and unit test errors (i.e., on Fedora flavors). I have also taken this opportunity to update the package to be compatible with the upcoming Matrix package (version >= 1.4-2), whilst maintaining backwards compatibility with previous versions.
Thank you for reviewing this submission. This submission contains updates for the _surveyvoi_ package to fix (i) aliasing for the package manual entry, (ii) uneeded C++11 specification, and (iii) installation for Windows on arm64 systems.

Cheers,

Expand All @@ -19,7 +19,7 @@ Jeff

# R CMD check results

0 errors | 0 warnings | 2 notes
0 errors | 0 warnings | 3 notes

# Notes

Expand All @@ -35,59 +35,21 @@ Jeff

**The package uses the gurobi R package that is distributed with Gurobi software suite (and not available on CRAN). The DESCRIPTION, README, and package documentation provide instructions for installing the gurobi R package.**

* Found the following (possibly) invalid URLs:
URL: https://doi.org/10.1111/1365-2664.14309
From: README.md
Status: 503
Message: Service Unavailable
* found the following (possibly) invalid URLs:
URL: https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer
From: man/approx_optimal_survey_scheme.Rd
man/env_div_survey_scheme.Rd
man/feasible_survey_schemes.Rd
man/geo_cov_survey_scheme.Rd
man/optimal_survey_scheme.Rd
man/surveyvoi.Rd
man/weighted_survey_scheme.Rd
inst/doc/surveyvoi.html
Status: 403
Message: Forbidden

**I have checked this URL and can confirm that it is valid.**

# System requirements

The package has system requirements. Some of these requirements are mandatory -- and are required for successful installation -- and others are optional. To ensure that all mandatory requirements are available on CRAN systems, I have checked the software installed on CRAN's various systems. Briefly, this information was obtained from the [Windows toolchain](https://github.com/r-windows/rtools-packages); [macOS toolchain](https://github.com/R-macos/recipes) toolchains; [rcheckserver Debian meta-package](https://statmath.wu.ac.at/AASC/debian/dists/stable/main/binary-amd64/Packages); and via correspondence with CRAN volunteers.

Below, I have provided a markdown table detailing whether each system requirement is optional or mandatory under various operating systems. I have also included details and URLs verifying the availability of mandatory system requirements on each of CRAN's systems. Where URLs are provided for certain software on certain operating systems (e.g., for gmpxx on Windows), the URL points directly to the source code for the relevant toolchain (e.g., the RTools for Windows) for including the software.

| Software | Debian | Fedora | Windows | macOS |
|:--------|:---------:|:--------:|:------:|:------:|
| JAGS (>= 4.3.0) | Optional | Optional |Optional | Optional |
| fftw3 (>= 3.3) | Mandatory (1) | Mandatory (1) | Mandatory (1) | Mandatory (1) |
| gmp (>= 6.2.1) | Mandatory (2) | Mandatory (3) | [Mandatory](https://statmath.wu.ac.at/AASC/debian/dists/stable/main/binary-amd64/Packages) | [Mandatory](https://github.com/r-windows/rtools-packages/blob/master/mingw-w64-gmp/PKGBUILD) | [Mandatory](https://github.com/r-windows/rtools-packages/blob/master/mingw-w64-gmp/PKGBUILD) | [Mandatory](https://github.com/R-macos/recipes/blob/master/recipes/gmp) |
| gmpxx (>= 6.2.1) | [Mandatory (2)](https://statmath.wu.ac.at/AASC/debian/dists/stable/main/binary-amd64/Packages) | Mandatory (3) | [Mandatory](https://github.com/r-windows/rtools-packages/blob/master/mingw-w64-gmp/PKGBUILD) | [Mandatory](https://github.com/R-macos/recipes/blob/master/recipes/gmp) |
| mpfr (>= 4.1.0) | [Mandatory (4)](https://statmath.wu.ac.at/AASC/debian/dists/stable/main/binary-amd64/Packages) | Mandatory (4) | [Mandatory](https://github.com/r-windows/rtools-packages/blob/master/mingw-w64-mpfr/PKGBUILD) | [Mandatory](https://github.com/R-macos/recipes/blob/master/recipes/mpfr) |
| autoconf (>= 2.69) | Optional | Optional | Optional | [Mandatory](https://github.com/R-macos/recipes/blob/master/recipes/autoconf) |
| automake (>= 1.16.5) | Optional | Optional | Optional | [Mandatory](https://github.com/R-macos/recipes/blob/master/recipes/automake) |

(1) This requirement is available on all of CRAN's servers because the PoissonBinomial R package relies on the fftw3 library as a system requirement and this package passes checks on all systems (see https://cran.r-project.org/package=PoissonBinomial).

(2) This requirement is available on CRAN's Debian server(s) because it is available via the Debian libgmp3-dev package, and this package is a dependency of the rcheckserver Debian meta-package.

(3) This requirement is available on CRAN's Fedora server(s) because Prof. Brian Ripely checked that that the gmp-devel RPM is available on each machine (i.e., https://fedora.pkgs.org/35/fedora-x86_64/gmp-devel-6.2.0-7.fc35.i686.rpm.html) (Prof Brian Ripley, personal communication, August 25, 2022).

(4) This requirement is available on all of CRAN's servers because the Rmpfr R package relies on the mpfr library as a system requirement and this package passes checks on all systems (see https://cran.r-project.org/package=Rmpfr).

# Downstream dependencies

There are no existing packages that depend on this package.

# Comments from CRAN volunteers on previous submissions

* Correct your SystemRequirements.

**Thanks for catching this. I have added the C++ bindings for the GMP library (i.e., gmpxx) to the SystemRequirements field, and updated the minimum versions number for gmp and gmpxx.**

* Correct your configure script (see 'Writing R Extensions' for recommendations for using autoconf to write a *reliable* script, including logging what it does).

**Thank you for the suggestion. I have updated the configure script to use autoconf and provide logging.**

* Inform the maintainers of binary packages, as this is a new
requirement on external software. It seems the macOS ones are not built
with C++ bindings (and you could and should have checked for yourself
from the published 'recipes' at https://github.com/R-macos/recipes).

**Thank you very much for this advice. I am sorry that I did not check these requirements prior to my previous submission. After submitting a pull request to the maintainer of the macOS binary package (https://github.com/R-macos/recipes/pull/19), the macOS libraries now include C++ bindings for GMP. I have also confirmed with the maintainer of the Windows binary packages that the C++ bindings for GMP are available via Rtools (https://github.com/rwinlib/utils/issues/1#issuecomment-912371834). Additionally, to ensure that outdated versions of GMP do not cause issues on Windows systems, the package now uses the RWinLib infrastructure to obtain recent versions of gmp and gmpxx (https://github.com/rwinlib/gmp), see `tools/winlibs.R`). Since the package passes checks on the WinBuilder and macOS builder platforms, I am hopeful that these issues have been resolved.**

* Please always add all authors, contributors and copyright holders in the Authors@R field with the appropriate roles. e.g.: Free Software Foundation, Inc. Please explain in the submission comments what you did about this issue.

**This comment was raised on a previous submission wherein the Free Software Foundation was listed as a copyright holder. Previously, the foundation was listed a copyright holder because the package contained a header file from the gmp library to help ensure that dependencies were available. Since the dependencies should now all be available on CRAN's systems, the header file has been removed and, as such, the foundation has been removed as a copyright holder.**
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b11a57

Please sign in to comment.