From 1cc54743187e3e2dce3656f4ecea1882a64ae699 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 21 Nov 2024 11:28:54 -0700 Subject: [PATCH 1/6] update Doxyfile, Makefile, .gitignore --- .gitignore | 34 ++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 17 +++++++++++++++++ Makefile | 38 +++++++++++++++++++++++++++++++++++--- docs/Doxyfile | 10 +++++----- 4 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.gitignore b/.gitignore index 432de27..5c66228 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,39 @@ +# build artifacts and executables *.o estimate sipnet subsetData transpose +.doxygen.stamp + +# documentation +docs/html +docs/latex + +.DS_Store +.Rproj.user +.Rhistory + + +# build artifacts and executables +*.o +estimate +sipnet +subsetData +transpose +.doxygen.stamp + +# documentation +docs/html/ +docs/latex/ + + +# System-specific files +.DS_Store +.Rproj.user +.Rhistory + +# Temporary and backup files +*.bak +*~ +*.tmp diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f15c9c4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,17 @@ + +## Style Guide + +## Compiling + +SIPNET uses `make` build the model and documentation. There are also miscellaneous targets for running analysis workflows: + +```sh +# build SIPNET executable +make sipnet +# build documentation +make document +# clean up build artifacts +make clean +# list all make commands +make help +``` diff --git a/Makefile b/Makefile index 200df75..caeeaea 100755 --- a/Makefile +++ b/Makefile @@ -18,8 +18,27 @@ TRANSPOSE_OFILES=$(TRANSPOSE_CFILES:.c=.o) SUBSET_DATA_CFILES=subsetData.c util.c namelistInput.c SUBSET_DATA_OFILES=$(SUBSET_DATA_CFILES:.c=.o) +CFILES=$(sort $(ESTIMATE_CFILES) $(SENSTEST_CFILES) $(SIPNET_CFILES) $(TRANSPOSE_CFILES) $(SUBSET_DATA_CFILES)) + +# Doxygen +DOXYFILE = docs/Doxyfile +DOXYGEN_HTML_DIR = docs/html +DOXYGEN_LATEX_DIR = docs/latex + +# .PHONY indicates target names that are not file names, preventing conflicts if these names are used for filenames +.PHONY: all clean document estimate sipnet transpose subsetData doxygen + # all: estimate sensTest sipnet transpose subsetData -all: estimate sipnet transpose subsetData +all: estimate sipnet transpose subsetData document + + +# Only update docs if source files or Doxyfile have changed +document: .doxygen.stamp + +.doxygen.stamp: $(CFILES) $(DOXYFILE) + @echo "Running Doxygen..." + doxygen $(DOXYFILE) + @touch .doxygen.stamp estimate: $(ESTIMATE_OFILES) $(LD) -o estimate $(ESTIMATE_OFILES) $(LIBLINKS) @@ -38,14 +57,27 @@ subsetData: $(SUBSET_DATA_OFILES) clean: rm -f $(ESTIMATE_OFILES) $(SIPNET_OFILES) $(TRANSPOSE_OFILES) $(SUBSET_DATA_OFILES) estimate sensTest sipnet transpose subsetData - + rm -rf $(DOXYGEN_HTML_DIR) $(DOXYGEN_LATEX_DIR) #clean: # rm -f $(ESTIMATE_OFILES) $(SENSTEST_OFILES) $(SIPNET_OFILES) $(TRANSPOSE_OFILES) $(SUBSET_DATA_OFILES) estimate sensTest sipnet transpose subsetData +help: + @echo "Available targets:" + @echo " help - Display this help message." + @echo " === core targets ===" + @echo " all - Builds all components." + @echo " document - Generate documentation." + @echo " sipnet - Builds the 'sipnet' executable." + @echo " clean - Removes compiled files and executables." + @echo " depend - Automatically generates dependency information for source files." + @echo " === additional tools ===" + @echo " estimate - Builds 'estimate' executable to estimate parameters using MCMC." + @echo " transpose - Builds 'transpose' executable to read in and transpose a matrix" + @echo " subsetData - Builds 'subsetData' executable that subsets input files (e.g., .clim, .dat, .valid, .sigma, .spd) from a specified start date and length of time in days." -#This target automatically builds dependencies. depend:: makedepend $(CFILES) # DO NOT DELETE THIS LINE -- make depend depends on it. + diff --git a/docs/Doxyfile b/docs/Doxyfile index bb22215..1986376 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -5,8 +5,8 @@ #--------------------------------------------------------------------------- PROJECT_NAME = SIPNET PROJECT_NUMBER = 1.0 -OUTPUT_DIRECTORY = /Users/aulenbac/Documents/workspace/SIPNET/docs -CREATE_SUBDIRS = NO +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = YES OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES @@ -24,8 +24,8 @@ ABBREVIATE_BRIEF = "The $name class" \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /Applications/ +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = ../.. STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO @@ -82,7 +82,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = /Users/aulenbac/Documents/workspace/SIPNET +INPUT = ../ FILE_PATTERNS = *.c \ *.cc \ *.cxx \ From 682e25c7f3c65843e99aa5d95bb94986d068a636 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 19 Dec 2024 23:52:56 -0700 Subject: [PATCH 2/6] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f15c9c4..7806eda 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ## Compiling -SIPNET uses `make` build the model and documentation. There are also miscellaneous targets for running analysis workflows: +SIPNET uses `make` to build the model and documentation. There are also miscellaneous targets for running analysis workflows: ```sh # build SIPNET executable From 8108736968eb9ca6ae7edcca702711103058b305 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 19 Dec 2024 23:53:03 -0700 Subject: [PATCH 3/6] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index caeeaea..e47457e 100755 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ help: @echo " all - Builds all components." @echo " document - Generate documentation." @echo " sipnet - Builds the 'sipnet' executable." - @echo " clean - Removes compiled files and executables." + @echo " clean - Removes compiled files, executables, and documentation." @echo " depend - Automatically generates dependency information for source files." @echo " === additional tools ===" @echo " estimate - Builds 'estimate' executable to estimate parameters using MCMC." From 8e89d94c029209ca67bd7eb4eb2f26889f31957c Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 19 Dec 2024 23:54:30 -0700 Subject: [PATCH 4/6] Update .gitignore Remove duplicate lines --- .gitignore | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.gitignore b/.gitignore index 5c66228..757dc24 100644 --- a/.gitignore +++ b/.gitignore @@ -14,20 +14,6 @@ docs/latex .Rproj.user .Rhistory - -# build artifacts and executables -*.o -estimate -sipnet -subsetData -transpose -.doxygen.stamp - -# documentation -docs/html/ -docs/latex/ - - # System-specific files .DS_Store .Rproj.user From 72e92de6d08ca0e1641809b4e2ed62995b82db69 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 9 Jan 2025 14:39:24 -0700 Subject: [PATCH 5/6] Add Doxygen install to CI.yml --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c2880a..8798b2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,16 @@ jobs: # checkout source code - uses: actions/checkout@v2 - # compile sipnet + # install doxygen + - name: Install Doxygen + run: | + if [[ "$RUNNER_OS" == "Linux" ]]; then + sudo apt-get install doxygen -y + elif [[ "$RUNNER_OS" == "macOS" ]]; then + brew install doxygen + fi + + # compile SIPNET - name: compile sipnet run: make From 573a76c7397b704c3b5cd606ef756903633c480f Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Thu, 9 Jan 2025 14:42:04 -0700 Subject: [PATCH 6/6] fix brew install doxygen warning --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8798b2b..2010689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: if [[ "$RUNNER_OS" == "Linux" ]]; then sudo apt-get install doxygen -y elif [[ "$RUNNER_OS" == "macOS" ]]; then - brew install doxygen + brew install --formula doxygen fi # compile SIPNET