bin/stanc build fails with g++ Apple LLVM version 5.0 and -O3

71 views
Skip to first unread message

Bob Carpenter

unread,
Oct 8, 2013, 2:02:28 AM10/8/13
to stan...@googlegroups.com
[moved to stan-dev]


On 10/7/13 6:58 PM, Jiqiang Guo wrote:
> After reinstalling the mac os and xcode, I cannot build bin/stanc now.

You mean from latest develop branch?

> The error message is:
>
> = expression07_r(_r1) [_val = _1]
> ^
> lib/boost_1.54.0/boost/fusion/view/transform_view/detail/value_of_impl.hpp:32:32: note: use -ftemplate-depth=N to
> increase recursive template
> instantiation depth
> result_of::value_of<typename Iterator::first_type>::type

You could boost the template depth, but we don't want users to have
to do that to install.

I can probably rejigger the parser again to cut down on
depth.

What I don't understand is why you're having problems

>
> My g++ version is:
>
> $ g++ -v
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
> Target: x86_64-apple-darwin12.5.0
> Thread model: posix

Where did you get that? I thought I was running latest Xcode, but
when I fired XCode up to check, it asked me to click through a license
and then it installed. And now it says this:

|
~$ g++ -v
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror
--prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11
--with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
|


With my g++, building with:

|
$ make CC=g++ O=3 bin/stanc
|

works just fine. Takes forever, but it works.


Where did you get your version?

What are you using, Daniel? And we're not having issues building bin/stanc
on Windows are we?

Also, bin/stanc doesn't need to be built with -O3.

- Bob

Jiqiang Guo

unread,
Oct 8, 2013, 7:38:36 AM10/8/13
to stan...@googlegroups.com
Please see my answer to your questions. 
--
Jiqiang


On Tue, Oct 8, 2013 at 2:02 AM, Bob Carpenter <ca...@alias-i.com> wrote:
[moved to stan-dev]


On 10/7/13 6:58 PM, Jiqiang Guo wrote:
After reinstalling the mac os and xcode, I cannot build bin/stanc now.

You mean from latest develop branch?
Yes.  I did not try the released 1.3 version.  

The error message is:

         = expression07_r(_r1) [_val = _1]
         ^
lib/boost_1.54.0/boost/fusion/view/transform_view/detail/value_of_impl.hpp:32:32: note: use -ftemplate-depth=N to
increase recursive template
       instantiation depth
                     result_of::value_of<typename Iterator::first_type>::type

You could boost the template depth, but we don't want users to have
to do that to install.

I can probably rejigger the parser again to cut down on
depth.

What I don't understand is why you're having problems


My g++ version is:

$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

Where did you get that?  I thought I was running latest Xcode, but
when I fired XCode up to check, it asked me to click through a license
and then it installed.  And now it says this:
 
Just from Xcode 5.0.  I only have installed Xcode.  I think it is the latest one since it is released around Sept. 18 (http://9to5mac.com/2013/09/18/xcode-5-0-released-with-ios-7-sdk-64-bit-app-compiler/).  Are you sure you have the latest one?  It would be weird if I am the only one having this problem. 

|
~$ g++ -v
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
|


With my g++, building with:

|
$ make CC=g++ O=3 bin/stanc
|

works just fine.  Takes forever, but it works.


Where did you get your version?

What are you using, Daniel?  And we're not having issues building bin/stanc
on Windows are we?

Also, bin/stanc doesn't need to be built with -O3.


- Bob

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

Jiqiang Guo

unread,
Oct 8, 2013, 7:46:33 AM10/8/13
to stan...@googlegroups.com
On Tue, Oct 8, 2013 at 2:02 AM, Bob Carpenter <ca...@alias-i.com> wrote:
~$ g++ -v
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
|

According to here https://trac.macports.org/wiki/XcodeVersionInfo, you are not using the latest Xcode (that is, 5.0).  Yours is 4.6.3. 

--
Jiqiang

Daniel Lee

unread,
Oct 8, 2013, 9:29:02 AM10/8/13
to stan...@googlegroups.com

I don't think we can build with g++-4.2. I think that's true cross-platform. It doesn't support some part of the templating we use (I can't remember off the top of my head which features were added in 4.3).

I think Bob and I installed our versions using MacPorts.

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.

Jiqiang Guo

unread,
Oct 8, 2013, 8:52:31 PM10/8/13
to stan...@googlegroups.com
I think you (Daniel) are wrong about gcc 4.2.1.  I have never installed another c++ compilers but xcode.  Xcode worked for me for stan and rstan.  

But for Xcode 5, it does not matter now. According to here (http://apple.stackexchange.com/questions/102863/where-to-find-arm-gcc-compiler-in-xcode5), gcc(g++) in Xcode 5 is actually clang(clang++).  And I do have the same (error) output from gcc and clang now.  So essentially the problem is a clang++ problem.  And I failed to build bin/stanc (or rstan) 1.3.0 using Xcode 5.  So I am afraid that Mac users who upgraded to Xcode 5 are not able to install stan/rstan 1.3.0. 

--
Jiqiang 

Bob Carpenter

unread,
Oct 8, 2013, 9:00:16 PM10/8/13
to stan...@googlegroups.com
I updated to Xcode 5. But I don't seem to be picking
up the new compilers. What did you do to turn them
on? There used to be something under Xcode that you
selected to activate the command-line tools (which I
always found very confusing).

We definitely want to make Stan work with the latest
Xcode. I'll continue to break the grammars down into
bite-sized pieces.

I have to say I'm disappointed that the new version is
less scalable than the last version (at least with
whatever default settings Jiqiang has).

- Bob

Bob Carpenter

unread,
Oct 8, 2013, 9:03:56 PM10/8/13
to stan...@googlegroups.com
OK, I think I figured it out. I needed to go to the
Apple web site to get the command-line tools. I used
to be able to get them through Xcode itself.

Looks like yet more doc to rewrite before Stan 2!

- Bob

Jiqiang Guo

unread,
Oct 8, 2013, 9:04:33 PM10/8/13
to stan...@googlegroups.com
Xcode -> preference -> Downloads -> command tool, 
see the attachment. 


--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.
Screen Shot 2013-10-08 at 9.03.22 PM.png
Reply all
Reply to author
Forward
0 new messages