You are here

Rosetta 3.5 Compiling Error - Mac OSX 10.8.5

25 posts / 0 new
Last post
Rosetta 3.5 Compiling Error - Mac OSX 10.8.5
#1

Hi All,

I'm attempting to build Rosetta3.5 on my Mac and keep running into a compiling error with Calculator.os that terminates the build. Any suggestions would be much appreciated. I've also tried building within Xcode, and the build terminates with a number of similar errors (apparently missing files). I downloaded Rosetta3.5 as a single bundle, by the way.

My command line compiler:
[Ryans-iMac:~/applications/rosetta-3.5/rosetta_source] Ryan% gcc -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.4.0
Thread model: posix

My Xcode:
Version 5.0 (5A1413)
with command line tools installed

The error I get after successfully building for 30min or so:
...
gn_eval,
boost::fusion::vector,
boost::spirit::argument<0>, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > > &>,
0> >, 2> &>, 2> &>, 2> &>, 1> &>, 2> >' requested here
expression =
^
external/boost_1_46_1/boost/mpl/aux_/preprocessed/gcc/apply.hpp:45:20: note:
use -ftemplate-depth=N to increase recursive template instantiation depth
typename lambda::type
^
1 error generated.
scons: *** [build/src/release/macos/10.8/64/x86/gcc/4.2/default/numeric/Calculator.os] Error 1
scons: building terminated because of errors.

What do you think?

Thanks,
Ryan

Post Situation: 
Sun, 2013-09-22 18:09
rnotti

Ah, boost. Or, perhaps, ugh, boost.

First thing to try: one of the weekly releases, which are more recent and maybe won't have this problem.

Second thing to try: I think that particular class is very narrow in its application...we may be able to just disable that code to compile around it...you'll be missing a narrow function (the CalculatorFilter for RosettaScripts), but otherwise should be okay. Are you planning on using CalculatorFilter in RosettaScripts?

Mon, 2013-09-23 07:20
smlewis

Thanks for the reply smlewis!

To be honest, I'm not sure yet if I'll need the CalculatorFilter. I'm attending the Rosetta workshop at Vanderbilt in two months, and will have a better idea after that which applications I'll end up using. For certain, I'll be attempting some ab initio folding, some protein-protein docking; and potentially small molecule docking, antibody loop modeling, and protein design. Think I can get away without it? If so, how might I go about deleting this process from the script? (I've taken a short course in Python, but never written anything large enough to require compiling etc, so I'm a novice in this regard.)

Thanks a ton. You all do a great job mod-ing these threads.

Ryan

Mon, 2013-09-23 09:25
rnotti

Also, might there be a different source of c++ libraries I should download that might work better than boost?

Mon, 2013-09-23 10:40
rnotti

This should be the Rosetta supplied boost. If it's linking to your own copy of boost, that's definitely the problem, but the path looks right to be Rosetta-supplied boost. (note "external/boost_1_46_1" - that's in the rosetta_source directory)

Mon, 2013-09-23 10:46
smlewis

I've been doing a poor job with the threads recently - Rocco and Jared took up the slack.

The reason I want to suggest disabling this Calculator class is because your error message is difficult-to-interpret Boost templating junk, and it will be way less effort to route around the problem than try to patch it individually. It may also be that your machine is misconfigured in some way - I notice your gcc -v reports something about LLVM/clang, which strikes me as strange, but there's nothing that I see obviously wrong.

There isn't a line number in the error message you reported, so I'll give instructions for just removing Calculator entirely. I think you aren't hugely likely to need it...it's a cool function but not part of any of the core Rosetta methods that you indicated interest in. It's a tool for RosettaScripts.

A) Remove/ comment out the line "Calculator", from src/numeric.src.settings (line 15)
B) Remove/ comment out the line "CalculatorFilter", from src/protocols.1.src.settings (line 27)
C) Remove/comment out the lines containing CalculatorFilter from these files:

protocols/init/init.FilterCreators.ihh
20:#include

protocols/init/init.FilterRegistrators.ihh
29:static FilterRegistrator< protocols::filters::CalculatorFilterCreator > reg_CalculatorFilterCreator;

Then try recompiling...it looks like that will neatly excise CalculatorFilter, but since I can't reproduce your bug I can't really test for you.

Mon, 2013-09-23 10:41
smlewis

sigh...

Removed the lines as instructed and made it through the calculator.os problem! Thanks for the help!

...but...

Ran into a linker issue:

...
"operator new(unsigned long)", referenced from:
ObjexxFCL::Dimension::Dimension(ObjexxFCL::Dimension const&) in Dimension.os
ObjexxFCL::Dimension::Dimension(ObjexxFCL::Dimension const&) in Dimension.os
ObjexxFCL::Dimension::Dimension(int) in Dimension.os
ObjexxFCL::Dimension::Dimension(int) in Dimension.os
ObjexxFCL::Dimension::Dimension(double) in Dimension.os
ObjexxFCL::Dimension::Dimension(double) in Dimension.os
ObjexxFCL::Dimension::operator=(ObjexxFCL::Dimension const&) in Dimension.os
...
"___cxa_begin_catch", referenced from:
___clang_call_terminate in Dimension.os
___clang_call_terminate in DynamicIndexRange.os
___clang_call_terminate in format.os
___clang_call_terminate in string.functions.os
___clang_call_terminate in Time_Date.os
"___cxa_pure_virtual", referenced from:
vtable for ObjexxFCL::ObserverSingle in DynamicIndexRange.os
vtable for ObjexxFCL::ObserverMulti in ObserverMulti.os
"___dynamic_cast", referenced from:
ObjexxFCL::internal::ObserverGraph::ObserverGraph(ObjexxFCL::Observer const&) in ObserverGraph.os
ObjexxFCL::internal::ObserverGraph::push(ObjexxFCL::Observer const&, ObjexxFCL::Observer const&) in ObserverGraph.os
ObjexxFCL::internal::ObserverGraph::pop() in ObserverGraph.os
ObjexxFCL::internal::ObserverMediator::accumulate(ObjexxFCL::Observer const&, ObjexxFCL::Observer const&, ObjexxFCL::SetWrapper&) in ObserverMediator.os
"___gxx_personality_v0", referenced from:
ObjexxFCL::operator>>(std::istream&, ObjexxFCL::Cstring&) in Cstring.os
Dwarf Exception Unwind Info (__eh_frame) in Cstring.os
ObjexxFCL::Dimension::Dimension(ObjexxFCL::Dimension const&) in Dimension.os
ObjexxFCL::Dimension::Dimension(ObjexxFCL::Dimension const&) in Dimension.os
ObjexxFCL::Dimension::Dimension(int) in Dimension.os
ObjexxFCL::Dimension::Dimension(int) in Dimension.os
ObjexxFCL::Dimension::Dimension(double) in Dimension.os
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/src/release/macos/10.8/64/x86/gcc/4.2/default/libObjexxFCL.dylib] Error 1
scons: building terminated because of errors.

This strikes me as odd, given that my ld claims to explicitly recognize x86_64:
bash-3.2$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-136
configured to support archs: i386 x86_64 armv7 armv7s
LTO support using: LLVM version 3.3

Any suggestions? The gcc4.2 that I'm using came with the Xcode command line tools, so I would imagine that other Mac users might have similar problems.

Thanks
r

Mon, 2013-09-23 14:48
rnotti

Oops, left off the top of the error showing its actual source

llvm-g++-4.2 -o build/src/release/macos/10.8/64/x86/gcc/4.2/default/libObjexxFCL.dylib -dynamiclib -install_name /Applications/rosetta-3.5/rosetta_source/build/src/release/macos/10.8/64/x86/gcc/4.2/default/libObjexxFCL.dylib -m64 build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/char.functions.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Cstring.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Dimension.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/DimensionExpression.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/DimensionExpressionRef.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/DynamicIndexRange.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/format.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Fstring.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/IndexRange.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Observer.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/ObserverGraph.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/ObserverMediator.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/ObserverMulti.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Star.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/string.functions.os build/src/release/macos/10.8/64/x86/gcc/4.2/default/ObjexxFCL/Time_Date.os -Lexternal/lib -Lbuild/src/release/macos/10.8/64/x86/gcc/4.2/default -Lsrc -Lbuild/external/release/macos/10.8/64/x86/gcc/4.2/default -Lexternal -L/usr/lib
ld: warning: directory not found for option '-Lbuild/external/release/macos/10.8/64/x86/gcc/4.2/default'
Undefined symbols for architecture x86_64:
"std::string::find_last_not_of(char const*, unsigned long, unsigned long) const", referenced from:
ObjexxFCL::trim_whitespace(std::string&) in string.functions.os
ObjexxFCL::strip(std::string&, std::string const&) in string.functions.os
ObjexxFCL::rstrip(std::string&, std::string const&) in string.functions.os
ObjexxFCL::strip_whitespace(std::string&) in string.functions.os
ObjexxFCL::rstrip_whitespace(std::string&) in string.functions.os
ObjexxFCL::trimmed_whitespace(std::string const&) in string.functions.os
ObjexxFCL::stripped(std::string const&, std::string const&) in string.functions.os
...

Mon, 2013-09-23 20:52
rnotti

You might want to try the most recent weekly release (top left here):
https://www.rosettacommons.org/software/academic/

It seemed to work just fine when I did a gcc compile after the Xcode 5.0 update.

Tue, 2013-09-24 06:06
stranges

Thanks for the advice stranges. Tried to build the wk36 release and ran into the same problem with objexx. Something must be misconfigured in my mac (??). I was able to build wk36 no problem in Fedora (same machine, dual boot), but it would definitely be more convenient to run Rosetta in OSX, so if anyone has any suggestions for how to get OSX to jive with objexx, let me know!

Thanks again,
Ryan

Tue, 2013-09-24 13:32
rnotti

" Something must be misconfigured in my mac (??)" - It seems you are using the bleeding-edge versions; my sources told me that the xcode version you are using was released last week (way after the code was written).

The linker suggests " ld: warning: directory not found for option '-Lbuild/external/release/macos/10.8/64/x86/gcc/4.2/default'"

What IS in your main/source/build folder? I have attached a tree diagram of what it looks like for me (linux, with a debug build and both mpi and not-mpi release builds). Does that directory the linker wanted exist, and if not, what does?

Tue, 2013-09-24 14:45
smlewis

Ah, you seem to have gotten right to the heart of the matter! Why might Fedora successfully build the external directory, but OSX fail to do so (even with the latest release, and the default compiler changed to the same version that worked successfully in Fedora--gcc4.7)?
See attached trees.

Puzzled,
Ryan

Wed, 2013-09-25 21:12
rnotti

well that last attachment certainly looks funny now...
try this

Wed, 2013-09-25 21:14
rnotti

I certainly don't have a clue. Are you building via scons? From command line or within xcode? Have you tried reverting to an older xcode? Have you tried wiping the entire build/ folder and recompiling from scratch (also delete .sconsign.dblite)? Can you confirm you didn't accidentally change the scons settings files to ignore the external libraries? (I'm just brainstorming here...)

Thu, 2013-09-26 14:31
smlewis

Wow, I'm out of ideas too. The week 36 bundle worked fine when I compiled with gcc from the new Xcode install.
At the moment I am doing my compiling with clang (faster), but there are a few changes you'll need to make to get that to work: all of these steps are done in rosetta_2013wk36_bundle/main/source/tools/build/

1) change the default compiler to clang. open user.options and change these lines
cxx = "clang"
cxx_ver = "5.0"

2) add clang 5.0 as a valid build option. open options.settings and add "5.0" to the clang list (line 16):
"clang" : [ "1.7", "2.1", "2.0", "2.8", "2.9", "3.0", "3.1", "4.0", "3.0-6ubuntu3", "4.1", "4.2", "5.0", "*" ],

3) Add a line that avoids a bad templating issue in compilation. open basic.setting and add this option to the standard clang options: "ftemplate-depth=999" (line 1220)
Here's the context for that change:
# Clang
"clang" : {
"overrides" : {
"cc" : "clang",
"cxx" : "clang++",
},
"appends" : {
"flags" : {
# We don't use any C -- but if we did would it really
# be C99? Are there portability issues?
"cc" : [ "std=c99", "isystem external/boost_1_46_1/" ],
"cxx" : [ "std=c++98", "isystem external/boost_1_46_1/" ],
"compile" : [ "pipe", "Qunused-arguments", "ftemplate-depth=999" ], #change this line!!!
# By default, warn as much as possible.
#"warn" : [ "W", "Weverything",
# "Wno-documentation",
# "Wno-long-long",
# "Wno-padded",
# "Wno-weak-vtables"
# ],
"warn" : [ "W", "pedantic", "Wno-long-long" ],
},
},
},

No promises that this will work, but it's something else to try.

Thu, 2013-09-26 14:51
stranges

Ben is suggesting, by the way, using the ftemplate-depth 999 INSTEAD OF editing the build settings to remove the Calculator class files from compilation.

Thu, 2013-09-26 14:53
smlewis

Yes, as smlewis says, this change means you do not (and should not) comment out the Calculator class.

Thu, 2013-09-26 16:53
stranges

I'm running into the same issue after the Xcode update. This is with the week34 bundle. I am going to try it again with the week36 bundle, until then, here's the error message.
If I remember right there are some things in build that need to be changed for the new versions of clang, will look into it and report back.

Here's the error message:
clang++ -o build/src/release/macos/10.8/64/x86/clang/4.0/default/numeric/Calculator.os -c -isystem external/boost_1_46_1/ -pipe -Qunused-arguments -W -pedantic -Wno-long-long -march=native -O3 -fPIC -DNDEBUG -Isrc -Iexternal/include -Isrc/platform/macos/64/clang/4.0 -Isrc/platform/macos/64/clang -Isrc/platform/macos/64 -Isrc/platform/macos -Iexternal/boost_1_46_1 -Iexternal/dbio -I/usr/include -I/usr/local/include src/numeric/Calculator.cc
In file included from src/numeric/Calculator.cc:24:
In file included from external/boost_1_46_1/boost/spirit/include/qi.hpp:16:
In file included from external/boost_1_46_1/boost/spirit/home/qi.hpp:14:
In file included from external/boost_1_46_1/boost/spirit/home/qi/action.hpp:14:
In file included from external/boost_1_46_1/boost/spirit/home/qi/action/action.hpp:14:
In file included from external/boost_1_46_1/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from external/boost_1_46_1/boost/spirit/home/support/meta_compiler.hpp:17:
In file included from external/boost_1_46_1/boost/proto/proto.hpp:12:
In file included from external/boost_1_46_1/boost/proto/core.hpp:21:
In file included from external/boost_1_46_1/boost/proto/fusion.hpp:22:
In file included from external/boost_1_46_1/boost/fusion/include/intrinsic.hpp:10:
In file included from external/boost_1_46_1/boost/fusion/sequence/intrinsic.hpp:16:
In file included from external/boost_1_46_1/boost/fusion/sequence/intrinsic/has_key.hpp:12:
In file included from external/boost_1_46_1/boost/fusion/algorithm/query/find.hpp:10:
In file included from external/boost_1_46_1/boost/fusion/algorithm/query/detail/find_if.hpp:15:
In file included from external/boost_1_46_1/boost/mpl/apply.hpp:36:
In file included from external/boost_1_46_1/boost/mpl/aux_/include_preprocessed.hpp:37:
external/boost_1_46_1/boost/mpl/aux_/preprocessed/gcc/apply.hpp:45:20: fatal error:
recursive template instantiation exceeded maximum depth of 128
typename lambda::type
^~~~~~~~~

etc...
external/boost_1_46_1/boost/mpl/aux_/preprocessed/gcc/apply.hpp:45:20: note: use
-ftemplate-depth=N to increase recursive template instantiation depth
typename lambda::type
^
1 error generated.
scons: *** [build/src/release/macos/10.8/64/x86/clang/4.0/default/numeric/Calculator.os] Error 1
scons: building terminated because of errors.

note that:
> clang++ --version
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

Mon, 2013-09-23 11:01
stranges

Ben: the wk38 bundle is on contador (now rosettadesign) at ~smlewis/scr/release_holding_area, if you want to skip to 38. If wk34 and 3.5 both fail, I doubt 38 will fix it.

Line 24 is a boost include that's unique to Rosetta:

24:#include [boost/spirit/include/qi.hpp]

but...I don't know what it does. Maybe Rocco does (it's his code).

Mon, 2013-09-23 11:46
smlewis

My gcc compile worked with the week36 bundle

However the clang one still failed even after updating clang version in options.settings:
"clang" : [ "1.7", "2.1", "2.0", "2.8", "2.9", "3.0", "3.1", "4.0", "3.0-6ubuntu3", "4.1", "4.2", "5.0", "*" ],

I got it to work by adding "ftemplate-depth=999" to the basic.settings file in the clang section. This is probably not the best solution, but it seems to allow compilation to go through the CalculatorFilter. See below:

# Clang
"clang" : {
"overrides" : {
"cc" : "clang",
"cxx" : "clang++",
},
"appends" : {
"flags" : {
# We don't use any C -- but if we did would it really
# be C99? Are there portability issues?
"cc" : [ "std=c99", "isystem external/boost_1_46_1/" ],
"cxx" : [ "std=c++98", "isystem external/boost_1_46_1/" ],
"compile" : [ "pipe", "Qunused-arguments", "ftemplate-depth=999" ],
# By default, warn as much as possible.
#"warn" : [ "W", "Weverything",
# "Wno-documentation",
# "Wno-long-long",
# "Wno-padded",
# "Wno-weak-vtables"
# ],
"warn" : [ "W", "pedantic", "Wno-long-long" ],
},
},
},

I would check this in, but I don't have those privileges anymore. :(

Mon, 2013-09-23 12:38
stranges

I guess the question is, SHOULD there be a "recursive template instantiation depth" that deep? It seems like if 128 is not sufficient, whatever it's compiling is probably wrong anyway? I'll post it on the mailing list for comment.

Mon, 2013-09-23 12:47
smlewis

The decision was "greater than 128 may be okay, 999 is probably too much, but it's boost code so who knows". We are looking into updating boost instead but there is a significant roadblock.

Tue, 2013-09-24 14:37
smlewis

LINKER PROBLEM SOLVED...I think:

Thanks smlewis and stranges for your input.

Here's the problem: The newest xcode version and command line tools is missing some needed c++ libraries. Xcode's command line tools now only comes with libstdc++ (several versions) but NO versions of libc++. So anyone who installs Xcode for the first time on their machine (e.g. gets a new mac and installs xcode 5.0) is going to also need to install an old version of the xcode command line tools to get the needed libraries (or acquire them elsewhere). I installed the oldest available command line tools download for Mountain Lion, release date July2012, and this added several libc++ versions to /usr/lib. Seems to have solved the problem; my targets built successfully.

I'm still commenting out the calculator filter. Haven't tried bringing him back into the mix.

Ryan

Fri, 2013-09-27 08:45
rnotti

hi motti (Ryan),

i guess i fit right in the slot of "gets a new mac and installs xcode 5.0". now i am facing problem of getting rosetta installed in my mac (OSX 10.8.5). so you suggest, I go back to installing older versions of Xcode which have the libc++ ??

Thanks.

Wed, 2013-10-16 06:18
lutarawap

Hello all,

I try to build reosetta on a mac os 10.8.5 to use Erraser within Phenix 1.8.4-1496.

When I type
benoit1$ python external/scons-local/scons.py -j2 bin mode=release

Verbose gives
scons: Reading SConscript files ...
Running versioning script ... Done. (0.0 seconds)
scons: done reading SConscript files.
scons: Building targets ...
llvm-g++-4.2 -o build/src/release/macos/10.8/64/x86/gcc/4.2/default/apps/public/AbinitioRelax.o -c -isystem external/boost_1_46_1/ -isystem external/include/ -pipe -ffor-scope -Wall -Wextra -pedantic -Wno-long-long -m64 -march=nocona -mtune=generic -O3 -ffast-math -funroll-loops -finline-functions -finline-limit=20000 -s -Wno-unused-variable -DNDEBUG -Isrc -Iexternal/include -Isrc/platform/macos/64/gcc/4.2 -Isrc/platform/macos/64/gcc -Isrc/platform/macos/64 -Isrc/platform/macos -Iexternal/boost_1_46_1 -Iexternal/dbio -I/usr/include -I/usr/local/include src/apps/public/AbinitioRelax.cc
sh: llvm-g++-4.2: command not found
scons: *** [build/src/release/macos/10.8/64/x86/gcc/4.2/default/apps/public/AbinitioRelax.o] Error 127
llvm-g++-4.2 -o build/src/release/macos/10.8/64/x86/gcc/4.2/default/devel/init.os -c -isystem external/boost_1_46_1/ -isystem external/include/ -pipe -ffor-scope -Wall -Wextra -pedantic -Wno-long-long -m64 -march=nocona -mtune=generic -O3 -ffast-math -funroll-loops -finline-functions -finline-limit=20000 -s -Wno-unused-variable -fPIC -DNDEBUG -Isrc -Iexternal/include -Isrc/platform/macos/64/gcc/4.2 -Isrc/platform/macos/64/gcc -Isrc/platform/macos/64 -Isrc/platform/macos -Iexternal/boost_1_46_1 -Iexternal/dbio -I/usr/include -I/usr/local/include src/devel/init.cc
sh: llvm-g++-4.2: command not found
scons: *** [build/src/release/macos/10.8/64/x86/gcc/4.2/default/devel/init.os] Error 127
scons: building terminated because of errors.

Apparently llmv-g++-4.2 is not installed on my machine. Anyone know how to do that since I didn't manage even after updating the Xcode5.0.2 command line.

Thanks in advance…

benoit

Tue, 2014-02-11 02:09
benoit