Skip to content

Commit 149a254

Browse files
committed
New submodule structure for r-devel compat
1 parent c1b497d commit 149a254

11 files changed

Lines changed: 63 additions & 136 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ name: R-CMD-check
1010
- develop
1111
- experimental
1212
- StanHeaders_*
13+
- module-test
1314
pull_request:
1415
branches:
1516
- develop
@@ -65,15 +66,6 @@ jobs:
6566
working-directory: rstan/rstan
6667
extra-packages: any::rcmdcheck, local::../../StanHeaders
6768

68-
- name: Remove symlinks on Windows
69-
if: runner.os == 'Windows'
70-
run: |
71-
rm -Rf inst/include/src \
72-
inst/include/mathlib \
73-
inst/include/stan \
74-
inst/include/libsundials || true
75-
shell: bash
76-
7769
- uses: r-lib/actions/check-r-package@v2
7870
with:
7971
working-directory: StanHeaders
@@ -86,4 +78,3 @@ jobs:
8678
working-directory: rstan/rstan
8779
env:
8880
_R_CHECK_CRAN_INCOMING_: false
89-

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[submodule "stan"]
2-
path = StanHeaders/inst/include/upstream
2+
path = StanHeaders/src/stan
33
url = https://github.com/stan-dev/stan.git
44
ignore = dirty
55
branch = develop
6+
[submodule "math"]
7+
path = StanHeaders/src/math
8+
url = https://github.com/stan-dev/math

StanHeaders/.Rbuildignore

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,12 @@
1-
inst/include/upstream
2-
inst/include/mathlib
3-
inst/include/libsundials
4-
inst/include/src/test.*$
5-
inst/include/src/.*\.hpp\.d$
6-
inst/include/src/.*\..pp\.gch$
7-
inst/include/src/docs.*$
8-
inst/include/src/doxygen.*$
9-
inst/include/src/python.*$
10-
inst/include/src/stan.hpp.*$
11-
inst/include/src/TO-DO.txt
12-
inst/include/src/README.*$
13-
inst/include/src/.*\.sh$
14-
inst/include/src/makefile$
15-
inst/include/src/\.travis\.yml$
16-
inst/include/src/logos/.*$
17-
inst/include/src/make/.*$
18-
_inst/include/src/stan/command/.*\.cpp$
19-
_inst/include/src/stan/gm/.*\.cpp$
20-
_inst/include/src/stan/gm/grammars/.*\.cpp$
21-
_inst/include/src/stan/agrad/.*\.cpp$
22-
_inst/include/src/stan/math/.*\.cpp$
23-
cleanup
24-
cleanup.win
25-
revdep
26-
install-github.R
27-
inst/doc/.install_extras
28-
vignettes/.install_extras
29-
.*\.o$
30-
.*\.a$
1+
^src/stan/(?!(src$|src/stan))
2+
^src/math/(?!(stan|lib$|lib/sundials_([^\/]*)$|lib/sundials_([^\/]*)/src|lib/sundials_([^\/]*)/include))
3+
^src/math/lib/sundials_([^\/]*)/src/sunnonlinsol/fixedpoint/fmod
4+
^src/sundials
5+
^inst/include
6+
317
\.gitignore$
32-
Rbuildignore.*$
338
\.prepare
9+
.*\.o$
10+
.*\.a$
11+
.*\.so$
12+
.*\.dll$

StanHeaders/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inst/include
2+
src/sundials

StanHeaders/cleanup

Lines changed: 0 additions & 15 deletions
This file was deleted.

StanHeaders/cleanup.win

Lines changed: 0 additions & 15 deletions
This file was deleted.

StanHeaders/inst/include/stan_sundials_printf_override.hpp

Lines changed: 0 additions & 13 deletions
This file was deleted.

StanHeaders/src/Makevars

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: static
1+
.PHONY: static package
22

33
CXX_STD = CXX17
44
PKG_CPPFLAGS = -DNO_FPRINTF_OUTPUT -I"../inst/include" -I"sundials" -include stan_sundials_printf_override.hpp
@@ -9,46 +9,44 @@ SHLIB_LDFLAGS = $(SHLIB_CXXLDFLAGS)
99
SHLIB_LD = $(SHLIB_CXXLD)
1010

1111
SUNDIALS_CVODES := \
12-
$(wildcard cvodes/*.c) \
13-
$(wildcard sundials/*.c) \
14-
$(wildcard sunmatrix/band/[^f]*.c) \
15-
$(wildcard sunmatrix/dense/[^f]*.c) \
16-
$(wildcard sunlinsol/band/[^f]*.c) \
17-
$(wildcard sunlinsol/dense/[^f]*.c) \
18-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
19-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
12+
$(wildcard math/lib/sundials_*/src/cvodes/*.c) \
13+
$(wildcard math/lib/sundials_*/src/sundials/*.c) \
14+
$(wildcard math/lib/sundials_*/src/sunmatrix/band/[^f]*.c) \
15+
$(wildcard math/lib/sundials_*/src/sunmatrix/dense/[^f]*.c) \
16+
$(wildcard math/lib/sundials_*/src/sunlinsol/band/[^f]*.c) \
17+
$(wildcard math/lib/sundials_*/src/sunlinsol/dense/[^f]*.c) \
18+
$(wildcard math/lib/sundials_*/src/sunnonlinsol/newton/[^f]*.c) \
19+
$(wildcard math/lib/sundials_*/src/sunnonlinsol/fixedpoint/[^f]*.c)
2020

2121
SUNDIALS_IDAS := \
22-
$(wildcard idas/*.c) \
23-
$(wildcard sundials/*.c) \
24-
$(wildcard sunmatrix/band/[^f]*.c) \
25-
$(wildcard sunmatrix/dense/[^f]*.c) \
26-
$(wildcard sunlinsol/band/[^f]*.c) \
27-
$(wildcard sunlinsol/dense/[^f]*.c) \
28-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
29-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
22+
$(wildcard math/lib/sundials_*/src/idas/*.c)
3023

3124
SUNDIALS_KINSOL := \
32-
$(wildcard kinsol/*.c) \
33-
$(wildcard sundials/*.c) \
34-
$(wildcard sunmatrix/band/[^f]*.c) \
35-
$(wildcard sunmatrix/dense/[^f]*.c) \
36-
$(wildcard sunlinsol/band/[^f]*.c) \
37-
$(wildcard sunlinsol/dense/[^f]*.c) \
38-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
39-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
25+
$(wildcard math/lib/sundials_*/src/kinsol/*.c)
4026

4127
SUNDIALS_NVECSERIAL := \
42-
$(addprefix , nvector/serial/nvector_serial.c sundials/sundials_math.c)
28+
$(wildcard math/lib/sundials_*/src/nvector/serial/nvector_serial.c)
4329

4430
SOURCES = $(SUNDIALS_CVODES) $(SUNDIALS_IDAS) $(SUNDIALS_KINSOL) $(SUNDIALS_NVECSERIAL)
4531
OBJECTS_C = $(SOURCES:.c=.o)
4632
OBJECTS = $(OBJECTS_C:.cpp=.o)
4733

34+
$(SHLIB): static
35+
$(OBJECTS): package
36+
37+
package:
38+
@mkdir -p ../inst/include
39+
@cp -Rf stan/src ../inst/include/src
40+
@cp -Rf math/stan ../inst/include/stan
41+
@cp -Rf math/lib/sundials_*/include/* ../inst/include/
42+
@cp -Rf math/lib/sundials_*/src/sundials .
43+
4844
static: $(OBJECTS)
4945
@mkdir -p ../lib
5046
$(AR) -rs ../lib/libStanHeaders.a $(OBJECTS)
5147

5248
clean:
5349
rm -rf ../lib
5450
rm $(OBJECTS)
51+
rm -rf ../inst/include/
52+
rm -rf sundials

StanHeaders/src/Makevars.win

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,40 @@ SHLIB_LDFLAGS = $(SHLIB_CXXLDFLAGS)
99
SHLIB_LD = $(SHLIB_CXXLD)
1010

1111
SUNDIALS_CVODES := \
12-
$(wildcard cvodes/*.c) \
13-
$(wildcard sundials/*.c) \
14-
$(wildcard sunmatrix/band/[^f]*.c) \
15-
$(wildcard sunmatrix/dense/[^f]*.c) \
16-
$(wildcard sunlinsol/band/[^f]*.c) \
17-
$(wildcard sunlinsol/dense/[^f]*.c) \
18-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
19-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
12+
$(wildcard math/lib/sundials_*/src/cvodes/*.c) \
13+
$(wildcard math/lib/sundials_*/src/sundials/*.c) \
14+
$(wildcard math/lib/sundials_*/src/sunmatrix/band/[^f]*.c) \
15+
$(wildcard math/lib/sundials_*/src/sunmatrix/dense/[^f]*.c) \
16+
$(wildcard math/lib/sundials_*/src/sunlinsol/band/[^f]*.c) \
17+
$(wildcard math/lib/sundials_*/src/sunlinsol/dense/[^f]*.c) \
18+
$(wildcard math/lib/sundials_*/src/sunnonlinsol/newton/[^f]*.c) \
19+
$(wildcard math/lib/sundials_*/src/sunnonlinsol/fixedpoint/[^f]*.c)
2020

2121
SUNDIALS_IDAS := \
22-
$(wildcard idas/*.c) \
23-
$(wildcard sundials/*.c) \
24-
$(wildcard sunmatrix/band/[^f]*.c) \
25-
$(wildcard sunmatrix/dense/[^f]*.c) \
26-
$(wildcard sunlinsol/band/[^f]*.c) \
27-
$(wildcard sunlinsol/dense/[^f]*.c) \
28-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
29-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
22+
$(wildcard math/lib/sundials_*/src/idas/*.c)
3023

3124
SUNDIALS_KINSOL := \
32-
$(wildcard kinsol/*.c) \
33-
$(wildcard sundials/*.c) \
34-
$(wildcard sunmatrix/band/[^f]*.c) \
35-
$(wildcard sunmatrix/dense/[^f]*.c) \
36-
$(wildcard sunlinsol/band/[^f]*.c) \
37-
$(wildcard sunlinsol/dense/[^f]*.c) \
38-
$(wildcard sunnonlinsol/newton/[^f]*.c) \
39-
$(wildcard sunnonlinsol/fixedpoint/[^f]*.c)
25+
$(wildcard math/lib/sundials_*/src/kinsol/*.c)
4026

4127
SUNDIALS_NVECSERIAL := \
42-
$(addprefix , nvector/serial/nvector_serial.c sundials/sundials_math.c)
28+
$(wildcard math/lib/sundials_*/src/nvector/serial/nvector_serial.c)
4329

4430

4531
SOURCES = $(SUNDIALS_CVODES) $(SUNDIALS_IDAS) $(SUNDIALS_KINSOL) $(SUNDIALS_NVECSERIAL) init.c
4632
OBJECTS_C = $(SOURCES:.c=.o)
4733
OBJECTS = $(OBJECTS_C:.cpp=.o)
4834

4935
$(SHLIB): $(OBJECTS)
36+
$(OBJECTS): package
37+
38+
package:
39+
@mkdir -p ../inst/include
40+
@cp -Rf stan/src ../inst/include/src
41+
@cp -Rf math/stan ../inst/include/stan
42+
@cp -Rf math/lib/sundials_*/include/* ../inst/include/
43+
@cp -Rf math/lib/sundials_*/src/sundials .
5044

5145
clean:
5246
rm $(OBJECTS)
47+
rm -rf ../inst/include/
48+
rm -rf sundials

StanHeaders/src/math

Submodule math added at 72f6470

0 commit comments

Comments
 (0)