Compile problem

Rstan is not working anymore on my computer. Something changed in the path between Rtools and R, I suppose, but I don’t know what. Has someone a suggestion. Thanks in advance.

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! 0 [main] make (4992) C:\Rtools\bin\make.exe: *** fatal error - cygheap base mismatch detected - 0x2F27408/0x2D37408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version should
reside in x:\cygwin\bin, where ‘x’ is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
0 [main] make 10172 fork: child -1 - forked process 4992 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: vfork: Resource temporarily unavailable
Warning message:
running command ‘make -f “C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk” -f “C:/Users/HarrieJonkman/Documents/.R/Makevars” SHLIB_LDFLAGS=’$(SHLIB_CXXLDFLAGS)’ SHLIB_LD=’$(SHLIB_CXXLD)’ SHLIB=“file3a04736e5b61.dll” WIN=64 TCLBIN=64 OBJECTS=“file3a04736e5b61.o”’ had status 2
In addition: Warning message:
running command ‘C:/PROGRA~1/R/R-34~1.3/bin/x64/R CMD SHLIB file3a04736e5b61.cpp 2> file3a04736e5b61.cpp.err.txt’ had status 1
Error in map2stan(alist(log_gdp ~ dnorm(mu, sigma), mu <- a + bR * rugged + :
Something went wrong, when calling Stan. Check any debug messages for clues, detective.
Compilation ERROR, function(s)/method(s) not created! 0 [main] make (4992) C:\Rtools\bin\make.exe: *** fatal error - cygheap base mismatch detected - 0x2F27408/0x2D37408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version should
reside in x:\cygwin\bin, where ‘x’ is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
0 [main] make 10172 fork: child -1 - forked process 4992 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: vfork: Resource temporarily unavailable
Warning message:
running command 'make -f “C:/PROGRA~1/R/R-34~1.3/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk” -f "C:/Users/HarrieJ

It looks like an update or something to Cygwin caused this problem.

 This problem is probably due to using incompatible versions of the cygwin DLL.

There isn’t a lot of experience using Cygwin for Stan. Using Rtools in the regular Windows way works for most people. I believe the Linux-on-Windows-10 thing should work.

Thanks. It seem so, but how to update this? It worked quiet well before. Recently I installed another C+±compiler (ming-w64) which maybe ‘overruns’ Rtools?

Big best,

  • Harrie Jonkman, PhD

Verwey-Jonker Instituut

Nieuwe Krommegracht 6

3512 HG Utrecht

W: www.verwey-jonker.nl

P: www.Harriejonkman.nl

M: 06-34738591

E: Hjonkman@verwey-jonker.nl

That compiler should work, but you may have to follow / amend the configuration instructions at
https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows#configuration
again.

Hi! I am new to the Stan Forums.
I had been running some stan models from my laptop for some weeks now. Yesterday I had this very same problem, out of the blue Stan didn’t compile anymore. I really don’t know anything about C++ or compilers so I am having a lot of problems following this discussion. I tried to follow again the instructions in https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows but when I check the PATH by executing Sys.getenv(“PATH”), I do not get what I’m supposed to. Instead of “gcc-4.6.3”, the second part of the PATH is ming. I realized that in the Rtools website, on the Changes since R3.3.0 section, they state that “Support for the gcc 4.6.3 toolchain has been dropped.” How should I amend the configuration instructions??

(Again, I am sorry if I’m not being clear.)

Have you tried reinstalling Rtools? That should edit your path so that Rtools is on it. Otherwise, you’d need to edit your path yourself and ensure the appropriate existing Rtools paths are on it.

When the system finds a command, it looks up PATH, then goes down it in order looking in those directories for implementations. When things change, you might get a different first choice.

What got installed ahead of Rtools? This may be something that can’t be fixed with global configuration if that other thing is assuming a different toolchain is first on the path.

  1. Yes, I have uninstalled R, Rtools and RStudio.
  2. Then I reinstalled the latest R version (3.5.0 , “Joy in Playing”), downloaded again RStudio and the latest frozen version Rtools34.exe.
  3. Now when opening R or Rstudio I got the following message

Error 3:1: unexpected symbol
2: Sys.setenv(BINPREF = “C:/Rtools/mingw_$(WIN)/bin/”
3: Sys.setenv
^
I found this https://github.com/stan-dev/rstan/issues/451 and solved this particular error message

  1. However, I still can’t run the

fx <- inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’
return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
’ )

After reinstalling Rtools, what does your path look like? Didn’t you have an option to set the path when installing it?

This is probably gonig to have to get kicked up to the RStan devs as I’m not an expert on what can go wrong in R.

I did have the option of setting the path. After checking the box the first two elements in the PATH became

c:\Rtools\bin;
c:\Rtools\mingw_32\bin;

As I said on my previous reply, I reinstalled all three: R, Rstudio and Rtools (in that order). Today I tried to reinstall also some R packages, and while reinstalling the tidyverse, in particular stringi failed and the error message was again a cygwin problem.

Sorry I haven’t been monitoring this thread very closely. If you’re still having problems installing, then I’d suggest reposting in the specific RStan interface category so the RStan devs will get flagged.

I once again deleted R, RStudio and Rtools. I also deleted manually from the Windows System panel those first two entries of the PATH. I downloaded R once again, then RStudio again. I reinsalled Rtools and then shut down my laptop. I started it again, downloaded once again rstan and it worked.

Like I said, I’m not really sure of what I was doing, but it worked. I’m sorry I don’t have a repex or something more useful.

Thanks for monitoring it and helping me out!