Cmdstan build not recognised

I am new to MatlabStan and trying to setup cmdstan following the instructions in cmdstan-guide.pdf given in Following Section 2.2, Step 2 , I do not see a “local” file in the “make” folder and \cmdstan\make build gets the following error:
“build” is not recognized as an internal or external command, operable program or batch file.

Operating System: Windows 10
Interface Version: cmdstan 2.18.0
Compiler/Toolkit: Rtools 3.4

Please help.

You need to create the local file if needed.

Build with make build is failing?

You aren’t supposed to run the command “\cmdstan\make build”. You’re supposed to go into the “\cmdstan” directory and run the command “make build”.

Well, build is an option indexed in the makefile.

My makefile contains the following

build: $(LIBMPI) bin/stanc$(EXE) bin/stansummary$(EXE) bin/print$(EXE) bin/diagnose$(EXE) $(LIBSUNDIALS)
	@echo ''
	@echo '--- CmdStan v$(CMDSTAN_VERSION) built ---'

Thanks @increasechief and @jjramsey and @ahartikainen .

When I went to “\cmdstan” directory and ran the command “make build”, I get the following error:

uname: not found
uname: not found
g++ -Wall -I . -isystem stan/lib/stan_math/lib/eigen_3.3.3 -isystem stan/lib/stan_math/lib/boost_1.66.0 -isystem stan/lib/stan_math/lib/sundials_3.1.0/include -std=c++1y -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -Wno-unused-function -Wno-uninitialized -I src -isystem stan/src -isystem stan/lib/stan_math/ -DFUSION_MAX_VECTOR_SIZE=12 -Wno-unused-local-typedefs -DEIGEN_NO_DEBUG -m64 -Wno-unused-but-set-variable -DNO_FPRINTF_OUTPUT -pipe  -c src/cmdstan/stanc.cpp -O3 -o bin/cmdstan/stanc.o
src/cmdstan/stanc.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
 #include <stan/command/stanc_helper.hpp>
Assembler messages:
Fatal error: no compiled in support for x86_64
make: *** [bin/cmdstan/stanc.o] Error 1

What does this mean?


DId you check Appendix B of the guide? It would seem there that Windows 10 is not official supported. Not that that is the problem per se. From the output of the error message there is a problem cross-compiling to your computers architecture using the build tools available.

Appendix B.3 may be helpful, can you post g++ -v and make -v as outlined in that section?

The guide recommends using Cygwin, I’ve found Strawberry Perl is more user friendly on install but I haven’t tried using CmdStan in that environment.

Thanks @increasechief.
The g++ -v output gives:

Using built-in specs.
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.9.3/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-static --disable-shared --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-mpfr=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-mpc=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-isl=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --with-cloog=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf, Built by MinGW-W64 project' --with-bugurl= CFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/home/Jeroen/mingw-gcc-4.9.3/i686-493-posix-dwarf-rt_v3-s/mingw32/opt/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-zlib-static/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.9.3 (i686-posix-dwarf, Built by MinGW-W64 project)

And make -v output gives:

GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i686-pc-cygwin
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        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

Report bugs to <>.

Are these what is expected?


Here is what worked for me recently

gcc version 6.3.0 20170516
GNU Make 4.1

It looks like you are behind in your make version


This would satisfy those requirements:

It means that you are probably using the 32-bit version of the compiler. What’s the contents of your PATH variable?