Problem compiling tests for stan from source

37 views
Skip to first unread message

Martin Cerny

unread,
Apr 11, 2017, 9:25:17 AM4/11/17
to Stan users mailing list
Hi,
I am trying to setup a workspace for development on Stan core code. Is there some kind of official guide for this or not? Or a list of requirements? I would prefer to develop on Windows, but if that is going to be too much of a hassle, I can get by with Linux. Here is where I got stuck:
On both Windows 10 + Rtools (gcc 4.9.3) and Debian 8 (gcc 4.9.2), I cannot compile test/unit/mcmc/hmc/hamiltonians/softabs_metric (and a bunch of others, all with the same error)

To be specific, executing
make test/unit/mcmc/hmc/hamiltonians/softabs_metric
yields the error in the attachment (same error on both machines)

Do I need newer gcc or is this some other problem?

On Windows, I also ran into problems with integration tests (https://github.com/stan-dev/stan/issues/2058) but I guess I can live without this.

Thanks
Martin
error_output.txt

Bob Carpenter

unread,
Apr 11, 2017, 1:26:36 PM4/11/17
to stan-...@googlegroups.com, Daniel Lee
Windows has been a huge pain for us because the toolchain
is a lot more fragile. I'm not sure what our unit tests on
Jenkins are running, but I know they can be run on Windows.

Do the instructions to install CmdStan work? That shouldn't
involve any fvar (that's forward-mode autodiff for higher-order
derivatives). The fvar are required for the Riemannian
metric where it's blowing out in your report.

Our dev ops people are all out until next week, though, so you
may need to wait and try again when they're back on email.
Or maybe someone else knows.

You might be able to get by now avoiding fvar (and anything
in fwd or mix directories).

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <error_output.txt>

Daniel Lee

unread,
Apr 11, 2017, 2:34:42 PM4/11/17
to Bob Carpenter, stan-users mailing list
Hi Martin,

Sorry, there's a bit of misinformation on the wiki (that I didn't know about until I just looked). See this page for how to run the tests:

(I'll mark the others for removal.)

On Windows, if you have Python installed, you should be able to replace `./runTests.py` with `.\runTests.py` with the arguments the same.

If you wanted to work directly with make, then instead of `make test/unit/mcmc/hmc/hamiltonians/softabs_metric`, you'll have to add the file extension, so: `make test/unit/mcmc/hmc/hamiltonians/softabs_metric.exe`



Daniel

> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

Daniel Lee

unread,
Apr 11, 2017, 2:36:21 PM4/11/17
to Bob Carpenter, stan-users mailing list
I take it back... there isn't misinformation. There just isn't information about Windows. And the info is spread out across multiple pages.


Daniel

Martin Cerny

unread,
Apr 12, 2017, 9:54:43 AM4/12/17
to stan-...@googlegroups.com
Thanks for the pointers. I was already running runTests.py, I was just reporting the test that caused problems. But the page you sent mentioned using clang.
So I tried switching from g++ to clang++ (v 3.5.0) on the Debian box and the problem went away. It also seems that CygWin / clang works (but the tests have yet to finish)
Then I tried updating the Debian box to gcc 6, but the same test still would not compile.

So I guess g++ is currently not supported and I should use clang++?

Best
Martin

You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/VioUzFeUI6s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

Martin Cerny

unread,
Apr 12, 2017, 10:14:57 AM4/12/17
to stan-...@googlegroups.com
OK, I take it back: clang on CygWin compiles all the unit tests, but some of the tests fail :-) (namely test/unit/io/stan_csv_reader.exe) 
clang/CygWin also segfaults on make test/integration/compile_models.exe

Martin

Bob Carpenter

unread,
Apr 12, 2017, 11:48:35 AM4/12/17
to stan-...@googlegroups.com
I'm now confused about what platforms we're talking about.
How did Debian come into the picture? Stan works with
Linux under g++.

g++ for Windows is what comes with Rtools and what we
generally recommend for Windows users running Stan.

- Bob
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> > <error_output.txt>
>
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/VioUzFeUI6s/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Martin Cerny

unread,
Apr 12, 2017, 5:36:03 PM4/12/17
to stan-...@googlegroups.com
Hi,
sorry I guess I wasn't very clear. I am trying to compile in multiple environments with mixed results. In all cases, I can compile libstanc, but compiling/passing tests is problematic. Maybe it's some misconfiguration on my side, but this is what I get:

a) Windows 10 + Rtools (gcc 4.9.3). I cannot compile some unit tests (see the error attached in my previous email)
b) Windows 10 + Cygwin (gcc 4.9.3) :same as a)
c) Windows 10 + Cygwin (clang++). Can compile tests, but most of them don't pass
d) Debian 8 + gcc 4.9.2 : same as a)
e) Debian 8 + gcc 6.0.3: same as a)
f) Debian 8 + clang++ 3.5.0: all tests compile and all pass except performance tests (which I guess is expected)

So I can definitely do some work on Windows and Debian + clang is totally safe. I am just trying to check whether this is expected.

Hope that clears things up.

Martin


Dne 12. 4. 2017 17:48 napsal uživatel "Bob Carpenter" <ca...@alias-i.com>:
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> > <error_output.txt>
>
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/VioUzFeUI6s/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/VioUzFeUI6s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

Daniel Lee

unread,
Apr 12, 2017, 10:41:48 PM4/12/17
to stan-users mailing list
HI Martin,

I don't see the error attachment (for windows). Could you send that again? 

Regarding seg faults from the compiler: I don't know enough to debug that blind. 1) it shouldn't happen and 2) given that it does, I don't know what's on your system to make that happen.

I've never gotten Cywin to work. But if you have both installed, there might be some sort of library issue. Not sure.

First thing: can you please send over the log file again? I'm not sure where it went. Maybe there's a clue in there somewhere.


Daniel

Martin Cerny

unread,
Apr 13, 2017, 1:18:23 AM4/13/17
to stan-...@googlegroups.com
Hi,
attached is the log with the compile error from g++ (the message is the same on both Windows and Debian).
You are right that CygWin and RTools could have some conflicts, but since Rtools/g++ behaves the same as Debian/g++, I guess this is not the root cause. But it means that I don't put much weight on CygWin/clang - the failures there are much more likely to be related to my configuration than to Stan or the compiler itself.
(I switch between CygWin and RTools by changing the PATH variable, which should be enough, but you never know)

Thanks for your help
Martin
error_output.txt
Reply all
Reply to author
Forward
0 new messages