Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#30271 closed defect (fixed)

qt4-mac: fails to find dbus when using clang

Reported by: trojanfoe@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.0.99
Keywords: lion Cc: nerdling (Jeremy L), raimue (Rainer Müller), pixilla (Bradley Giesbrecht), g5pw (Aljaž Srebrnič), jamesfmarshall@…, m.haller@…, axeljaeger@…, mkae (Marko Käning), melanochaitus@…, andreas.woelfl@…, obutovich@…, dessimat0r@…, st.hennig@…, fyodor.vassiley@…, maehne (Torsten Maehne), dsdale24@…, jacobu@…, bgrupe27, rex4539 (Dimitris Apostolou), smparkes@…, jiri@…
Port: qt4-mac

Description

I am trying to build Qt (4.7.3 at the time of writing) under Mac OS Lion using Apple's clang.I have used the subversion-installed version of macports and am using file:///opt/mports/trunk/dports for the port definition files. I have modified portconfigure.tcl to explicitly use "clang" as the configure.compiler.

Anyway it looks like dbus/dbus.h cannot be found when compiling qdbusconnectioninterface.o, and this is because the include directory (/opt/local/include/dbus-1.0) isn't being specified on the command line. However this directory *is* being specified earlier on in the build, when other dbus-related object files are being built.

I have attached the log file.

Attachments (1)

main.log (2.6 MB) - added by trojanfoe@… 9 years ago.
qt4-mac build log file

Change History (45)

Changed 9 years ago by trojanfoe@…

Attachment: main.log added

qt4-mac build log file

comment:1 Changed 9 years ago by trojanfoe@…

A temporary workaround seems to be to edit the post-configure part of the Portfile and remove anything DBUS related (i.e. stop it from removing -I and -L from the qmake cache files). This allows compilation to continue but the build fails in some Objective-C++ source files, which is 99.99% an upstream problem anyway.

comment:2 Changed 9 years ago by trojanfoe@…

I have attempted to build against the 10.6 SDK using a -mmacos_version_min=10.6 but there are still errors. 4.7.3 won't build under Lion.

comment:3 Changed 9 years ago by ryandesign (Ryan Schmidt)

Keywords: qt dbus clang removed
Milestone: MacPorts 2.0.0
Owner: changed from macports-tickets@… to michaelld@…
Port: qt4-mac added
Summary: Qt 4.7.3 fails to build on Mac OS Lion using Apple clangqt4-mac: fails to build on Mac OS Lion using Apple clang

Do not set the Milestone field for port tickets.

Do set the Port field to the affected port, and Cc the affected port's maintainer.

What happens if you don't modify portconfigure.tcl to use clang? What happens if you use it as shipped, using llvm-gcc-4.2?

comment:4 Changed 9 years ago by trojanfoe@…

I haven't tried not using clang, but the build problems are in Objective-C code and I'm sure the compiler won't make any difference.

This should probably be closed as Qt 4.7.3 isn't supported under Lion, as we need to look toward 4.8.0.

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

Keywords: lion added

comment:6 Changed 9 years ago by michaelld (Michael Dickens)

I'm traveling right now, and probably won't be able to download / install Lion until early August. So, unless someone can come up with a patch in the interim, folks will just have to be patient for a few weeks.

Also, is this a duplicate of, or related to, #30262?

comment:7 Changed 9 years ago by nerdling (Jeremy L)

Cc: snc@… added

Doesn't resemble a duplicate from what I can see.

comment:8 Changed 9 years ago by raimue (Rainer Müller)

Cc: raimue@… added
Summary: qt4-mac: fails to build on Mac OS Lion using Apple clangqt4-mac: fails to build on Mac OS X Lion due to dbus

comment:9 Changed 9 years ago by pixilla (Bradley Giesbrecht)

Cc: pixilla@… added

Cc Me!

comment:10 Changed 9 years ago by g5pw (Aljaž Srebrnič)

Cc: a2piratesoft@… added

Cc Me!

comment:11 Changed 9 years ago by jamesfmarshall@…

Cc: jamesfmarshall@… added

Cc Me!

comment:12 Changed 9 years ago by m.haller@…

Cc: m.haller@… added

Cc Me!

comment:13 Changed 9 years ago by axeljaeger@…

Cc: axeljaeger@… added

Cc Me!

comment:14 Changed 9 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:15 Changed 9 years ago by melanochaitus@…

Cc: melanochaitus@… added

Cc Me!

comment:16 Changed 9 years ago by andreas.woelfl@…

Cc: andreas.woelfl@… added

Cc Me!

comment:17 Changed 9 years ago by obutovich@…

Cc: obutovich@… added

Cc Me!

comment:18 Changed 9 years ago by dessimat0r@…

Cc: dessimat0r@… added

Cc Me!

comment:19 in reply to:  18 Changed 9 years ago by downbylow@…

Cc Me!

comment:20 Changed 9 years ago by creaktive (Stanislaw Pusep)

Cc Me!

comment:21 Changed 9 years ago by jamesfmarshall@…

Is this the same problem?

https://bugreports.qt.nokia.com//browse/QTBUG-17869

Mike McQuaid commented on QTBUG-20496 (Qt does not compile under OSX Lion or llvm-gcc) saying: This can probable be closed, the merge request has been merged and commit included.

https://qt.gitorious.org/qt/qt/merge_requests/1304

comment:22 Changed 9 years ago by st.hennig@…

Cc: st.hennig@… added

Cc Me!

comment:23 Changed 9 years ago by fyodor.vassiley@…

Cc: fyodor.vassiley@… added

Cc Me!

comment:24 in reply to:  21 Changed 9 years ago by creaktive (Stanislaw Pusep)

No, the specified patch is already applied to the MacPort.

Replying to jamesfmarshall@…:

Is this the same problem?

https://bugreports.qt.nokia.com//browse/QTBUG-17869

Mike McQuaid commented on QTBUG-20496 (Qt does not compile under OSX Lion or llvm-gcc) saying: This can probable be closed, the merge request has been merged and commit included.

https://qt.gitorious.org/qt/qt/merge_requests/1304

comment:25 Changed 8 years ago by maehne (Torsten Maehne)

Cc: Torsten.Maehne@… added

Cc Me!

comment:26 Changed 8 years ago by dsdale24@…

Cc: dsdale24@… added

Cc Me!

comment:27 Changed 8 years ago by ryandesign (Ryan Schmidt)

Summary: qt4-mac: fails to build on Mac OS X Lion due to dbusqt4-mac: fails to find dbus when using clang

clang does not use CPATH or LIBRARY_PATH like gcc and llvm-gcc do. That could easily account for the dbus header not being found, only when using clang.

comment:28 Changed 8 years ago by jacobu@…

Cc: jacobu@… added

Cc Me!

comment:29 Changed 8 years ago by michaelld (Michael Dickens)

I committed some changes to qt4-mac in r81844. Please do a selfupdate & see if the changes work -- they probably don't for this issue, but you never know :) I'll be installing Lion / 10.7 this weekend, and will try to figure out a workaround once that's done. I welcome thoughts / patches in the meantime.

comment:30 in reply to:  29 ; Changed 8 years ago by slavomir.kocka@…

Replying to michaelld@…:

I committed some changes to qt4-mac in r81844. Please do a selfupdate & see if the changes work -- they probably don't for this issue, but you never know :) I'll be installing Lion / 10.7 this weekend, and will try to figure out a workaround once that's done. I welcome thoughts / patches in the meantime.

I'm not sure, if you're last who worked on it, but for me qt4-mac (on lion) works now... :)

comment:31 in reply to:  30 Changed 8 years ago by raimue (Rainer Müller)

Replying to slavomir.kocka@…:

I'm not sure, if you're last who worked on it, but for me qt4-mac (on lion) works now... :)

If you are using a default install with Lion and Xcode 4.1, you will be using llvm-gcc. This issue is about using clang. It has not yet been confirmed if the latest changes did make it work using clang.

comment:32 Changed 8 years ago by Veence (Vincent)

They do not. You still get that dbus.h not found issue, can be easily fixed by modifying both Makefiles in the ad hoc directory. But then you will get more errors dealing with toll-free bridging from CFStringRef to NSString * and const issues.

comment:33 Changed 8 years ago by ken@…

My log error out about the same place command. When I run that command manually, I get this error.

make[1]: *** Waiting for unfinished jobs....
/Developer/usr/bin/clang++ -c -include .pch/release-shared/QtCore -pipe -Xarch_x86_64 -mmacosx-version-min=10.7 -fconstant-cfstrings -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.7 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -isysroot /Developer/SDKs/MacOSX10.7.sdk -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I.moc/release-shared -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../../tools/shared -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -o .obj/release-shared/qvariantanimation.o animation/qvariantanimation.cpp
make[2]: *** [.obj/release-shared/qabstractanimation.o] Error 1
make[2]: *** Waiting for unfinished jobs....
error: unable to read PCH file: 'Is a directory'

So right now I have edited the port file to always make sure "configure.args-append -no-pch" in the darwin platform section to be set always. So far so good.

comment:34 Changed 8 years ago by bgrupe27

Cc: bgrupe@… added

Cc Me!

comment:35 Changed 8 years ago by rex4539 (Dimitris Apostolou)

Cc: rex_4539@… added

Cc Me!

comment:36 Changed 8 years ago by michaelld (Michael Dickens)

Did anyone have success compiling qt4-mac on 10.7 with "configure.compiler=clang" by disabling the pre-compiled headers (via forcing "configure.args-append -no-pch")? I'm trying it right now ...

comment:37 Changed 8 years ago by michaelld (Michael Dickens)

Disabling pre-xompiled headers doesn't do it; CLANG just ignores the CPATH and LIBRARY_PATH variables, as has been pointed out elsewhere (e.g., < http://lists.macosforge.org/pipermail/macports-dev/2011-August/015543.html >). One of the reasons I moved to using CPATH (etc) is that QMake does not follow "reasonable" ordering for headers -- should generally be: local (to project), non-local (but not system), compiler, system. When I get time again (in a few weeks), I'll see if QMake 4.7.4 does ordering better. In the mean time, don't use CLANG as the compiler for qt4-mac.

comment:38 Changed 8 years ago by smparkes@…

Cc: smparkes@… added

Cc Me!

comment:39 Changed 8 years ago by smparkes@…

Cc: smparkes@… removed

Cc Me!

comment:40 Changed 8 years ago by smparkes@…

Cc: smparkes@… added

Cc Me!

comment:41 Changed 8 years ago by stevencbritton@…

I seem to have managed to get qt4-mac successfully installed using the llvm-gcc-4.2 compiler.

For anyone who doesn't know how to manually configure the compiler:

(Assuming a standard macports install. If you installed it somewhere else, you're on your own for this first command:

$cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/aqua/qt4-mac
$sudo cp Portfile Portfile.old
$sudo nano Portfile

^w
Search for: configure.compiler

Just after this text:
# The build process uses -fconstant-cfstrings.
# configure.compiler should therefore not be one of the MacPorts compilers.

add:
configure.compiler              llvm-gcc-4.2

^o
^x

$sudo port -d -v install qt4-mac

It took my macbook pro about 2 hours to install qt4-mac. Hopefully, given qt4-mac is a dependency of the program I'm actually trying to install, this is the worst problem I experience.

comment:42 Changed 8 years ago by jiri@…

Cc: jiri@… added

Cc Me!

comment:43 Changed 8 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

I just checked in r85974, which forces qt4-mac to use llvm instead of clang, even if clang is set as the configure.compiler. I'm closing this ticket as fixed; please reopen it if this change doesn't work.

comment:44 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I think it should work in XCode 4.3

Note: See TracTickets for help on using tickets.