# Problems running CmdStan's basic examples

**URL:** <https://discourse.mc-stan.org/t/problems-running-cmdstans-basic-examples/20487>\
**Category:** CmdStan\
**Tags:** cmdstan, installation\
**Created:** [January 28, 2021, 9:15am UTC](https://discourse.mc-stan.org/t/problems-running-cmdstans-basic-examples/20487 "2021-01-28T09:15:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![francescobrarda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/francescobrarda/32/11697_2.png) [@francescobrarda](https://discourse.mc-stan.org/u/francescobrarda)\
**Post date:** [January 28, 2021, 9:15am UTC](https://discourse.mc-stan.org/t/problems-running-cmdstans-basic-examples/20487/1 "2021-01-28T09:15:26Z")

</div>

Hi everyone!  
I am trying to run some examples available in a fork of cmdstan that uses also PETSc ([Using PETSc library together with Stan - #6 by IvanYashchuk](https://discourse.mc-stan.org/t/using-petsc-library-together-with-stan/17550/6)). The CmdStan version inside it is 2.24.0.  
I am using a cluster with Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-44-generic x86\_64). My **g++ version is 5.3.1** and the output of **make --version** is GNU Make 3.81. From the user guide the version should be fine.  
I have a warning while building, it says the following:  
cc1: warning: command line option ‘-std=gnu++14’ is valid for C++/ObjC++ but not for C  
Should I put something more specific inside my **make/local** before building?

In principle this is only a warning, but I am having troubles compiling the basic examples provided and I do not know where to look at. The errors I have are all identical:

examples/bernoulli/bernoulli.hpp:59:13: error: ‘profile\_map’ in namespace ‘stan::math’ does not name a type  
stan::math::profile\_map profiles\_\_;

I tried also to remove the GitHub clone and download the package again but it is not working. Does someone know if, after removing the folder (with **rm -rf namefolder** ), something remains in other directories and may cause errors (I did also **make clean-all** before removing)?  
It is very odd because I am having the same errors also running these examples on my personal machine (macOS 11.1). The only thing that changes is that on my computer I do not have warnings while building.  
I would very much appreciate if someone could help me somehow.  
Francesco

---

<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:** [January 28, 2021, 9:58am UTC](https://discourse.mc-stan.org/t/problems-running-cmdstans-basic-examples/20487/2 "2021-01-28T09:58:13Z")

</div>

Hi,

the problem there is that is a clone of cmdstan and will thus use the latest stanc3 binary.

Download the 2.24.1 version here: [Release v2.24.1 (11 August 2020) · stan-dev/stanc3 · GitHub](https://github.com/stan-dev/stanc3/releases/tag/v2.24.1)

Download the binary for your OS. For example if you have linux download linux-stanc, rename it to stanc and replace the stanc file in bin/.

---

<div class="post-metadata">

**Author:** ![francescobrarda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/francescobrarda/32/11697_2.png) [@francescobrarda](https://discourse.mc-stan.org/u/francescobrarda)\
**Post date:** [January 28, 2021, 11:32am UTC](https://discourse.mc-stan.org/t/problems-running-cmdstans-basic-examples/20487/3 "2021-01-28T11:32:47Z")

</div>

Hi,  
Many thanks, that solved the problem.  
Have a good day.  
Francesco
