# Run CmdStan on Linux: Error 1 \[No such file or directory\]

**URL:** <https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470>\
**Category:** General\
**Tags:** cmdstan, linux\
**Created:** [November 24, 2020, 2:07pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470 "2020-11-24T14:07:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 24, 2020, 2:07pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/1 "2020-11-24T14:07:35Z")

</div>

After installing CmdStan on a Linux machine, I get an error message when running make commands in the cmdstand folder. I both tried to clone CmdStan from the GitHub Repository and to download the cmdstan-2.25.0.tar.gz, and unpack it with `tar -xvzf cmdstan-2.25.0.tar.gz`.

```
--- Compiling the main object file. This might take up to a minute. ---
g++ -c -o src/cmdstan/main.o src/cmdstan/main.cpp
src/cmdstan/main.cpp:1:31: fatal error: cmdstan/command.hpp: No such file or directory
compilation terminated.
make: *** [src/cmdstan/main.o] Error 1
```

---

<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:** [November 24, 2020, 2:19pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/2 "2020-11-24T14:19:39Z")

</div>

What does

g++ —version return

---

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 24, 2020, 2:31pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/3 "2020-11-24T14:31:31Z")

</div>

Thanks for your support!

```
g++ --version
g++ (GCC) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

```

and

```
make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-unknown-linux-gnu
```

---

<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:** [November 24, 2020, 2:34pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/4 "2020-11-24T14:34:10Z")

</div>

That is recent enough.

What does

ls src/cmdstan

return?

---

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 24, 2020, 2:36pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/5 "2020-11-24T14:36:23Z")

</div>

Ah okay, I feel that we are close to solving the problem.

It returns `src/cmdstan: No such file or directory`.

cmdstan is installed in the directory `home/username`.

And inside the cmdstan folder, there is a folder src. This is how it automatically created these folders.

---

<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:** [November 24, 2020, 2:39pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/6 "2020-11-24T14:39:33Z")

</div>

So the src inside cmdstan is empty? That would be weird.

---

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 24, 2020, 2:41pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/7 "2020-11-24T14:41:06Z")

</div>

Sorry, I was not in the cmdstan directory. It returns

```
ls src/cmdstan
arguments io print_helper.hpp stansummary_helper.hpp write_parallel_info.hpp
command.hpp main.cpp stanc.cpp write_model.hpp write_stan.hpp
diagnose.cpp print.cpp stansummary.cpp write_opencl_device.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:** [November 24, 2020, 2:43pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/8 "2020-11-24T14:43:53Z")

</div>

The problem is then that

> [@Jochen](#):
>
> `g++ -c -o src/cmdstan/main.o src/cmdstan/main.cpp`

is missing some flags. -I src/ for starters. Is upgrading make an option?

---

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 24, 2020, 2:52pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/9 "2020-11-24T14:52:51Z")

</div>

I will ask the server adminstator and hope that he can update it. Thanks, I will report back if it helped.

---

<div class="post-metadata">

**Author:** ![Jochen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jochen/32/4786_2.png) [@Jochen](https://discourse.mc-stan.org/u/Jochen)\
**Post date:** [November 25, 2020, 2:26pm UTC](https://discourse.mc-stan.org/t/run-cmdstan-on-linux-error-1-no-such-file-or-directory/19470/10 "2020-11-25T14:26:28Z")

</div>

This issue was solved by using the release version of CmdStan, thanks for the support!
