Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux compilation for GUI #4

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d55d8dd
stdlib.h is not found with -I/usr/include directive.
BotoKopo Feb 4, 2019
da0b3a8
v14 of C++ is needed (use of 14's funcionalities). Same as in win/mac
BotoKopo Feb 4, 2019
b8a10d4
Using of BOOST_ASSERT needs extra include of boost lib headers.
BotoKopo Feb 4, 2019
156a994
Test of equality in sh is '=' not '=='.
BotoKopo Feb 4, 2019
8ed8cb5
Add script to ease ressources' files update.
BotoKopo Feb 4, 2019
1dd939b
Add tool to ease quazip compilation.
BotoKopo Feb 4, 2019
575691b
In patch file, include "_debug" naming for lib files (.so) for unix case
BotoKopo Feb 4, 2019
d97f91a
Add translations directive for lrelease in pro file.
BotoKopo Feb 4, 2019
5d73125
Update pre-link script for linux : try to find appropriate quazip
BotoKopo Feb 5, 2019
1e710ef
Include quazip library's path for inplace building.
BotoKopo Feb 6, 2019
d79240b
Add quazip building in shadow directory.
BotoKopo Feb 6, 2019
14dcc72
Add one-shot building script for linux (one might not use qtcreator).
BotoKopo Feb 6, 2019
50dca46
Use shadow building for quazip : change config and scripts.
BotoKopo Feb 6, 2019
4671c53
Bug : use appropriate option for use of shadow building.
BotoKopo Feb 6, 2019
a111a09
Buggy launching script for release : wrong binary file name.
BotoKopo Feb 6, 2019
d65ccb7
Add '/' filter in building directory name.
BotoKopo Feb 6, 2019
4cbee1e
Add linux README instructions.
BotoKopo Feb 6, 2019
822b157
Use project path in pre-link : avoid problems when not defaut base
BotoKopo Feb 6, 2019
b16e7f8
Use system quazip lib if installed.
BotoKopo Feb 6, 2019
052bb57
Update readme for quazip usage.
BotoKopo Feb 6, 2019
63219c7
Add include path in pro file : shoud we use includes.pri ?
BotoKopo Feb 6, 2019
86108e3
Improve library choice for quazip : local/system.
BotoKopo Feb 7, 2019
cacbfa1
Use same qmake command as qtcreator.
BotoKopo Feb 7, 2019
8532773
Let quazip build append if requested (whatever system's version is
BotoKopo Feb 8, 2019
cecbc43
Add qmake config for quazip choice (local/system).
BotoKopo Feb 8, 2019
43e5004
Debug build script.
BotoKopo Feb 8, 2019
b825cbd
Bug : unwanted (remaining ?) 'else' directive.
BotoKopo Feb 8, 2019
09db120
Bug : missing appropriate option for local quazip lib.
BotoKopo Feb 8, 2019
6432a2c
Add readme file for linux compilation.
BotoKopo Feb 8, 2019
205f14c
debug building : use un-appropriaye variable.
BotoKopo Feb 13, 2019
679bf06
Update README files.
BotoKopo Mar 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Dependencies (besides building tools):
* libboost-math : library and headers
Debian-based packages : libboost-math*, libboost-math*-dev, libboost-dev
* lib quazip : library and headers
Debian-based packages : libquazip1, libquazip-headers, libquazip-dev
or libquazip5-1, libquazip5-headers, libquazip5-dev
* zlib if quazip local compiled : library and headers
Debian-based packages : zlib1g, zlib1g-dev

Tested :
* Ubuntu 18.04 / gcc 7 / Qt version 5.9.5
- libboost-math 1.65, libquazip 0.7.3 (qt4/qt5 versions)
- zlib 1.2.11
* Debian 9 / gcc 6 / Qt version 5.7.1
- libboost-math 1.62, libquazip 0.7.2 (qt4/qt5 versions)
- zlib 1.2.8


14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ directory where the source code is:
1. $ cd eddypro-source-dir/source/scripts/build/
2. $ ./mac-build-eddypro.sh [debug|release]

##### On Linux
In a terminal enter the following commands, where `eddypro-source-dir` is the
directory where the source code is:

1. $ cd eddypro-source-dir scripts/build/
2. $ scripts/build/lin-build-eddypro.sh [debug|release]

Note : you will need zlib and boost-math library (binary and dev files) installed,
and you might also (previously) install quazip lib (qt5-compiled binary
and dev files) rather than compiling and using embedded one (default if
no quazip is found on system)

Use `scripts/build/lin-build-eddypro.sh` for more help, especially for quazip.

#### Build the GUI using QtCreator (on Windows or Mac)

1. Open 'source\eddypro.pro'
Expand Down
28 changes: 25 additions & 3 deletions eddypro_lin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,25 @@ QT_PATH = $$[QT_INSTALL_PREFIX]
QT += core gui widgets network concurrent
CONFIG += warn_on
CONFIG += debug_and_release
CONFIG += c++11
CONFIG += c++14

unix{
CONFIG(debug, debug|release) {
CONFIG += quazip-local
}
CONFIG(quazip-qt5, quazip|quazip-qt5|quazip-local) {
QUAZIP_NAME = quazip5
QUAZIP_INC = /usr/include/quazip5
} else:CONFIG(quazip-local, quazip|quazip-qt5|quazip-local) {
QUAZIP_NAME = quazip
QUAZIP_INC = $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip
} else {
QUAZIP_NAME = quazip
QUAZIP_INC = /usr/include/quazip
}
}

TRANSLATIONS = tra/eddypro_en.ts

# Build tree with shadow building approach
include(build_tree.pri)
Expand Down Expand Up @@ -46,8 +64,12 @@ CONFIG(debug, debug|release) {
DEFINES += QT_DEBUG

# to suppress qt and 3rdparty library warnings
QMAKE_CXXFLAGS += -isystem "$$QT_PATH/include"
QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip"
unix {
QMAKE_CXXFLAGS += -isystem $$QUAZIP_INC
} else {
QMAKE_CXXFLAGS += -isystem "$$QT_PATH/include"
QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip"
}

win32 {
# mingw warnings
Expand Down
8 changes: 6 additions & 2 deletions includes.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# include paths
INCLUDEPATH += $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip
INCLUDEPATH += $$_PRO_FILE_PWD_/../../../libs/c++/boost_1_61_0
unix{
INCLUDEPATH += $$QUAZIP_INC
} else {
INCLUDEPATH += $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip
INCLUDEPATH += $$_PRO_FILE_PWD_/../../../libs/c++/boost_1_61_0
}
INCLUDEPATH += $$_PRO_FILE_PWD_/src/lisp_parser
20 changes: 15 additions & 5 deletions libs.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ CONFIG(debug, debug|release) {
}
linux {
# quazip
LIBS += -L$$OUT_PWD/../libs/build-quazip-0.7.1-qt-5.7.0-centos-gcc-4.8.5-x86_64/quazip -lquazip_debug
# set LIBS, although -Ldebug should be enough as
# .so files are copied there by PRE_LINK script
LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-debug -lquazip_debug

# linking
QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug
QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug local $$_PRO_FILE_PWD_
}
} else {
win32 {
Expand All @@ -39,9 +41,17 @@ CONFIG(debug, debug|release) {
}
linux {
# quazip
LIBS += -L$$OUT_PWD/../libs/build-quazip-0.7.1-qt-5.7.0-centos-gcc-4.8.5-x86_64/quazip -lquazip
# set LIBS, although -Lrelease should be enough as
# .so files are copied there by PRE_LINK script
CONFIG(quazip-local, quazip|quazip-qt5|quazip-local) {
LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -l$$QUAZIP_NAME
# pre-linking actions
QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release local $$_PRO_FILE_PWD_
} else {
LIBS += -l$$QUAZIP_NAME
# pre-linking actions
QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release system $$_PRO_FILE_PWD_
}

# linking
QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release
}
}
15 changes: 7 additions & 8 deletions libs/quazip-0.7.1.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
diff --git 1/quazip-0.7.1_orig/quazip/quazip.pro 2/quazip-0.7.1/quazip/quazip.pro
index c869e59..c30ab1c 100644
--- 1/quazip-0.7.1_orig/quazip/quazip.pro
+++ 2/quazip-0.7.1/quazip/quazip.pro
--- quazip-0.7.1_orig/quazip/quazip.pro 2019-02-04 14:47:51.970412924 +0100
+++ quazip-0.7.1/quazip/quazip.pro 2019-02-04 15:01:06.040975847 +0100
@@ -1,7 +1,9 @@
TEMPLATE = lib
-CONFIG += qt warn_on
Expand All @@ -13,27 +11,28 @@ index c869e59..c30ab1c 100644
# The ABI version.

!win32:VERSION = 1.0.0
@@ -22,7 +24,6 @@ QT -= gui
@@ -22,7 +24,6 @@
# 2.0, VERSION to 2.0.0.
# And so on.

-
# This one handles dllimport/dllexport directives.
DEFINES += QUAZIP_BUILD

@@ -30,6 +31,11 @@ DEFINES += QUAZIP_BUILD
@@ -30,6 +31,12 @@
# than qmake or using QuaZIP sources directly in your project.
CONFIG(staticlib): DEFINES += QUAZIP_STATIC

+CONFIG(debug, debug|release) {
+ mac: TARGET = $$join(TARGET,,,_debug)
+ unix: TARGET = $$join(TARGET,,,_debug)
+ win32: TARGET = $$join(TARGET,,,d)
+}
+
# Input
include(quazip.pri)

@@ -39,9 +45,8 @@ unix:!symbian {
@@ -39,9 +46,8 @@
target.path=$$PREFIX/lib/$${LIB_ARCH}
INSTALLS += headers target

Expand All @@ -45,7 +44,7 @@ index c869e59..c30ab1c 100644
}

win32 {
@@ -53,9 +58,7 @@ win32 {
@@ -53,9 +59,7 @@
DEFINES += NOMINMAX
}

Expand Down
113 changes: 113 additions & 0 deletions scripts/build/lin-build-eddypro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/sh

# shadow build in debug or release
# usage
# $ scripts/build/lin-build-eddypro.sh [debug|release]

echo "### Running '$ $0 $@' in '$PWD'..."

if [ $# -eq 0 ]; then
cat 1>&2 << END
Usage: $0 [debug|release] [quazip-library]

debug or release :
build according debug or release profile.

quazip-library : optional
can be 'quazip', 'quazip-qt4', 'quazip-qt5', 'auto' or nothing
- local : use (and build) quazip's local library
- quazip : use quazip's system library, whatever it is
- quazip-qt4 : use quazip's system library, qt4 compiled version
- quazip-qt5 : use quazip's system library, qt5 compiled version
- auto or nothing : use quazip's system library if any, local's one otherwise

This script will extract and convert needed ressources files (translations, fonts),
compile quazip lib if needed, create a shadow building directory,
and build eddypro application (with needed library and a launching script if
local quazip is used.

Re-launching this script should not re-do things already done.
If you wan't to rebuild from scratch, just remove building shadow directory
(but this will keep project's extracted files, such as fonts, translations or quazip files)

About quazip :
you can use quazip library included in this repository (local version)
(and a compilation will then be done)
or use the quazip library of you're system (we then need dynamic
library and headers). There might be then a problem of version.
For more details, see README.linux and ./scripts/build/lin-build-quazip.sh.

Note :
Must be launched from project's root directory, i.e.
$ scripts/build/lin-build-eddypro.sh

END
exit 1
fi
if [ "$1" = "debug" ] ; then
DEBUG_OR_RELEASE=$1
CFG="quazip-local"
else
DEBUG_OR_RELEASE="release"
fi
if [ ! -f eddypro_lin.pro ] ; then
echo "seems not to be launched from project's root directory" >&2
exit 1
fi
SRC_DIR="$PWD"
if [ -z "$CFG" ] ; then
case "$2" in
local) CFG="quazip-local" ;;
quazip|quazip-qt4) CFG="quazip" ;;
quazip-qt5) CFG="quazip-qt5" ;;
*)
if [ -n "`ldconfig -p | grep libquazip`" ] ; then
CFG="quazip"
else
CFG="quazip-local"
fi
;;
esac
fi

# build libs
if [ "$CFG" = "quazip-local" -o $DEBUG_OR_RELEASE = "debug" ] ; then
$SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE auto
fi

# update ressource
$SRC_DIR/scripts/build/lin-update-ressources.sh $DEBUG_OR_RELEASE

# set build directory
app_name="eddypro"
qt_version="qt-`qmake -v | grep Qt | cut -d ' ' -f 4`"
distrib=`{ lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | grep PRETTY_NAME cut -d = -f 2 ; } | sed 's/ /_/g;s/"//g;s/\//_/g;'`
[ -z "$distrib" ] && distrib="linux"
platform=`uname -m`
build_dir="build-$app_name-$DEBUG_OR_RELEASE+$qt_version+$distrib+$platform"

# set qmake project file
qmake_project="$SRC_DIR/eddypro_lin.pro"

# make shadow build
#SHADOW_DIR="../build/$build_dir"
SHADOW_DIR="../$build_dir"
if [ ! -d "$SHADOW_DIR" ] ; then
echo "### Use shadow build $SHADOW_DIR"
mkdir -p "$SHADOW_DIR"
fi
echo "### Make shadow build in '$PWD'..."
cd "$SHADOW_DIR"
if [ ! -f Makefile ] ; then
echo "### Run 'qmake'..."
if [ "$$DEBUG_OR_RELEASE" = "debug" ] ; then
qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug CONFIG+=$CFG
else
qmake -Wall $qmake_project -spec linux-g++ CONFIG+=$CFG
fi
fi

echo "### Run 'make'..."
make $DEBUG_OR_RELEASE


Loading