# Running stan-dev/stan tests

**URL:** <https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940>\
**Category:** Developers\
**Created:** [September 11, 2019, 4:15pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940 "2019-09-11T16:15:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [September 11, 2019, 4:15pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/1 "2019-09-11T16:15:03Z")

</div>

I’m having trouble with the stan-dev/stan test models.

I clone the repo:

```
git clone --recursive https://github.com/stan-dev/stan.git

```

I run the tests:

```
./runTests.py -j8 src/test

```

I get this error and things break:

```
/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -DBOOST_DISABLE_ASSERTS -c -o test/stan/lang/grammars/statement_2_grammar_inst.o src/stan/lang/grammars/statement_2_grammar_inst.cpp
src/test/performance/logistic_test.cpp:47:10: fatal error: test/test-models/performance/logistic.hpp: No such file or directory
 #include <test/test-models/performance/logistic.hpp>
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

I tried the command here to no avail: [Running single model integration test](https://discourse.mc-stan.org/t/running-single-model-integration-test/5574)

```
~/stan-current$ make src/test/test-models/good/map_rect.hpp-test
make: *** No rule to make target 'src/test/test-models/good/map_rect.hpp-test'. Stop.

```

Even though this file exists:

```
~/stan-current$ ls src/test/test-models/good/map_rect.stan 
src/test/test-models/good/map_rect.stan

```

@syclik any ideas? (I’m trying to test some code that needs a valid stan model compiled in)

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [September 11, 2019, 4:17pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/2 "2019-09-11T16:17:04Z")

</div>

This is the output with -d turned on:

```
...
 No need to remake target 'makefile'.
Updating goal targets....
Considering target file 'src/test/test-models/good/map_rect.hpp-test'.
 File 'src/test/test-models/good/map_rect.hpp-test' does not exist.
 Looking for an implicit rule for 'src/test/test-models/good/map_rect.hpp-test'.
 Trying pattern rule with stem 'map_rect'.
 Trying implicit prerequisite 'src/test/test-models/good/map_rect.hpp'.
 Trying pattern rule with stem 'map_rect.hpp-test'.
 Trying implicit prerequisite 'src/test/test-models/good/map_rect.hpp-test,v'.
 Trying pattern rule with stem 'map_rect.hpp-test'.
 Trying implicit prerequisite 'src/test/test-models/good/RCS/map_rect.hpp-test,v'.
 Trying pattern rule with stem 'map_rect.hpp-test'.
 Trying implicit prerequisite 'src/test/test-models/good/RCS/map_rect.hpp-test'.
 Trying pattern rule with stem 'map_rect.hpp-test'.
 Trying implicit prerequisite 'src/test/test-models/good/s.map_rect.hpp-test'.
 Trying pattern rule with stem 'map_rect.hpp-test'.
 Trying implicit prerequisite 'src/test/test-models/good/SCCS/s.map_rect.hpp-test'.
 Trying pattern rule with stem 'map_rect'.
 Trying implicit prerequisite 'src/test/test-models/good/map_rect.hpp'.
 Looking for a rule with intermediate file 'src/test/test-models/good/map_rect.hpp'.
  Avoiding implicit rule recursion.
  Trying pattern rule with stem 'map_rect.hpp'.
  Trying implicit prerequisite 'src/test/test-models/good/map_rect.hpp,v'.
  Trying pattern rule with stem 'map_rect.hpp'.
  Trying implicit prerequisite 'src/test/test-models/good/RCS/map_rect.hpp,v'.
  Trying pattern rule with stem 'map_rect.hpp'.
  Trying implicit prerequisite 'src/test/test-models/good/RCS/map_rect.hpp'.
  Trying pattern rule with stem 'map_rect.hpp'.
  Trying implicit prerequisite 'src/test/test-models/good/s.map_rect.hpp'.
  Trying pattern rule with stem 'map_rect.hpp'.
  Trying implicit prerequisite 'src/test/test-models/good/SCCS/s.map_rect.hpp'.
 No implicit rule found for 'src/test/test-models/good/map_rect.hpp-test'.
 Finished prerequisites of target file 'src/test/test-models/good/map_rect.hpp-test'.
Must remake target 'src/test/test-models/good/map_rect.hpp-test'.
make: *** No rule to make target 'src/test/test-models/good/map_rect.hpp-test'. Stop.

```

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [September 11, 2019, 4:55pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/3 "2019-09-11T16:55:57Z")

</div>

I can build the header with:

```
make test/test-models/good/map_rect.hpp-test

```

So it’s something to do with the different in src/test and test?

edit: and the header shows up then in `test/test-models/good/map_rect.hpp`

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [September 11, 2019, 6:13pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/4 "2019-09-11T18:13:46Z")

</div>

Not sure if this helps your exact case. I tried to repeat your issue and cloned a fresh develop of stan.

And I get the following error on running `./runTests.py -j8 src/test`:

```
g++ -std=c++1y -pthread -Wno-sign-compare -O3 -I src -I . -I lib/stan_math/ -I lib/stan_math/lib/eigen_3.3.3 -I lib/stan_math/lib/boost_1.69.0 -I lib/stan_math/lib/sundials_4.1.0/include -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -I lib/stan_math/lib/gtest_1.8.1/include -I lib/stan_math/lib/gtest_1.8.1 -DBOOST_DISABLE_ASSERTS -c src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp -o test/unit/mcmc/hmc/nuts/unit_e_nuts_test.o
src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp:1:10: fatal error: test/test-models/good/mcmc/hmc/common/gauss3D.hpp: No such file or directory
 #include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp>
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make/tests:13: recipe for target 'test/unit/mcmc/hmc/nuts/unit_e_nuts_test.o' failed
make: *** [test/unit/mcmc/hmc/nuts/unit_e_nuts_test.o] Error 1
make: *** Waiting for unfinished jobs....
src/test/unit/optimization/bfgs_exponential_boundary_test.cpp:3:10: fatal error: test/test-models/good/optimization/exponential_boundary.hpp: No such file or directory
 #include <test/test-models/good/optimization/exponential_boundary.hpp>
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make/tests:13: recipe for target 'test/unit/optimization/bfgs_exponential_boundary_test.o' failed
make: *** [test/unit/optimization/bfgs_exponential_boundary_test.o] Error 1
src/test/unit/optimization/bfgs_test.cpp:3:10: fatal error: test/test-models/good/optimization/rosenbrock.hpp: No such file or directory
 #include <test/test-models/good/optimization/rosenbrock.hpp>
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make/tests:13: recipe for target 'test/unit/optimization/bfgs_test.o' failed
make: *** [test/unit/optimization/bfgs_test.o] Error 1
src/test/unit/optimization/bfgs_minimizer_test.cpp:3:10: fatal error: test/test-models/good/optimization/rosenbrock.hpp: No such file or directory
 #include <test/test-models/good/optimization/rosenbrock.hpp>
       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

Then I tried using clang++ and it worked…

With g++ I ran `make test/test-models/good/mcmc/hmc/common/gauss3D.hpp` after I got the above error and that compiled stanc etc and it seems to be OK now. It is very weird tho.

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [September 11, 2019, 6:44pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/5 "2019-09-11T18:44:07Z")

</div>

It seems that running `make test/integration/compile_models_test` beforehand solves it for g++.

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [September 11, 2019, 6:46pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/6 "2019-09-11T18:46:26Z")

</div>

Thanks for looking at this, but when I run that I get:

```
~/stan-current$ make test/integration/compile_models
make: *** No rule to make target 'test/integration/compile_models'. Stop.

```

Haven’t tried clang yet.

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [September 11, 2019, 6:49pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/7 "2019-09-11T18:49:31Z")

</div>

You forgot the `_test`

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [September 11, 2019, 6:51pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/8 "2019-09-11T18:51:49Z")

</div>

Oh lol, nice. Yeah it works now! Thanks.

I’ll make an issue out of this and link this as a solution.

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [September 11, 2019, 6:52pm UTC](https://discourse.mc-stan.org/t/running-stan-dev-stan-tests/10940/9 "2019-09-11T18:52:21Z")

</div>

Also specify `-j4` or `-j8` for this make call. This one takes a while.
