Qt + GCC 4.9 Macports + openmp (MAC - Mavericks)
-
Hi and welcome to devnet,
Because Qt is configured to use the mkspec for clang. If you want to use another one you will need to tell it by hand
-
Im' trying to compile the QT by scratch using the gcc flag but it fails, i'm hoping to find a solution.
[quote author="SGaist" date="1399236303"]Hi and welcome to devnet,
Because Qt is configured to use the mkspec for clang. If you want to use another one you will need to tell it by hand[/quote]
-
Can you post the errors you are getting ?
-
sudo ./configure -platform macx-g++42 -qt-xcb
note: the -qt-xcb is due to the error: _
The test for linking against libxcb and support libraries failed! You might need to install dependency packages, or pass -qt-xcb._gives a couple of
xcrun: error: unable to find utility "g++-4.2", not a developer tool or in PATH
sending command: g++ --version
g++ (MacPorts gcc49 4.9-20140416_0) 4.9.0 20140416 (prerelease)sending command: gcc --version
gcc (MacPorts gcc49 4.9-20140416_0) 4.9.0 20140416 (prerelease) -
Never use sudo for this kind of task
You don't have g++4.2 but 4.9, you need to create your own mkspec for 4.9. You can copy the 4.2 and update it's content to use your macport gcc.
Since you're running OS X, xcb doesn't make sense. Let the default value to start
-
Ok, i duplicated the macx-g++42 to macx-g++49, edited the quake.conf setting
QMAKE_CC = gcc-mp-4.9
QMAKE_CXX = g++-mp-4.9Next error is:
Creating qmake...
/opt/local/bin/g++-mp-4.9 -c -o qlibraryinfo.o -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -g -gdwarf-2 -fconstant-cfstrings -g -DQMAKE_OPENSOURCE_EDITION -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/library -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/unix -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/win32 -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/mac -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/integrity -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore/5.2.1 -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore/5.2.1/QtCore -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib/global -DHAVE_QCONFIG_CPP -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/macx-g++49 -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/tools/shared -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY /Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib/global/qlibraryinfo.cppg++-mp-4.9: error: unrecognized command line option '-fconstant-cfstrings'
Makefile:255: set di istruzioni per l'obiettivo "qlibraryinfo.o" non riuscito -
Right, because macx-g++ is for Apple's gcc, check the Darwin mkspec
-
Mmmmm next one:
switching to darwin-g++ mkspec i had to modify the qmake.conf
- adding the flag QMAKE_MAC_SDK = macosx
- replcaing the cc/c++ values to gcc-mp-49 and g++-mp-4.9,
the error now is due to the fact that -mmacosx-version-min= isn't filled with the correct value (third row of next log)
/opt/local/bin/g++-mp-4.9 -c -o qlibraryinfo.o -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk *-mmacosx-version-min= *-fconstant-cfstrings -g -DQMAKE_OPENSOURCE_EDITION -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/library -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/unix -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/win32 -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/mac -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/qmake/generators/integrity -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore/5.2.1 -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/include/QtCore/5.2.1/QtCore -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib/global -DHAVE_QCONFIG_CPP -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/darwin-g++ -I/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/tools/shared -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY /Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib/global/qlibraryinfo.cpp
g++-mp-4.9: error: missing argument to '-mmacosx-version-min=' -
Probably missing: QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
-
Then you need to comment the lines containing that in features/qt_module.prf
Beware that you are entering unsupported territory. Qt for OS X is tested only with Apple's compilers.
-
I'ts a pity cause this make quite hard to use openmp and qt on mac.
I removed the macx-g++ {
QMAKE_CFLAGS += -fconstant-cfstrings
QMAKE_CXXFLAGS += -fconstant-cfstrings
}block from the qt_module.prf but running again the ./configure doesn't seem to know this change.
/opt/local/bin/g++-mp-4.9 -c -o qlibraryinfo.o -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -fconstant-cfstrings -g -DQMAKE_OPENSOURCE_EDITION....
I modified instead the configure script commenting the following line
#echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"after calling ./configure again it sticks to
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/Availability.h:148:0,
from ../../include/QtCore/../../src/corelib/global/qsystemdetection.h:212,
from ../../include/QtCore/qsystemdetection.h:1,
from ../../include/QtCore/../../src/corelib/global/qglobal.h:69,
from ../../include/QtCore/qglobal.h:1,
from ../../include/QtCore/../../src/corelib/tools/qchar.h:45,
from ../../include/QtCore/qchar.h:1,
from ../../include/QtCore/../../src/corelib/tools/qstring.h:45,
from ../../include/QtCore/qstring.h:1,
from tools/qlocale_p.h:56,
from tools/qlocale_mac.mm:42:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:16:45: error: expected '}' before 'attribute'
NSUserNotificationActivationTypeReplied NS_AVAILABLE(10_9, NA) = 3
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:161:0,
from ../../include/QtCore/5.2.1/QtCore/private/../../../../../src/corelib/kernel/qcore_mac_p.h:73,
from ../../include/QtCore/5.2.1/QtCore/private/qcore_mac_p.h:1,
from tools/qlocale_mac.mm:49:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:16:68: error: expected unqualified-id before '=' token
NSUserNotificationActivationTypeReplied NS_AVAILABLE(10_9, NA) = 3
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:17:1: error: expected declaration before '}' token
} NS_ENUM_AVAILABLE(10_8, NA);
^
Makefile:1827: set di istruzioni per l'obiettivo ".obj/qlocale_mac.o" non riuscito
gmake[3]: *** [.obj/qlocale_mac.o] Errore 1
gmake[3]: uscita dalla directory "/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib"
Makefile:131: set di istruzioni per l'obiettivo "sub-corelib-make_first" non riuscito
gmake[2]: *** [sub-corelib-make_first] Errore 2
gmake[2]: uscita dalla directory "/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase/src"
Makefile:41: set di istruzioni per l'obiettivo "sub-src-make_first" non riuscito
gmake[1]: *** [sub-src-make_first] Errore 2
gmake[1]: uscita dalla directory "/Users/Neogene/Downloads/Safari/qt-everywhere-opensource-src-5.2.1/qtbase"
Makefile:60: set di istruzioni per l'obiettivo "module-qtbase-make_first" non riuscito
gmake: *** [module-qtbase-make_first] Errore 2 -
Did you completely clean before calling configure again ?