I'm trying to compile OpenSCAD on my Mac. When the build script reaches the line qmake qscintilla.pro it spits out the error Project ERROR: Unknown module(s) in QT: gui opengl concurrent widgets printsupport macextras If I run qmake on its own I recieve more errors for missing modules Project ERROR: Unknown module(s) in QT: gui opengl concurrent widgets printsupport macextras I added QT += macextras to my qt.pro file to see if it would stop complaining about macextras, but that didn't work either.
I looked inside qt-everywhere-opensource-src-5.4.1 and I can see qtmacextras but I don't see the other modules mentioned.
Any ideas how I could get these modules for Mac?
I thought that qt was being compiled by the following script
build_qt()
{
version=$1
if [ -d $DEPLOYDIR/lib/QtCore.framework ]; then
echo "qt already installed. not building"
return
fi
echo "Building Qt" $version "..."
cd $BASEDIR/src
rm -rf qt-everywhere-opensource-src-$version
if [ ! -f qt-everywhere-opensource-src-$version.tar.gz ]; then
curl -O -L http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
fi
tar xzf qt-everywhere-opensource-src-$version.tar.gz
cd qt-everywhere-opensource-src-$version
patch -p0 < $OPENSCADDIR/patches/qt4/patch-src_corelib_global_qglobal.h.diff
patch -p0 < $OPENSCADDIR/patches/qt4/patch-libtiff.diff
patch -p0 < $OPENSCADDIR/patches/qt4/patch-src_plugins_bearer_corewlan_qcorewlanengine.mm.diff
if $USING_CLANG; then
# FIX for clang
sed -i "" -e "s/::TabletProximityRec/TabletProximityRec/g" src/gui/kernel/qt_cocoa_helpers_mac_p.h
PLATFORM="-platform unsupported/macx-clang"
fi
if $OPTION_32BIT; then
QT_32BIT="-arch x86"
fi
case "$OSX_VERSION" in
9)
# libtiff fails in the linker step with Mavericks / XCode 5.0.1
MACOSX_RELEASE_OPTIONS=-no-libtiff
# wlan support bails out with lots of compiler errors, disable it for the build
patch_qt_disable_core_wlan "$version"
;;
*)
MACOSX_RELEASE_OPTIONS=
;;
esac
./configure -prefix $DEPLOYDIR -release $QT_32BIT -arch x86_64 -opensource -confirm-license $PLATFORM -fast -no-qt3support -no-svg -no-phonon -no-audio-backend -no-multimedia -no-javascript-jit -no-script -no-scripttools -no-declarative -no-xmlpatterns -nomake demos -nomake examples -nomake docs -nomake translations -no-webkit $MACOSX_RELEASE_OPTIONS
make -j"$NUMCPU" install
}
It sounds like you're using the macosx-build-dependencies.sh script. If you do, you need to set up your environment first, to search for libraries in the right places:
$ source setenv_mac-qt5.sh
Related
How can I compile libgnat to a single LLVM bitcode file? The latest dragonegg release is very old, so I provide a dockerfile to make testing more easy. My end goal is to run Ada in LLVM IR bitcode interpreters.
Dockerfile for the latest official dragonegg release
FROM ubuntu:trusty
COPY . /usr/src/workdir
WORKDIR /usr/src/workdir
RUN apt-get update \
&& apt-get -y install build-essential gnat-4.6 libgmp-dev libmpfr-dev libmpc-dev libz-dev gcc-4.6-plugin-dev
# libz-dev for ld when compiling dragonegg 3.3
# gcc-4.6-plugin-dev needed when compiling dragonegg 3.3
RUN tar -xzf gcc-4.6.4.tar.gz \
&& cd gcc-4.6.4 \
&& mkdir build \
&& cd build \
&& CC=gcc-4.6 ../configure --disable-multilib --enable-languages=ada,c,c++ --prefix=/opt/gcc-4.6.4 \
&& make -j4 \
&& make install
RUN tar -xzf clang+llvm-3.3-amd64-Ubuntu-12.04.2.tar.gz \
&& mv clang+llvm-3.3-amd64-Ubuntu-12.04.2 /opt/llvm-3.3
ENV PATH="/opt/llvm-3.3/bin:/opt/gcc-4.6.4/bin:${PATH}"
RUN tar -xzf dragonegg-3.3.src.tar.gz \
&& mv dragonegg-3.3.src dragonegg-3.3 \
&& cd dragonegg-3.3 \
&& GCC=/opt/gcc-4.6.4/bin/gcc make \
&& cp dragonegg.so /opt/dragonegg.so
download gcc-4.6.4.tar.gz
download clang+llvm-3.3-amd64-Ubuntu-12.04.2.tar.gz
download dragonegg-3.3.src.tar.gz
hello.adb
with Ada.Text_IO;
procedure Hello is
begin
Ada.Text_IO.Put_Line("Hello world from Ada (dragonegg)!");
end Hello;
Run gcc hello.adb -S -O1 -o hello.ll -fplugin=/opt/dragonegg.so -fplugin-arg-dragonegg-emit-ir to compile the hello.adb file. When I try to build the binary with llc -filetype=obj hello.ll and gcc hello.o, I get the following error:
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
hello.o: In function `_ada_hello':
hello.ll:(.text+0xb): undefined reference to `ada__text_io__put_line__2'
collect2: ld returned 1 exit status
The error message indicates that the Ada runtime library is missing. Currently, I have no idea, how I can compile the libgnat to a single LLVM bitcode file, so I can link it with the program.
Why are you using DragonEgg? That's well and truly dead! See https://github.com/AdaCore/gnat-llvm instead.
I try to compile Qt project with CentOS.
This question describe what I have done in detail and
I want to do with another glibc libraries /users/my/lib64/ (I can't update /lib64/) by referring to this.
This is the compile out put:
g++ ./main.o ./moc_widget.o ./widget.o \
-o ./test -Wl,--rpath=/users/my/lib64 \
-Wl,--rpath=/users/my/Qt/5.9.1/gcc_64/lib \
-Wl,--dynamic-linker=/users/my/lib64/libc.so.6 \
-Wl,--dynamic-linker=/users/my/lib64/libz.so.1 \
-L/users/my/Qt/5.9.1/gcc_64/lib -lQt5Widgets \
-lQt5Gui -lQt5Core -lGL -lpthread -lglib-2.0 -lrt -lX11 \
-I/users/my/test/2 \
-I/users/my/Qt/5.9.1/gcc_64/include \
-I/users/my/Qt/5.9.1/gcc_64/include/QtWidgets \
-I/users/my/Qt/5.9.1/gcc_64/include/QtCore \
-I/users/my/Qt/5.9.1/gcc_64/include/QtGui
.pro file :
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
CONFIG += qt
SOURCES += \
main.cpp \
widget.cpp
HEADERS += \
widget.h
FORMS += \
widget.ui
gcc version : 6.1.0
But the error:
/users/my/Qt/5.9.1/gcc_64/lib/libQt5Core.so: undefined reference to `clock_gettime#GLIBC_2.17'
/users/my/Qt/5.9.1/gcc_64/lib/libQt5Widgets.so: undefined reference to `memcpy#GLIBC_2.14'
collect2 ld returned exit 1 status
How to solve it ?
g++ ./main.o ./moc_widget.o ./widget.o \
-o ./test -Wl,--rpath=/users/my/lib64 \
-Wl,--rpath=/users/my/Qt/5.9.1/gcc_64/lib \
-Wl,--dynamic-linker=/users/my/lib64/libc.so.6 \
-Wl,--dynamic-linker=/users/my/lib64/libz.so.1 \
-L/users/my/Qt/5.9.1/gcc_64/lib -lQt5Widgets \
-lQt5Gui -lQt5Core -lGL -lpthread -lglib-2.0 -lrt -lX11 \
-I...
This command line is completely bogus (you didn't understand previous answer): there can only be one dynamic linker, and it should be /users/my/lib64/ld-linux-x86-64.so.2, and not libz.so.1. By using multiple --dynamic-linker=... flags, you are simply replacing previous (incorrect) setting with a new (also incorrect) one.
It's also bogus because specifying -I... flags on the link line without any sources is pointless.
If this command succeeded, you'd end up with an executable that would simply crash immediately, because libz.so.1 is not a dynamic linker.
Now, your link fails because you are performing the link on the wrong system. You need to link on the original system (the one where you successfully linked your binary earlier, and the one which has GLIBC 2.17 or later). And then move the linked executable to your target system.
On the original system, your link command should look something like this:
g++ main.o moc_widget.o widget.o -o test \
-Wl,-rpath=/users/my/lib64 \
-Wl,--dynamic-linker=/users/my/lib64/ld-linux-x86-64.so.2 \
-L...
The two lines I indented above should be the only change from your original successful link command.
I have ported Qt 4.8.6 to sparc linux.as per my knowledge Sparc and Linux support is not available in qws folder.
I have copied linux-generic-g++ to linux-sparc-g++ and changed qmake.conf as per my toolchain functionality as shown below.
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
QMAKE_CFLAGS_RELEASE = -nostdlib -nostartfiles -shared
QMAKE_CXXFLAGS_RELEASE = -nostdlib -nostartfiles -shared
QMAKE_LFLAGS_RELEASE = -nostdlib -nostartfiles -shared
QMAKE_CC = sparc-elf-gcc
QMAKE_CXX = sparc-elf-g++
QMAKE_LINK = sparc-elf-g++
QMAKE_LINK_SHLIB = sparc-elf-g++
QMAKE_AR = sparc-elf-ar cqs
QMAKE_OBJCOPY = sparc-elf-objcopy
QMAKE_STRIP = sparc-elf-strip
load(qt_config)
After this I have configured with below configuration feature
./configure -verbose -opensource -confirm-license -no-qt3support -no-glib -depths 32 -qt-gfx-vnc -no-gfx-qvfb -no-gfx-multiscreen -no-gfx-directfb -debug -shared -embedded sparc -platform qws/linux-x86_64-g++ -xplatform qws/linux-sparc-g++ -host-little-endian -little-endian -no-openssl -no-opengl -no-sql-sqlite -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon -no-script -no-phonon-backend -no-svg -multimedia -no-webkit -nomake demos -no-separate-debug-info -prefix /usr/local/ -plugindir /usr/local/plugins -importdir /usr/local/imports -translationdir /usr/local/translations -no-rpath
I have successfully crated all shared library and copied into my board /lib/ path
Now my plan is to run analogclock example on board using below command(I don't have display that's what I am using VNC display)
./analogclock -qws -display VNC:0
analogclock[120]: segfault at 8 ip 5019b06c (rpc f000eff0) sp ef82cae8
error 30001 in libQtGui.so.4.8.6[50017000+10cb000] Segmentation fault
I am getting segmentation fault when graphics_system_name.isEmpty(); in src/gui/kernel/qapplication.cpp file is invoked.
After debugging I found that global "QString QApplicationPrivate::graphics_system_name;" object is created successfully with valid address 0x5143a400.
However I could not access any QString member functions such as (graphics_system_name.data(), graphics_system_name.size().....)
If I create local QString class object,it is working fine.if global segmentation fault.
I spend weeks trying to cross compile Qt for my Panda board and no way, I can't pass the ./configure. If someone could give me a help I'll appreciate.
My host system is Ubuntu-13.04 ×86_64bit(running un Virtualbox)
My target system is Pandaboard ES Ubuntu-12.04.
All the steps in host box:
sudo apt-get install arm-linux-gnueabihf
sudo mkdir /opt/qt-485-armhf
cd /usr/src
sudo wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
sudo tar xf qt-everywhere-opensource-src-4.8.5.tar.gz
cd /usr/src/qt-everywhere-opensource-src-4.8.5
sudo cp -r mkspecs/qws/linux-arm-gnueabi-g++ mkspecs/qws/linux-arm-gnueabihf-g++
sudo vim mkspecs/qws/linux-arm-gnueabihf-g++/qmake.conf
-------------------------------
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
#Compiler Flags to take advantage of the ARM architecture
#N.B.:I also tried to uncomment the two following instructions with no success
QMAKE_CFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc
QMAKE_CXX = arm-linux-gnueabihf-g++
QMAKE_LINK = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_STRIP = arm-linux-gnueabihf-strip
load(qt_config)
---------------------------------
sudo sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" config.tests/unix/libmng/libmng.cpp (This command fixes detection of libmng 2.0.)
export QTDIR=/opt/qt4-485-armhf
And finally:
sudo ./configure -prefix /opt/qt4-485-armhf -sysconfdir /etc/xdg -embedded arm -little-endian -host-big-endian -no-qt3support -nomake examples -nomake demos -opensource -confirm-license -release -openssl-linked -no-phonon -no-phonon-backend -no-nis -platform qws/linux-x86_64-g++ -xplatform qws/linux-arm-gnueabihf-g++ -optimized-qmake
With this result:
Creating qmake. Please wait...
g++ -c -o option.o -pipe -m64 -DQMAKE_OPENSOURCE_EDITION -O2 -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/usr/src/qt-everywhere-opensource-src-4.8.5/include -I/usr/src/qt-everywhere-opensource-src-4.8.5/include/QtCore -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/global -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/xml -I/usr/src/qt-everywhere-opensource-src-4.8.5/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/usr/src/qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-x86_64-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED option.cpp
g++ -o "/usr/src/qt-everywhere-opensource-src-4.8.5/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o qfsfileengine_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o
You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependencies
The system floating point format could not be detected.
This may cause data to be generated in a wrong format
Turn on verbose messaging (-v) to see the final report.
OpenSSL support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.
Thanks in advance.
To cross-compile a program on a PC you must have the development files for the same packages installed on the PC as the ARM target. Qt 4.8 depends on OpenSSL, so you must get the correct development files for the ARM release if you wish to compile Qt.
Install a Ubuntu 12.04 PC virtual box. SAME VERSION as the board.
Get the compiler. apt-get install arm-linux-gnueabihf (You knew that).
Get required development packages. apt-get install libssl-dev or apt-get build-dep -aarmhf qt4 (which only works for X11).
Edit your Qt configuration to suit your needs and build it.
The current step you are missing is step 3; but to perform it you need step 1 or some other way to get the OpenSSL development files for Ubuntu 12.04. There is probably some other way to do this using apt.sources. I think the steps above will be easiest for you.
Here is an alternative approach. As you are going to use Qt, you don't necessarily need Ubuntu. Simple rootfs with Qt Embedded could be sufficient.
I'll describe, how you can create rootfs and your application using Buildroot(BR). BR already has a config file for Pandaboard. All you need to is to download BR and execute:
make pandaboard_defconfig
After that you can choose between Qt4 and Qt5 in the menuconfig.
For your application I'd suggest using CMake infrastructure, but it is a matter of taste. This article is about source directory override mechanism in BR.
try to get the version off gcc in your Pandaboard Ubuntu OS and if is the same arm-linux-gnueabihf-gcc version or less like 4.6 hint the config in your qmake.config
#QMAKE_CFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
#QMAKE_CXXFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
i'm having some troubles when trying to compile Ada code in GPS. GPS says is missing when I include it on a package. I tried installing with apt-get, and it does, but the error is still there. What can I do next? I'm running GPS on a x64 Ubuntu 12.04.
Here's the error message I got:
gprbuild -d -P/media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/pendulum.gpr
-XEXTRA=True -XOPENGL=True -XGNOME=True -XBUILD=Production
print_barrier_sync.adb contrib.gpr:1:09: warning: no compiler specified for language "Xml",
ignoring all its sources x86_64-pc-linux-gnu-gcc -c lw.c In file included from
/media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/gtkada/testgtk/opengl/lw.c:20:0:
/media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/gtkada/testgtk/opengl/lw.h:23:18:
fatal error: glib.h: No such file or directory compilation terminated.
gprbuild:* compilation phase failed
[2012-11-21 13:24:47] process exited with status 4 (elapsed time: 02.06s) [2012-11-21 13:24:56]
Could not locate executable on path: svn SVN error:
[…]
The error triggers at this point:
#ifndef LW_H
#define LW_H
#include <glib.h> <------------------------------------------
#include <GL/gl.h>
#define LW_MAX_POINTS 200
#define LW_MAX_NAME_LEN 500
The file is lw.h, which is defined in the package GtkAda. I downloaded it from GPS page.
I'd pursue #Simon's approach, but a work-around based on 2.4.2. Using the command line might be a temporary alternative while you sort out the underlying problem.
As you are using linux, here's a Makefile for the basic Interaction demo.
# Make shared, static or debug targets.
OS := $(shell uname)
OBJ = obj
TARGET = interaction
GNATMAKE = gnatmake -D $(OBJ)
CARGS = -cargs -O3 -gnatp -gnatwu -gnatf
BARGS = -bargs
LARGS = -largs
.PHONEY: clean cleaner cleanest
all:
#echo ""
#echo "Build targets:"
#echo ""
#echo " shared Use the shared Ada libraries."
#echo " static Link the Ada libraries statically."
#echo " debug Enable debugging."
#echo ""
#echo "Support targets:"
#echo ""
#echo " clean Remove *.ali *.o b~.*"
#echo " cleaner Remove target, too."
#echo " cleanest Remove build directory, too."
#echo ""
shared: $(OBJ)
shared: INCLUDE = $(shell gtkada-config --cflags)
shared: BARGS += -shared
shared: LARGS += $(shell gtkada-config --libs)
shared: LARGS += -dead_strip
shared: *.ad[sb]
#echo "building with shared libraries:"
$(GNATMAKE) $(TARGET) $(INCLUDE) $(CARGS) $(BARGS) $(LARGS)
static: $(OBJ)
static: INCLUDE = $(shell gtkada-config --static --cflags)
static: BARGS += -static
static: LARGS += $(shell gtkada-config --static --libs)
static: LARGS += -dead_strip
static: *.ad[sb]
$(GNATMAKE) $(TARGET) $(INCLUDE) $(CARGS) $(BARGS) $(LARGS)
debug: $(OBJ)
debug: INCLUDE = $(shell gtkada-config --static --cflags)
debug: BARGS += -static
debug: LARGS += $(shell gtkada-config --static --libs)
debug: *.ad[sb]
$(GNATMAKE) -g $(TARGET) $(INCLUDE) $(LARGS)
$(OBJ):
mkdir $(OBJ)
clean:
${RM} $(OBJ)/* b~*
cleaner: clean
${RM} $(TARGET)
cleanest: cleaner
${RM} -r $(OBJ)
For reference, these packages were installed on Ubuntu 12.04:
$ dpkg --get-selections | egrep "gnat|gtkada"
gnat install
gnat-4.6 install
gnat-4.6-base install
gnat-gps install
gnat-gps-common install
gnat-gps-doc install
libgnat-4.6 install
libgnatprj4.6 install
libgnatvsn4.6 install
libgtkada-bin install
libgtkada2.24.1 install
libgtkada2.24.1-dev install
I've never used GtkAda. However ... I googled glib.h and got many hits, suggesting that for plain C builds one should use - for example, from this StackOverflow question -
# Sample Makefile
CFLAGS := $(shell pkg-config --cflags glib-2.0 gtk+-2.0)
LDFLAGS := $(shell pkg-config --libs glib-2.0 gtk+-2.0)
foo: foo.c
$(CC) $(CFLAGS) $< -o $# $(LDFLAGS)
However, we're talking gprbuild here, so perhaps the GtkAda documentation is relevant? It says you need to include with "gtkada"; in your GNAT Project file, and include the location of gtkada.gpr on your ADA_PROJECT_PATH if it isn't there already (see the output of gnatls -v).
If you've already done that, please show us the GPR file.