working on R dist

This commit is contained in:
Charlton, Scott R 2022-03-26 09:58:00 -07:00
parent 6d34a2a8cb
commit 42cd779af8
5 changed files with 119 additions and 39 deletions

27
.gitignore vendored
View File

@ -21,23 +21,24 @@
/libx64 /libx64
/x64 /x64
# dist files
**/*.dist
doc/NOTICE
doc/README
doc/RELEASE
# TIMESTAMP files
**/*.TIMESTAMP
# /R/ # /R/
/R/Amm.ascii /R/*.tar.gz
/R/iso.ascii /R/*.ascii
/R/llnl.ascii
/R/minteq.ascii
/R/minteq.v4.ascii
/R/phreeqc.ascii
/R/pitzer.ascii
/R/sit.ascii
/R/wateq4f.ascii
/R/phreeqc.Rcheck
/R/build-databases.Rout
/R/build-examples.Rout
/R/.RData /R/.RData
/R/*.Rout
/R/phreeqc.Rcheck
# /R/phreeqc/ # /R/phreeqc/
/R/phreeqc/NAMESPACE /R/phreeqc
# /R/phreeqc/data/ # /R/phreeqc/data/
/R/phreeqc/data/csv.RData /R/phreeqc/data/csv.RData

View File

@ -1,18 +1,18 @@
Package: phreeqc Package: phreeqc
Version: @VERSION@
Title: R Interface to Geochemical Modeling Software Title: R Interface to Geochemical Modeling Software
Version: @VERSION@
License: GPL-3 License: GPL-3
NeedsCompilation: yes NeedsCompilation: yes
Depends: Depends: R (>= 3.5.0)
R (>= 3.0) Author: S.R. Charlton [aut, cre], D.L. Parkhurst [aut], and C.A.J. Appelo [aut], with contributions
Author: S.R. Charlton, D.L. Parkhurst, and C.A.J. Appelo, with contributions from D. Gillespie [ctb] for Chipmunk BASIC and S.D. Cohen [ctb], A.C. Hindmarsh [ctb],
from D. Gillespie for Chipmunk BASIC and S.D. Cohen, A.C. Hindmarsh, R. Serban [ctb], D. Shumaker [ctb], and A.G. Taylor [ctb] for CVODE/SUNDIALS
R. Serban, D. Shumaker, and A.G. Taylor for CVODE/SUNDIALS
URL: https://www.usgs.gov/software/phreeqc-version-3 URL: https://www.usgs.gov/software/phreeqc-version-3
Description: A geochemical modeling program developed by the US Geological Description: A geochemical modeling program developed by the US Geological
Survey that is designed to perform a wide variety of aqueous geochemical Survey that is designed to perform a wide variety of aqueous geochemical
calculations, including speciation, batch-reaction, one-dimensional calculations, including speciation, batch-reaction, one-dimensional
reactive-transport, and inverse geochemical calculations. reactive-transport, and inverse geochemical calculations.
Maintainer: S.R. Charlton <charlton@usgs.gov> Maintainer: S.R. Charlton <charlton@usgs.gov>
BugReports: https://github.com/usgs-coupled/iphreeqc/issues
LazyData: yes LazyData: yes
Encoding: UTF-8 Encoding: UTF-8

View File

@ -269,7 +269,7 @@ DATA = \
$(DATADIR)/databases.rda \ $(DATADIR)/databases.rda \
$(DATADIR)/examples.rda $(DATADIR)/examples.rda
all: export_sed $(PSRC) $(XSRC) $(DATA) $(MAN)/phreeqc-package.Rd all: $(PSRC) $(XSRC) $(DATA) $(MAN)/phreeqc-package.Rd
$(DATADIR)/databases.rda : $(DBS) build-databases.R $(DATADIR)/databases.rda : $(DBS) build-databases.R
rm -f .RData rm -f .RData
@ -290,12 +290,16 @@ $(DATADIR)/examples.rda : $(EXS) build-examples.R
R --no-save --no-restore CMD BATCH build-examples.R R --no-save --no-restore CMD BATCH build-examples.R
rm -f .RData rm -f .RData
roxygenize $(MAN)/phreeqc-package.Rd : phreeqc/R/phreeqc.R document : $(MAN)/phreeqc-package.Rd
rm -f $(RDFILES)
rm -f .RData
R --no-save --no-restore CMD BATCH roxygenize.R
touch $(MAN)/phreeqc-package.Rd
$(MAN)/phreeqc-package.Rd : $(TOPDIR)/R/phreeqc.R $(TOPDIR)/DESCRIPTION $(TOPDIR)/NAMESPACE
rm -f $(RDFILES)
Rscript -e 'devtools::document("phreeqc")'
build : phreeqc_$(VERSION).tar.gz
phreeqc_$(VERSION).tar.gz : $(MAN)/phreeqc-package.Rd
Rscript -e 'devtools::build("phreeqc")'
##$(PSRC): $(DEST) ##$(PSRC): $(DEST)
@ -821,28 +825,52 @@ $(INST)/ex2 : ../phreeqc3-examples/ex2
check : all check : all
R CMD check --as-cran phreeqc R CMD check --as-cran phreeqc
#check_built : phreeqc_$(VERSION).tar.gz
check_built : phreeqc_$(VERSION).tar.gz
Rscript -e "devtools::check_built(path=\"phreeqc_$(VERSION).tar.gz\")"
valgrind : install valgrind : install
R -d "valgrind --tool=memcheck --leak-check=full" --vanilla < valgrind.R 2>&1 | tee valgrind.full.out echo R -d "valgrind --tool=memcheck --leak-check=full" --vanilla < valgrind.R 2>&1 | tee valgrind.full.out
install : all install : all
R CMD INSTALL --build phreeqc echo R CMD INSTALL --build phreeqc
$(TOPDIR)/NAMESPACE : NAMESPACE
$(CP) $< $@
phreeqc/R/phreeqc.R : export_sed $(TOPDIR)/R/phreeqc.R : phreeqc.R.in phreeqc.R-$(VERSION)_$(RELEASE_DATE).TIMESTAMP
rm phreeqc.R-*.TIMESTAMP
phreeqc/DESCRIPTION : export_sed
export_sed :
sed \
-e 's/@VERSION@/$(VERSION)/g' \
< DESCRIPTION.in > $(TOPDIR)/DESCRIPTION
sed \ sed \
-e 's/@VERSION@/$(VERSION)/g' \ -e 's/@VERSION@/$(VERSION)/g' \
-e 's/@RELEASE_DATE@/$(RELEASE_DATE)/g' \ -e 's/@RELEASE_DATE@/$(RELEASE_DATE)/g' \
< phreeqc.R.in > $(TOPDIR)/R/phreeqc.R < phreeqc.R.in > $(TOPDIR)/R/phreeqc.R
touch phreeqc.R-$(VERSION)_$(RELEASE_DATE).TIMESTAMP
build : all phreeqc.R-$(VERSION)_$(RELEASE_DATE).TIMESTAMP :
R CMD build --resave-data phreeqc touch phreeqc.R-$(VERSION)_$(RELEASE_DATE).TIMESTAMP
$(TOPDIR)/DESCRIPTION : DESCRIPTION.in DESCRIPTION-$(VERSION).TIMESTAMP
rm DESCRIPTION-*.TIMESTAMP
sed \
-e 's/@VERSION@/$(VERSION)/g' \
< DESCRIPTION.in > $(TOPDIR)/DESCRIPTION
touch DESCRIPTION-$(VERSION).TIMESTAMP
DESCRIPTION-$(VERSION).TIMESTAMP :
touch DESCRIPTION-$(VERSION).TIMESTAMP
# export_sed :
# sed \
# -e 's/@VERSION@/$(VERSION)/g' \
# < DESCRIPTION.in > $(TOPDIR)/DESCRIPTION
# sed \
# -e 's/@VERSION@/$(VERSION)/g' \
# -e 's/@RELEASE_DATE@/$(RELEASE_DATE)/g' \
# < phreeqc.R.in > $(TOPDIR)/R/phreeqc.R
# build : all
# R CMD build --resave-data phreeqc
uninstall : uninstall :
R CMD REMOVE phreeqc R CMD REMOVE phreeqc

45
R/NAMESPACE Normal file
View File

@ -0,0 +1,45 @@
# Generated by roxygen2: do not edit by hand
export(phrAccumulateLine)
export(phrClearAccumulatedLines)
export(phrGetAccumulatedLines)
export(phrGetComponentList)
export(phrGetDumpFileName)
export(phrGetDumpFileOn)
export(phrGetDumpStrings)
export(phrGetDumpStringsOn)
export(phrGetErrorFileName)
export(phrGetErrorFileOn)
export(phrGetErrorStrings)
export(phrGetErrorStringsOn)
export(phrGetLogFileName)
export(phrGetLogFileOn)
export(phrGetLogStrings)
export(phrGetLogStringsOn)
export(phrGetOutputFileName)
export(phrGetOutputFileOn)
export(phrGetOutputStrings)
export(phrGetOutputStringsOn)
export(phrGetSelectedOutput)
export(phrGetSelectedOutputFileName)
export(phrGetWarningStrings)
export(phrLoadDatabase)
export(phrLoadDatabaseString)
export(phrRunAccumulated)
export(phrRunFile)
export(phrRunString)
export(phrSetDumpFileName)
export(phrSetDumpFileOn)
export(phrSetDumpStringsOn)
export(phrSetErrorFileName)
export(phrSetErrorFileOn)
export(phrSetErrorStringsOn)
export(phrSetLogFileName)
export(phrSetLogFileOn)
export(phrSetLogStringsOn)
export(phrSetOutputFileName)
export(phrSetOutputFileOn)
export(phrSetOutputStringsOn)
export(phrSetSelectedOutputFileName)
export(phrSetSelectedOutputFileOn)
useDynLib(phreeqc, .registration = TRUE)

View File

@ -9,6 +9,13 @@ fi
DATE=$(date -d $DATE --rfc-3339=date) DATE=$(date -d $DATE --rfc-3339=date)
export DATE export DATE
#
# create directories
#
mkdir -p R/phreeqc/R
mkdir -p R/phreeqc/src/phreeqcpp
mkdir -p R/phreeqc/data
# #
# set VER # set VER
# #
@ -44,5 +51,4 @@ export REL
# sed files # sed files
/bin/sh jenkins-dist.sh -v ${VER} -r ${REL} -d ${DATE} -pr ${TAG} /bin/sh jenkins-dist.sh -v ${VER} -r ${REL} -d ${DATE} -pr ${TAG}
cd R cd R
make VERSION=${VER} RELEASE_DATE=${DATE} check make VERSION=${VER} RELEASE_DATE=${DATE} check_built
make VERSION=${VER} RELEASE_DATE=${DATE} build