Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#40330 closed defect (fixed)

hugin-app: failure to compile when including boost headers

Reported by: mojca (Mojca Miklavec) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: matthieu.desile@…, macports@…, ryandesign (Ryan Carsten Schmidt)
Port: hugin-app boost

Description

hugin-app (both 2012.0.0 and the latest version from RCS at the time of writing) fails to compile with boost @1.54.0, at least on Lion. The list of errors is long, but here's the first one, most likely related to a weird mixture of Apple and boost headers conflicting with each other:

In file included from /work/hugin-2012.0.0/src/hugin_base/huginapp/ImageCache.h:30:
In file included from /opt/local/include/boost/signal.hpp:27:
In file included from /opt/local/include/boost/signals/signal0.hpp:24:
In file included from /opt/local/include/boost/signals/signal_template.hpp:21:
In file included from /opt/local/include/boost/signals/slot.hpp:15:
In file included from /opt/local/include/boost/signals/trackable.hpp:13:
In file included from /opt/local/include/boost/type_traits.hpp:35:
In file included from /opt/local/include/boost/type_traits/has_operator.hpp:12:
In file included from /opt/local/include/boost/type_traits/has_bit_and.hpp:43:
/opt/local/include/boost/type_traits/detail/has_binary_operator.hpp:157:121: error: expected expression
   BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<Lhs>() BOOST_TT_TRAIT_OP make<Rhs>()),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
                                                                                                                        ^
/opt/local/include/boost/config/suffix.hpp:393:72: note: expanded from macro 'BOOST_STATIC_CONSTANT'
#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
                                                                       ^

Attachments (1)

main.log (969.8 KB) - added by mojca (Mojca Miklavec) 11 years ago.
build log from hugin-app 2012 against boost 1.54.0

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by mojca (Mojca Miklavec)

Attachment: main.log added

build log from hugin-app 2012 against boost 1.54.0

comment:1 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:2 Changed 11 years ago by michaelld (Michael Dickens)

I'm trying to track down a similar bug. Have you looked at this Boost ticket? Seems like if Apple headers are included before Boost, then issues can arise because of the "#define check" in AssertMacros.h; "check" is then used by Boost's "operator_exists" in has_binary_operator.hpp (and, maybe, elsewhere). Solution is to either include boost first, or to

#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0

or

-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0

for compiling. I wish this was my issue, but it's not; maybe it will work for this ticket?

Last edited 11 years ago by michaelld (Michael Dickens) (previous) (diff)

comment:3 Changed 11 years ago by mojca (Mojca Miklavec)

Interesting. I had exactly that line, but I was trying to set it to one. I upgraded boost to 1.55.0b1, set this value to zero and stumbled across an weird issue with libtiff:

In file included from
/path/to/hugin-app/work/hugin-2013.0.0/src/hugin1/stitch_project/hugin_stitch_project.cpp:46:

In file included from /opt/local/include/tiffio.h:33:
/opt/local/include/tiff.h:78:23: error: typedef redefinition with different
types ('unsigned long' vs 'uint64_t' (aka 'unsigned long long'))
typedef TIFF_UINT64_T uint64;
                      ^
//System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:53:18:
note: previous definition is here
typedef uint64_t uint64;
                 ^
2 warnings and 1 error generated.

but after I manually fixed that one, Hugin.app compiled fine and it seems to work.

Now, I'm not exactly sure which one of the two changes (upgrading boost or setting the value to 0) made the compilation possible, but it worked for me.

comment:4 Changed 11 years ago by mojca (Mojca Miklavec)

I committed the changes in r113119 and filed a new ticket for tiff in #41280.

comment:5 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Resolution: fixed
Status: newclosed

I'm not seeing this problem with hugin-app @2013.0.0 and boost @1.55.0.

comment:6 Changed 11 years ago by mojca (Mojca Miklavec)

True, this particular problem must be gone, most probably -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 in r113119 fixed it, I just didn't close the ticket because of the problem with tiff back than and because I couldn't reliably confirm a successful compilation (a successful build on a buildbot would count for example ;).

Thanks for closing it.

Note: See TracTickets for help on using tickets.