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

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

What does

g++ —version return

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

That is recent enough.

What does

ls src/cmdstan

return?

1 Like

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.

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

1 Like

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

The problem is then that

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

1 Like

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

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

2 Likes