stack overflow? really?

98 views
Skip to first unread message

Bob Carpenter

unread,
Oct 21, 2012, 4:42:57 AM10/21/12
to stan...@googlegroups.com
Apparently yes:

http://stackoverflow.com/questions/tagged/stan

We even have a tag.

One more thing to monitor, I guess.

- Bob

Ben Goodrich

unread,
Oct 21, 2012, 7:36:34 AM10/21/12
to stan...@googlegroups.com
I tried to answer some of the questions that had been languishing there. You can configure it to email you once a day questions that are tagged as stan.

Ben

Daniel Lee

unread,
Oct 21, 2012, 7:47:08 AM10/21/12
to stan...@googlegroups.com
For anyone else configuring stackoverflow for emails, there is a link
on the right labeled "tag subscriptions >>". That will take you to
stackexchange.com. I had to sign up for a second account there. From
there, it will let you create a tag filter and it has some email
options.

If others find it useful, we could find a way to post those those on
one of our lists (or create a new list just for alerts).
> --
>
>

Daniel Lee

unread,
Oct 21, 2012, 7:49:32 AM10/21/12
to stan...@googlegroups.com
And Ben, I'm upvoting all your responses on stackoverflow. I don't
know why, but it sounds like a good idea.


PS. Why are we all up and working on Stan on Sunday morning? (Saturday
evening for Bob)

Daniel Lee

unread,
Oct 21, 2012, 7:55:11 AM10/21/12
to stan...@googlegroups.com
Turns out that I don't have the reputation to upvote. When I do, I'll
start upvoting.

Ben Goodrich

unread,
Oct 21, 2012, 8:17:13 AM10/21/12
to stan...@googlegroups.com
Speaking of which, has anyone figured out how to get Google to send emails when someone opens an issue at


We actually got a (one-line) patch (albeit for a trivial warning).

Ben

Daniel Lee

unread,
Oct 21, 2012, 8:57:45 AM10/21/12
to stan...@googlegroups.com
Done. stan-dev is configured to get notifications for every issue. If
that ends up being too much traffic, we can adjust the settings.
> --
>
>

Jiqiang Guo

unread,
Oct 21, 2012, 9:57:25 AM10/21/12
to stan...@googlegroups.com
I will sign up there later. 

A couple of comments on Ben's answer there. 

1. run a model in parallel in Stan, say, dogs is a compiled model:
./dogs --seed=12345 --chain_id=1 
./dogs --seed=12345 --chain_id=2 

The point is that you have to specify the same seed for the results you desired.  Personally, I do not care about correlation at that level. 

2. clang might not work well on old Mac say even Snow Leopard for rstan (ie, old version in Xcode), I will report some details later. 

--
Jiqiang 


On Sun, Oct 21, 2012 at 7:36 AM, Ben Goodrich <goodri...@gmail.com> wrote:
--
 
 

Bob Carpenter

unread,
Oct 21, 2012, 3:44:19 PM10/21/12
to stan...@googlegroups.com
No, but I'd like to be alerted, too. Once the
issues are assigned they get posted when there
are updates.

- Bob

Ben Goodrich

unread,
Oct 21, 2012, 5:09:21 PM10/21/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 9:57:26 AM UTC-4, Jiqiang Guo wrote:
2. clang might not work well on old Mac say even Snow Leopard for rstan (ie, old version in Xcode), I will report some details later. 

Perhaps I spoke too soon, but it raises a different question that I don't know enough about Macs to answer for sure. 

I would speculate that the average Mac user of (R)Stan is better off with a recent version of clang than with g++-4.2.x. We think we think that g++ generates somewhat faster code than clang++ does, but I don't know what we have thoroughly benchmarked that and I somewhat doubt that g++-4.2.x generates faster code than clang++ 3.x. We still have to support g++-4.2.x because that is what CRAN uses for a Mac, but I don't think that implies we should be recommending people use g++-4.2.x on a Mac.

I only know of two potential problems. One is that maybe clang is difficult to install on some Macs. Is it not a simple matter of going to 


and downloading the most recent version that works on whatever cat you have? Maybe you have to put in on your $PATH? The other problem is that clang has had compatibility problems with Rcpp in the past. But Dirk claims to have hopefully resolved them in the latest version:


So, am I overlooking something?

Ben

Bob Carpenter

unread,
Oct 21, 2012, 5:21:40 PM10/21/12
to stan...@googlegroups.com


On 10/21/12 9:57 AM, Jiqiang Guo wrote:

> 1. run a model in parallel in Stan, say, dogs is a compiled model:
> ./dogs --seed=12345 --chain_id=1
> ./dogs --seed=12345 --chain_id=2
>
> The point is that you have to specify the same seed for the results you desired. Personally, I do not care about
> correlation at that level.

If you do this in Stan from the command line and
don't generate your own seed, the time-based
seeding is likely to give both processes exactly
the same random seed. And that we definitely don't
want.

This shouldn't be such an issue with R if you generate
random seeds for the chains from the same R session.

> 2. clang might not work well on old Mac say even Snow Leopard for rstan (ie, old version in Xcode), I will report some
> details later.

That's where we developed most of Stan. Is there
something particular you're worried about?

- Bob

Daniel Lee

unread,
Oct 21, 2012, 5:37:46 PM10/21/12
to stan...@googlegroups.com
On Sun, Oct 21, 2012 at 5:21 PM, Bob Carpenter <ca...@alias-i.com> wrote:
> On 10/21/12 9:57 AM, Jiqiang Guo wrote:
>
>> 1. run a model in parallel in Stan, say, dogs is a compiled model:
>> ./dogs --seed=12345 --chain_id=1
>> ./dogs --seed=12345 --chain_id=2
>>
>> The point is that you have to specify the same seed for the results you
>> desired. Personally, I do not care about
>> correlation at that level.
>
>
> If you do this in Stan from the command line and
> don't generate your own seed, the time-based
> seeding is likely to give both processes exactly
> the same random seed. And that we definitely don't
> want.
>
> This shouldn't be such an issue with R if you generate
> random seeds for the chains from the same R session.

A couple points:
1) if you left off seed, but included chain_id, wouldn't the
skip-ahead still give it essentially different seeds?
2) we've implemented it so that the time based seed has millisecond
resolution, if available on the OS thanks to Boost.


>> 2. clang might not work well on old Mac say even Snow Leopard for rstan
>> (ie, old version in Xcode), I will report some
>> details later.
>
>
> That's where we developed most of Stan. Is there
> something particular you're worried about?
>
> - Bob
>
> --
>
>

Bob Carpenter

unread,
Oct 21, 2012, 5:45:32 PM10/21/12
to stan...@googlegroups.com


On 10/21/12 5:37 PM, Daniel Lee wrote:
> On Sun, Oct 21, 2012 at 5:21 PM, Bob Carpenter <ca...@alias-i.com> wrote:
>> On 10/21/12 9:57 AM, Jiqiang Guo wrote:
>>
>>> 1. run a model in parallel in Stan, say, dogs is a compiled model:
>>> ./dogs --seed=12345 --chain_id=1
>>> ./dogs --seed=12345 --chain_id=2
>>>
...
> A couple points:
> 1) if you left off seed, but included chain_id, wouldn't the
> skip-ahead still give it essentially different seeds?

D'oh. Of course it would.

> 2) we've implemented it so that the time based seed has millisecond
> resolution, if available on the OS thanks to Boost.

ms is too slow -- we need finer. But it's rather moot
given your point about (1) :-)

- Bob

Bob Carpenter

unread,
Oct 21, 2012, 5:59:35 PM10/21/12
to stan...@googlegroups.com
On my Mac:

2.3 GHz i7, 16GB 1600MHz DDR3, Macbook Pro, OSX 10.8.2 (Lion)

with latest g++ and clang++ directly from latest Xcode (4.5.1):

g++:
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1
(Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

clang++:
Apple clang version 4.1 (tags/Apple/clang-421.11.65)
(based on LLVM 3.1svn)

Has g++ always been based on LLVM or has this changed?


For BUGS Vol 1 Rats model, using

make clean-all; make -j4 CC= O=3 models/src/bugs/vol1/rats/rats

(The just model time I touched the model and reran.)


The make and run time for 100K iterations are:

clang++
--------


make all: 28s
make model: 9s
run 100K iter: 13s

g++ (4.2.1)
-------
make all: 1m23s
make model: 10s
run 100K iter: 13s


So it looks like Ben's right, at least for the latest g++ and
clang++ from Xcode.


You can get later versions of g++ from Macports. I don't know
about later versions of clang++.

- Bob


Ben Goodrich

unread,
Oct 21, 2012, 6:19:35 PM10/21/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 5:59:37 PM UTC-4, Bob Carpenter wrote:
On my Mac:

   2.3 GHz i7, 16GB 1600MHz DDR3, Macbook Pro, OSX 10.8.2 (Lion)

with latest g++ and clang++ directly from latest Xcode (4.5.1):

   g++:
   i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1
   (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

   clang++:
   Apple clang version 4.1 (tags/Apple/clang-421.11.65)
   (based on LLVM 3.1svn)

Has g++ always been based on LLVM or has this changed?

I don't know. But if the Xcode toolchain is using LLVM as a preprocessor and just using g++ to finish it, then there is even less reason to think there are going to be substantial differences in execution speed. So, then it becomes a question of which compiler is less of a hassle to get working.

Ben

Bob Carpenter

unread,
Oct 21, 2012, 8:28:49 PM10/21/12
to stan...@googlegroups.com
If it's just final code generation, then there won't
be much difference. If it's optimization, there might
be bigger differences our code's not showing.

As far as installation, they both work out of the
box after installing Xcode and its command-line
tools.

As far as integration with R, no idea. I think g++
is built in.

- Bob

Ben Goodrich

unread,
Oct 21, 2012, 8:35:23 PM10/21/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 8:28:52 PM UTC-4, Bob Carpenter wrote:
As far as installation, they both work out of the
box after installing Xcode and its command-line
tools.

I think installing Xcode is the stumbling block for some people, particularly if you have to upgrade the OS in order to get the proper Xcode.
 
As far as integration with R, no idea.  I think g++
is built in.

The binary doesn't include any compilers. Some compiler collection is necessary to build R from source, but not specifically gcc I don't think.

Ben

Bob Carpenter

unread,
Oct 21, 2012, 8:44:13 PM10/21/12
to stan...@googlegroups.com
Here's a nice graphic of what's going on with
Clang, LLVM and GCC:

http://useyourloaf.com/assets/images/2011/CompilerOptions.png

from:

http://useyourloaf.com/blog/2011/03/21/compiler-options-in-xcode-gcc-or-llvm.html

Xcode just uses a link, and it's easy to redefine.
Here's how it's configured by Xcode:

~/stan>which g++
/usr/bin/g++

~/stan>ls -l /usr/bin/g++
lrwxr-xr-x 1 root wheel 12 Sep 22 20:00 /usr/bin/g++ -> llvm-g++-4.2

- Bob

Ben Goodrich

unread,
Oct 21, 2012, 8:59:03 PM10/21/12
to stan...@googlegroups.com
I suppose at a minimum we should be making it clear in the manual which combinations have been tested on which version of the Mac OS.

Bob Carpenter

unread,
Oct 21, 2012, 9:58:47 PM10/21/12
to stan...@googlegroups.com


On 10/21/12 8:35 PM, Ben Goodrich wrote:
> On Sunday, October 21, 2012 8:28:52 PM UTC-4, Bob Carpenter wrote:
>
> As far as installation, they both work out of the
> box after installing Xcode and its command-line
> tools.
>
>
> I think installing Xcode is the stumbling block for some people, particularly if you have to upgrade the OS in order to
> get the proper Xcode.

Grr. Argh. Apple really sucks about
backward compatibility. I don't mind the
continued upgrade taxation, but it's not going
to win them any corporate customers.

It makes me miss Windows!

MacPorts is an alternative, but it only goes
current + two previous OSes
(now Mountain Lion, Lion, Snow Leopard).

We could suggest MacPorts on the Wiki, but it looks
to be a pretty complicated install and I can't
replicate it for Snow Leopard.

Also, the MacPorts stuff says it depends on having
at least some version of Xcode installed, so I'm not
even sure this would work if you can't get Xcode
any more.

I just kept updating my own machines to make sure
we ran with the latest. And I can't even keep the
stupid names straight -- I'm actually on Mountain Lion.

> As far as integration with R, no idea. I think g++
> is built in.
>
>
> The binary doesn't include any compilers. Some compiler collection is necessary to build R from source, but not
> specifically gcc I don't think.

Ah, right. I think what's going on is that
the makefile comes with g++ -O2 specified.

- Bob

Bob Carpenter

unread,
Oct 21, 2012, 10:07:08 PM10/21/12
to stan...@googlegroups.com
I've tested command-line Stan:

Stan 1.0.2 Clang-LLVM Xcode 4.5.1 Mountain Lion
Stan 1.0.2 GCC-LLVM Xcode 4.5.1 Mountain Lion

both with our own Boost and Eigen lib versions.

I've tested RStan:

RStan 1.0.2 GCC-LLVM Xcode 4.5.1 Mountain Lion R 2.15.1 64-bit

with whatever lib versions it comes with.

Are there other relevant parameters to list?

- Bob
> --
>
>

Jiqiang Guo

unread,
Oct 21, 2012, 10:22:50 PM10/21/12
to stan...@googlegroups.com
I was just saying there might be problems with the clang included in Xcode for *older* version of Mac. 

A while ago, I tried to use clang build rstan on a Snow Leopard with Xcode 3.2.6 but failed.  I did not pay attention then.  I tried again today and heere is the part of error message: (file math__matrix.cpp in rstan is math/matrix.cpp in Stan).  The version of clang is

mmac:Desktop jq2$ clang -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

I tried to compile the math/matrix.cpp in Stan using this clang, which seems to work if -DNDEBUG is not specified, but would have the same problem if it is specified. 

clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c math__matrix.cpp -o math__matrix.o
0  clang             0x0000000100de1252 PrintStackTrace(void*) + 34
1  clang             0x0000000100de1729 SignalHandler(int) + 633
2  libSystem.B.dylib 0x00007fff84d891ba _sigtramp + 26
3  libSystem.B.dylib 0x00007fff5fbfa8d8 _sigtramp + 3672577848
4  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
5  clang             0x00000001003ec19f llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 287
6  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
7  clang             0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
8  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
9  clang             0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
10 clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
11 clang             0x00000001003e42af llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags) + 6175
12 clang             0x00000001003e2a4c llvm::ScalarEvolution::getAddExpr(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags) + 108
13 clang             0x00000001003dcddc llvm::ScalarEvolution::createSCEV(llvm::Value*) + 6204
14 clang             0x00000001003db2de llvm::ScalarEvolution::getSCEV(llvm::Value*) + 382
15 clang             0x00000001003dade2 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 274
16 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
17 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
18 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
19 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
20 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
21 clang             0x00000001003dacbb llvm::IVUsers::runOnLoop(llvm::Loop*, llvm::LPPassManager&) + 347
22 clang             0x00000001001fa244 llvm::LPPassManager::runOnFunction(llvm::Function&) + 996
23 clang             0x0000000100132855 llvm::FPPassManager::runOnFunction(llvm::Function&) + 325
24 clang             0x000000010013739b llvm::FPPassManager::runOnModule(llvm::Module&) + 139
25 clang             0x0000000100132fd4 llvm::MPPassManager::runOnModule(llvm::Module&) + 276
26 clang             0x0000000100132b58 llvm::PassManagerImpl::run(llvm::Module&) + 280
27 clang             0x0000000100132a3d llvm::PassManager::run(llvm::Module&) + 13
28 clang             0x000000010060196d clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 4381
29 clang             0x000000010011a3f6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 246
30 clang             0x0000000100042276 clang::ParseAST(clang::Sema&, bool) + 422
31 clang             0x0000000100040caf clang::CodeGenAction::ExecuteAction() + 671
32 clang             0x000000010002ca9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
33 clang             0x000000010002ab18 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
34 clang             0x000000010001f315 cc1_main(char const**, char const**, char const*, void*) + 5333
35 clang             0x000000010000247b main + 667
36 clang             0x00000001000021d4 start + 52
37 clang             0x000000000000003d start + 4294958749
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -disable-llvm-verifier -main-file-name math__matrix.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file math__matrix.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I /Library/Frameworks/R.framework/Resources/include -I /Library/Frameworks/R.framework/Resources/include/x86_64 -I ../inst/include/stansrc -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported -I ../inst/include/stanlib/boost_1.51.0 -I ../inst/include -I /usr/local/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -O3 -fdeprecated-macro -ferror-limit 19 -fmessage-length 135 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o math__matrix.o -x c++ math__matrix.cpp 
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'math__matrix.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
5. Running pass 'Induction Variable Users' on basic block '%253'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
make: *** [math__matrix.o] Error 254


--
Jiqiang

P.S. Full error message:



mmac:Desktop jq2$ R --arch x86_64 CMD INSTALL rstan_1.0.2.tar.gz
* installing to library '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
* installing *source* package 'rstan' ...
** package 'rstan' successfully unpacked and MD5 sums checked
** libs
** arch - x86_64
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c stanc.cpp -o stanc.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__grammars__whitespace_grammar_inst.cpp -o gm__grammars__whitespace_grammar_inst.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__grammars__program_grammar_inst.cpp -o gm__grammars__program_grammar_inst.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__grammars__statement_grammar_inst.cpp -o gm__grammars__statement_grammar_inst.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__ast_def.cpp -o gm__ast_def.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__grammars__var_deccls_grammar_inst.cpp -o gm__grammars__var_deccls_grammar_inst.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c gm__grammars__expression_grammar_inst.cpp -o gm__grammars__expression_grammar_inst.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c chains.cpp -o chains.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c misc.cpp -o misc.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c agrad__agrad.cpp -o agrad__agrad.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c agrad__matrix.cpp -o agrad__matrix.o
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"   -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c math__matrix.cpp -o math__matrix.o
0  clang             0x0000000100de1252 PrintStackTrace(void*) + 34
1  clang             0x0000000100de1729 SignalHandler(int) + 633
2  libSystem.B.dylib 0x00007fff84d891ba _sigtramp + 26
3  libSystem.B.dylib 0x00007fff5fbfa8d8 _sigtramp + 3672577848
4  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
5  clang             0x00000001003ec19f llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 287
6  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
7  clang             0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
8  clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
9  clang             0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
10 clang             0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
11 clang             0x00000001003e42af llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags) + 6175
12 clang             0x00000001003e2a4c llvm::ScalarEvolution::getAddExpr(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags) + 108
13 clang             0x00000001003dcddc llvm::ScalarEvolution::createSCEV(llvm::Value*) + 6204
14 clang             0x00000001003db2de llvm::ScalarEvolution::getSCEV(llvm::Value*) + 382
15 clang             0x00000001003dade2 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 274
16 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
17 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
18 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
19 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
20 clang             0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
21 clang             0x00000001003dacbb llvm::IVUsers::runOnLoop(llvm::Loop*, llvm::LPPassManager&) + 347
22 clang             0x00000001001fa244 llvm::LPPassManager::runOnFunction(llvm::Function&) + 996
23 clang             0x0000000100132855 llvm::FPPassManager::runOnFunction(llvm::Function&) + 325
24 clang             0x000000010013739b llvm::FPPassManager::runOnModule(llvm::Module&) + 139
25 clang             0x0000000100132fd4 llvm::MPPassManager::runOnModule(llvm::Module&) + 276
26 clang             0x0000000100132b58 llvm::PassManagerImpl::run(llvm::Module&) + 280
27 clang             0x0000000100132a3d llvm::PassManager::run(llvm::Module&) + 13
28 clang             0x000000010060196d clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 4381
29 clang             0x000000010011a3f6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 246
30 clang             0x0000000100042276 clang::ParseAST(clang::Sema&, bool) + 422
31 clang             0x0000000100040caf clang::CodeGenAction::ExecuteAction() + 671
32 clang             0x000000010002ca9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
33 clang             0x000000010002ab18 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
34 clang             0x000000010001f315 cc1_main(char const**, char const**, char const*, void*) + 5333
35 clang             0x000000010000247b main + 667
36 clang             0x00000001000021d4 start + 52
37 clang             0x000000000000003d start + 4294958749
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -disable-llvm-verifier -main-file-name math__matrix.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file math__matrix.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I /Library/Frameworks/R.framework/Resources/include -I /Library/Frameworks/R.framework/Resources/include/x86_64 -I ../inst/include/stansrc -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported -I ../inst/include/stanlib/boost_1.51.0 -I ../inst/include -I /usr/local/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -O3 -fdeprecated-macro -ferror-limit 19 -fmessage-length 135 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o math__matrix.o -x c++ math__matrix.cpp 
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'math__matrix.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
5. Running pass 'Induction Variable Users' on basic block '%253'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
make: *** [math__matrix.o] Error 254
ERROR: compilation failed for package 'rstan'
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rstan'



Ben

--
 
 

Marcus Brubaker

unread,
Oct 21, 2012, 10:28:50 PM10/21/12
to stan...@googlegroups.com
We could also incorporate the process ID in the seeding or, if you want to be really clever, read some data from /dev/random to seed things.

Cheers,
Marcus

--



Ben Goodrich

unread,
Oct 21, 2012, 11:04:16 PM10/21/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 10:28:51 PM UTC-4, Marcus Brubaker wrote:
We could also incorporate the process ID in the seeding or, if you want to be really clever, read some data from /dev/random to seed things.

/dev/random doesn't work on Windows, although inside R it is fairly easy to get a seed from www.random.org with the random package. 

Maybe we could incorporate the process ID if chain_id is not set. But I think the best route is "same seed, different chain_id, modern PRNG".

Ben

Ben Goodrich

unread,
Oct 21, 2012, 11:05:49 PM10/21/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 10:07:14 PM UTC-4, Bob Carpenter wrote:
Are there other relevant parameters to list? 

So is it correct that we have no information as to whether a pure g++ works on a Mac for any OS or g++ version?

Ben
 

Marcus Brubaker

unread,
Oct 21, 2012, 11:18:32 PM10/21/12
to stan...@googlegroups.com
On Sun, Oct 21, 2012 at 11:04 PM, Ben Goodrich <goodri...@gmail.com> wrote:
On Sunday, October 21, 2012 10:28:51 PM UTC-4, Marcus Brubaker wrote:
We could also incorporate the process ID in the seeding or, if you want to be really clever, read some data from /dev/random to seed things.

/dev/random doesn't work on Windows, although inside R it is fairly easy to get a seed from www.random.org with the random package. 


From R it might make sense to get a random draw from the R PRNG to seed the Stan PRNG.  This has the upside that the user gets the expected behaviour in their code by storing/setting the R PRNG state and, unless they want to, never need to know or worry about a separate PRNG inside stan.
 

Maybe we could incorporate the process ID if chain_id is not set. But I think the best route is "same seed, different chain_id, modern PRNG".

I was only suggesting using the PID when the seed wasn't specified to avoid starting multiple chains with the same seed by accident.  For instance, someone may not use the chain id (I mean, right now it's effect is purely cosmetic) and instead just launch N copies of command line stan with different out files.  If all (or even a few) of them got the same seed this would be bad.

Cheers,
Marcus
 

Ben

--
 
 

Bob Carpenter

unread,
Oct 21, 2012, 11:26:02 PM10/21/12
to stan...@googlegroups.com
I tested it ages ago when we hadn't ruled out
C++11 and I needed a version beyond 4.2.1. But
no, I haven't tested it in ages -- I didn't even
realize what the relationship between GCC, Clang
and LLVM and how they were configured in Xcode until
today.

- Bob
> --
>
>

Bob Carpenter

unread,
Oct 21, 2012, 11:34:31 PM10/21/12
to stan...@googlegroups.com


On 10/21/12 10:22 PM, Jiqiang Guo wrote:
> I was just saying there might be problems with the clang included in Xcode for *older* version of Mac.

Indeed. It's a whole mix of 32-bit/64-bit, R version,
OSX version, Xcode/Macports or GCC/Clang version issues.

I don't really have a good solution for
being able to make everywhere. What we really need
is a bunch of step-by-step workaround tutorials.

Maybe we could get users to contribute some if
they have success installing?

More below on this particular issue.

> A while ago, I tried to use clang build rstan on a Snow Leopard with Xcode 3.2.6 but failed. I did not pay attention
> then. I tried again today and heere is the part of error message: (file math__matrix.cpp in rstan is math/matrix.cpp in
> Stan). The version of clang is
>
> mmac:Desktop jq2$ clang -v
> Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
> Target: x86_64-apple-darwin10.8.0
> Thread model: posix
>
> I tried to compile the math/matrix.cpp in Stan using this clang, which seems to work if -DNDEBUG is not specified, but
> would have the same problem if it is specified.
>
> clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
> -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"
> -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"
> -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"
> -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include
> -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c math__matrix.cpp -o
> math__matrix.o
> 0 clang 0x0000000100de1252 PrintStackTrace(void*) + 34
> 1 clang 0x0000000100de1729 SignalHandler(int) + 633

....

Yikes. Looks like something's
segfaulting inside clang when it tries
to build the R math libs. This may not
even be a Stan issue.

Did you try running that compiler on
just the make on the Stan code?

I never tried anything older in RStan
at all.

...
> 37 clang 0x000000000000003d start + 4294958749
> Stack dump:
> 0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free
> -disable-llvm-verifier -main-file-name math__matrix.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose
> -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file math__matrix.o -resource-dir
> /usr/bin/../lib/clang/3.0 -D NDEBUG -I /Library/Frameworks/R.framework/Resources/include -I
> /Library/Frameworks/R.framework/Resources/include/x86_64 -I ../inst/include/stansrc -I
> /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include -I
> /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported -I
> ../inst/include/stanlib/boost_1.51.0 -I ../inst/include -I /usr/local/include -I
> /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -O3 -fdeprecated-macro -ferror-limit 19
> -fmessage-length 135 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option
> -fcolor-diagnostics -o math__matrix.o -x c++ math__matrix.cpp
> 1. <eof> parser at end of file
> 2. Code generation
> 3. Running pass 'Function Pass Manager' on module 'math__matrix.cpp'.
> 4. Running pass 'Loop Pass Manager' on function
> '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
> 5. Running pass 'Induction Variable Users' on basic block '%253'
> clang: error: unable to execute command: Segmentation fault
> clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
> make: *** [math__matrix.o] Error 254

This is why I think it's in the math lib linking.

- Bob

Ben Goodrich

unread,
Oct 22, 2012, 12:14:33 AM10/22/12
to stan...@googlegroups.com
On Sunday, October 21, 2012 5:59:37 PM UTC-4, Bob Carpenter wrote:
So it looks like Ben's right, at least for the latest g++ and
clang++ from Xcode.

At this point, it is easier to benchmark rstan. I made a rstan package from master after setting g++ in $HOME/.R/Makevars and did

example(stan_demo)

bench <- function(i) {
  compile <- system.time(fit <- stan_demo(i, chains = 0, iter = 0))
  execute <- system.time(fit <- stan_demo(i, fit = fit, seed = 12345, refresh = -1))
  if(length(dim(fit)) == 0) execute <- NA_real_ # failure
  return(rbind(compile, execute))
}

results <- mclapply(1:length(model_names), mc.cores = 4L, FUN = bench,
                    mc.preschedule = FALSE)

names(results) <- model_names


then I saved those results, recompiled a rstan package after setting clang++ in $HOME/.R/Makevars, and did the above again. Over about 75 models, I would declare a tie on my laptop on the basis of the attachment.

Ben

Bob Carpenter

unread,
Oct 22, 2012, 1:38:06 AM10/22/12
to stan...@googlegroups.com
Nice -- that's a little more thorough than
my eval :-)

Was that at -O3 optimization?

And is that an LLVM-based gcc or front-to-back
gcc? (Or does that quesiton even make sense on
Linux.)

Although not ideal for testing compilers, if
you run under R, it makes sense to test there.
It also makes sense to throw in compile time as far
as that goes, I think.

- Bob
> <https://lh6.googleusercontent.com/-pgP_RuRJL00/UITHtmzbreI/AAAAAAAAAGw/0Bu4EyV-7AA/s1600/execution.png>
>
> Ben
>
> --
>
>

Ben Goodrich

unread,
Oct 22, 2012, 1:46:51 AM10/22/12
to stan...@googlegroups.com
 On Monday, October 22, 2012 1:38:09 AM UTC-4, Bob Carpenter wrote:
Was that at -O3 optimization?

Yes, specifically just varying CC and CXX before building rstan:

goodrich@CYBERPOWERPC:~$ cat ~/.R/Makevars
CC=clang
CXX=clang++

# created by rstan at Fri Oct 12 00:16:32 2012
CXXFLAGS = -O3 -pipe  $(LTO)  #set_by_rstan
R_XTRA_CPPFLAGS =  -I$(R_INCLUDE_DIR) -DNDEBUG  #set_by_rstan
goodrich@CYBERPOWERPC:~$
 
And is that an LLVM-based gcc or front-to-back
gcc?  (Or does that quesiton even make sense on
Linux.)

You could probably accomplish that on Linux, but I've never done it. Clang was using the GNU C++ standard library libstdc++. The Clang people have their version of the standard library

http://libcxx.llvm.org/

but Stan doesn't work with that yet. Actually, it might work but gtest doesn't, so Stan has never passed test-unit linking against it.
 
Although not ideal for testing compilers, if
you run under R, it makes sense to test there.
It also makes sense to throw in compile time as far
as that goes, I think.

The compile time was like 5x longer for g++, but we knew that already.
 
Ben

Jiqiang Guo

unread,
Oct 22, 2012, 9:46:22 AM10/22/12
to stan...@googlegroups.com
Please see the details below. 

Jiqiang

On Sun, Oct 21, 2012 at 11:34 PM, Bob Carpenter <ca...@alias-i.com> wrote:


On 10/21/12 10:22 PM, Jiqiang Guo wrote:
I was just saying there might be problems with the clang included in Xcode for *older* version of Mac.

Indeed.  It's a whole mix of 32-bit/64-bit, R version,
OSX version, Xcode/Macports or GCC/Clang version issues.

I don't really have a good solution for
being able to make everywhere.  What we really need
is a bunch of step-by-step workaround tutorials.

Maybe we could get users to contribute some if
they have success installing?

More below on this particular issue.


A while ago, I tried to use clang build rstan on a Snow Leopard with Xcode 3.2.6 but failed.  I did not pay attention
then.  I tried again today and heere is the part of error message: (file math__matrix.cpp in rstan is math/matrix.cpp in
Stan).  The version of clang is

mmac:Desktop jq2$ clang -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

I tried to compile the math/matrix.cpp in Stan using this clang, which seems to work if -DNDEBUG is not specified, but
would have the same problem if it is specified.
I should have highlighted this part. More details directly in Stan (my conclusion is that no -DNDEBUG for this version of clang on this particular platform).

mmac:stan jq2$ 
mmac:stan jq2$ mkdir - bin/stan/math   
mkdir: bin/stan: No such file or directory
mmac:stan jq2$ mkdir -p bin/stan/math
mmac:stan jq2$ g++ -I src -I lib/eigen_3.1.1 -I lib/boost_1.51.0 -O3 -Wall -Wno-unused-function   -c -o bin/stan/math/matrix.o src/stan/math/matrix.cpp
mmac:stan jq2$ clang++ -I src -I lib/eigen_3.1.1 -I lib/boost_1.51.0 -O3 -Wall -Wno-unused-function   -c -o bin/stan/math/matrix.o src/stan/math/matrix.cpp
mmac:stan jq2$ clang++ -DNDEBUG -I src -I lib/eigen_3.1.1 -I lib/boost_1.51.0 -O3 -Wall -Wno-unused-function   -c -o bin/stan/math/matrix.o src/stan/math/matrix.cpp
0  clang             0x0000000100de1252 PrintStackTrace(void*) + 34
1  clang             0x0000000100de1729 SignalHandler(int) + 633
2  libSystem.B.dylib 0x00007fff84d891ba _sigtramp + 26
3  libSystem.B.dylib 0x00007fff5fbfba78 _sigtramp + 3672582360
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -disable-llvm-verifier -main-file-name matrix.cpp -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file bin/stan/math/matrix.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I src -I lib/eigen_3.1.1 -I lib/boost_1.51.0 -O3 -Wall -Wno-unused-function -fdeprecated-macro -ferror-limit 19 -fmessage-length 152 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o bin/stan/math/matrix.o -x c++ src/stan/math/matrix.cpp 
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'src/stan/math/matrix.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
5. Running pass 'Induction Variable Users' on basic block '%253'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
mmac:stan jq2$ clang -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
clang++  -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc"
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include"
  -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported"
  -I"../inst/include/stanlib/boost_1.51.0"  -I"../inst/include"  -I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -O3  -c math__matrix.cpp -o
math__matrix.o
0  clang             0x0000000100de1252 PrintStackTrace(void*) + 34
1  clang             0x0000000100de1729 SignalHandler(int) + 633
....

Yikes.  Looks like something's
segfaulting inside clang when it tries
to build the R math libs.  This may not
even be a Stan issue.
There is not R math libs involved.  
math__matrix.cpp in RStan is essentially math/matrix.cpp in Stan.   

Did you try running that compiler on
just the make on the Stan code?

See the above.  


- Bob

--



Jiqiang Guo

unread,
Oct 22, 2012, 10:17:45 AM10/22/12
to stan...@googlegroups.com
It looks like that I have to answer questions there and accumulate reputation to comment there. 

--
Jiqiang

Matt Hoffman

unread,
Oct 22, 2012, 8:09:54 PM10/22/12
to stan...@googlegroups.com
I've found homebrew much easier to use than macports, for the record.
Not sure if that solves any of the other problems, though.

Matt
> --
>
>

Bob Carpenter

unread,
Oct 23, 2012, 4:02:30 PM10/23/12
to stan...@googlegroups.com
On 10/22/12 8:09 PM, Matt Hoffman wrote:
> I've found homebrew much easier to use than macports, for the record.
> Not sure if that solves any of the other problems, though.

In case I wasn't the only one who wondered whether Matt meant
"homebrew" generically (as in build it yourself) or was
referring to something else. The answer's the latter:

http://mxcl.github.com/homebrew/

I just added a link in the manual.

- Bob

Reply all
Reply to author
Forward
0 new messages