# Cmdstan build not recognised

**URL:** <https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671>\
**Category:** Interfaces\
**Created:** [November 21, 2018, 3:47am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671 "2018-11-21T03:47:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 21, 2018, 3:47am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/1 "2018-11-21T03:47:40Z")

</div>

Hi  
I am new to MatlabStan and trying to setup cmdstan following the instructions in cmdstan-guide.pdf given in [https://github.com/stan-dev/cmdstan/releases](https://github.com/stan-dev/cmdstan/releases). 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.

---

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ahartikainen/32/321_2.png) [@ahartikainen](https://discourse.mc-stan.org/u/ahartikainen)\
**Post date:** [November 21, 2018, 6:22am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/2 "2018-11-21T06:22:45Z")

</div>

You need to create the `local` file if needed.

Build with `make build` is failing?

---

<div class="post-metadata">

**Author:** ![jjramsey](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jjramsey/32/3319_2.png) [@jjramsey](https://discourse.mc-stan.org/u/jjramsey)\
**Post date:** [November 21, 2018, 1:20pm UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/3 "2018-11-21T13:20:58Z")

</div>

> [@dhunfini](#):
>
> \cmdstan\make build gets the following error:  
> “build” is not recognized as an internal or external command, operable program or batch file.

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”.

---

<div class="post-metadata">

**Author:** ![increasechief](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/increasechief/32/2039_2.png) [@increasechief](https://discourse.mc-stan.org/u/increasechief)\
**Post date:** [November 21, 2018, 4:30pm UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/4 "2018-11-21T16:30:05Z")

</div>

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 ---'

```

---

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 21, 2018, 10:54pm UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/5 "2018-11-21T22:54:10Z")

</div>

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?

Thanks

---

<div class="post-metadata">

**Author:** ![increasechief](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/increasechief/32/2039_2.png) [@increasechief](https://discourse.mc-stan.org/u/increasechief)\
**Post date:** [November 22, 2018, 12:14am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/6 "2018-11-22T00:14:35Z")

</div>

> [@dhunfini](#):
>
> 64-bit mode not compiled
> 
> no compiled in support for x86\_64

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.

---

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 22, 2018, 12:22am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/7 "2018-11-22T00:22:15Z")

</div>

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

```
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/Rtools/mingw_32/bin/../libexec/gcc/i686-w64-mingw32/4.9.3/lto-wrapper.exe
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=http://sourceforge.net/projects/mingw-w64 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
PARTICULAR PURPOSE.

Report bugs to <bug-make@gnu.org>.

```

Are these what is expected?

Thanks

---

<div class="post-metadata">

**Author:** ![increasechief](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/increasechief/32/2039_2.png) [@increasechief](https://discourse.mc-stan.org/u/increasechief)\
**Post date:** [November 22, 2018, 12:24am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/8 "2018-11-22T00:24:52Z")

</div>

Here is what worked for me recently

```
gcc version 6.3.0 20170516

```

```
GNU Make 4.1

```

---

<div class="post-metadata">

**Author:** ![increasechief](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/increasechief/32/2039_2.png) [@increasechief](https://discourse.mc-stan.org/u/increasechief)\
**Post date:** [November 22, 2018, 12:29am UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/9 "2018-11-22T00:29:48Z")

</div>

It looks like you are behind in your `make` version

![cmdstan-guide](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/d/d8b0b6f73bc33d31431bb3ccd885b7e26dbddd87.png)

This would satisfy those requirements: [http://strawberryperl.com/release-notes/5.28.0.1-64bit.html](http://strawberryperl.com/release-notes/5.28.0.1-64bit.html)

---

<div class="post-metadata">

**Author:** ![jjramsey](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jjramsey/32/3319_2.png) [@jjramsey](https://discourse.mc-stan.org/u/jjramsey)\
**Post date:** [November 26, 2018, 1:36pm UTC](https://discourse.mc-stan.org/t/cmdstan-build-not-recognised/6671/10 "2018-11-26T13:36:58Z")

</div>

> [@dhunfini](#):
>
> What does this mean?

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