CMD Stan make error mingw32-make: *** No rule to make target 'examples/bernoulli/bernoulli'. Stop

I followed the cmdstan guide and installed cmdstan on a Windows Server 2016 Datacenter with 64 Bit. After installing, I ran the example with “mingw32-make examples/bernoulli/bernoulli” and it tells me “mingw32-make: *** No rule to make target ‘built’. Stop.”.

I tried it with both rtools 4.0 and rtools 3.5, I get the same message. I also found some posts in the forum, but none of the proposed solution helped me to make it work.

  • Operating System: Windows Server 2016 Datacenter
  • CmdStan Version: Latest (Cloned from Github)

did it really say 'built"? not sure where that’s coming from?

> make build
> make examples/bernoulli/bernoulli

Ah sorry, this is because I ran both wingm32-make built and mingw32-make examples/bernoulli/bernoulli.

In both cases, I get the No rule to make target error.

are you running these commands from the cmdstan directory?
it sounds like it’s not finding the Makefile

1 Like

are you running these commands from the cmdstan directory?

Yes, I am. I went there with cd cmdstan

Its

mingw32-make build
mingw32-make examples/bernoulli/bernoulli.exe

Note the .exe.

yields

INFORMATION: Es konnten keine Dateien mit dem angegebenen
Muster gefunden werden.
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2019_U8/include   -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS        -c -MT src/cmdstan/main.o -M -E -MG -MP -MF src/cmdstan/main.d src/cmdstan/main.cpp

what happens when you try:

g++ -v

??

1 Like

It gives out:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/Rtools/mingw_64/bin/…/libexec/gcc/x86_64-w64-mingw32/4.9.3/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: …/…/…/src/gcc-4.9.3/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64 --with-gxx-include-dir=/mingw64/x86_64-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-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=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-mpc=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-isl=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-cloog=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion=‘x86_64-posix-seh, Built by MinGW-W64 project’ --with-bugurl=MinGW-w64 - for 32 and 64 bit Windows download | SourceForge.net CFLAGS=‘-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/include’ CXXFLAGS=‘-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/include’ CPPFLAGS= LDFLAGS='-pipe -L/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/lib ’
Thread model: posix
gcc version 4.9.3 (x86_64-posix-seh, Built by MinGW-W64 project)

There is nothing wrong with this g++ call. Are there any subsequent g++ calls after the one you list?

No, that`s it.

This happens after this command:

curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/windows-stanc -o bin/stanc.exe --retry 5 --retry-delay 10
process_begin: CreateProcess(NULL, curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/windows-stanc -o bin/stanc.exe --retry 5 --retry-delay 10, …) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
make/stanc:69: recipe for target ‘bin/stanc.exe’ failed
mingw32-make: *** [bin/stanc.exe] Error 2

Oh, ok, that does say more. Windows 2016 does not seem to come with curl. The cloned Github version requires curl to download the stan compiler.

There are two solutions here:

If there is no specific reason you need the cloned version, I would go with the first option.

3 Likes

That’s great to know, thanks a lot. I will give it a try when I am back at the computer.

1 Like

Now that I am using it, it works perfectly, thanks!

2 Likes