Difference between revisions of "Devel:Installation"
Line 95: | Line 95: | ||
== Configure and compile == | == Configure and compile == | ||
− | Configure packages | + | Configure packages with the options from admin/options.sub. |
+ | rm -rf builds/Qt-5.15/Debug/devpro | ||
cd geopsy-dev | cd geopsy-dev | ||
− | dpsubconfig - | + | dpsubconfig -d |
− | + | cd ../builds/3.5/Qt-5.15/Debug | |
− | + | dpsubonfig | |
− | |||
− | |||
Build the general Makefile | Build the general Makefile |
Revision as of 14:00, 21 April 2023
Development is preferably achieved under Linux. Other platforms are not documented.
Contents
Necessary 3rd party tools
A recent version of g++, gfortran, git and Qt are first required. For code edition, we recommend using Qt Creator which is provided in Qt sdk.
Some packages may require additional 3rd party libraries. Refer to the usual installation instructions for details.
Initialization
git configuration
This is not absolutely required but if you are going to make modifications, it is better to have your authorship properly set up in the repository. If not already done on your system:
git config --global user.name "Your name" git config --global user.email "your.email@your.domain" git config --global core.editor vi
admin directory
The list of packages is saved in a git repository called geopsyprojects. Configure it by editing option.sub.
There are three main branches: "devel", "testing", and "stable". Change the argument of git fetch and git checkout to select another branch. Switching to another branch afterward is possible.
mkdir geopsy-dev cd geopsy-dev git clone git://geopsy.org/geopsyprojects mv geopsyprojects admin cd admin
Switch to the desired branch ("devel" in this example).
git fetch git://geopsy.org/geopsyprojects 3.5:3.5 git checkout 3.5
Configure destination and installation paths. Destination path is the directory where executables and libraries first go after compilation. Installation path points to the directory where files are copied during a 'make install'. Destination directory is written during any compilation ('make'), hence user permissions are required. For development, installation and destination path are usually identical and 'make install' is never run. It avoids multiple copies of the same include files and confusions while editing them (e.g. editing installed files instead of source files).
cp options.sub.example options.sub vi options.sub
PREFIX is set be default to '/usr/local/Geopsy.org'. If this is fine, make sure that you have enough permissions. To create a new user writable directory:
sudo mkdir /usr/local/Geopsy.org sudo chown yourusername /usr/local/Geopsy.org
Configure the list of package to build by default.
cp projects.default.example projects.default vi projects.default cd ..
projects.* files simply set PROJECTS environment variable. It contains a list of paths to projects (relative to the development root directory, geopsy-dev in this example). List 'user' contains the most popular applications and libraries of geopsy packages. Comment all other lists because you might not have sufficient permissions to access their git repository). List 'scripts' contains 'devpro' which bootstrap is explained here below.
devpro scripts
A package of multi-purpose scripts to ease coding experience. Bootstrap is a little tricky...
git clone git://download.geopsy.org/devpro cd devpro
Switch to the same branch as above (e.g. "3.5").
git fetch git://geopsy.org/devpro 3.5:3.5 git checkout 3.5
Setup the minimal configuration for devpro scripts:
mkdir ~/.devpro echo "REF_QT_VERSION=5.15.2" >> ~/.devpro/info
Create build directory
mkdir -p ../../builds/3.5/Qt-5.15/Debug/devpro mkdir -p ../../builds/3.5/Qt-5.15/Release/devpro
Bootstrap of devpro project
export BUILD_DIR=../../builds/3.5/Qt-5.15/Debug/devpro $(pwd)/src/dpconfigure source ../admin/options.sub ./configure $CONFIGURE_OPTIONS -builddir ../../builds/3.5/Qt-5.15/Debug/devpro cd ../../builds/3.5/Qt-5.15/Debug/devpro make echo "
Define path to geopsy-dev/bin (or other DEST_DIR if configured differently in admin/options.sub) in your PATH (e.g. ~/.bashrc).
export PATH=/usr/local/Geopsy.org/bin:$PATH
Download all packages for a specific branch
cd geopsy-dev dpsubdo dpcheckout 3.5
Configure and compile
Configure packages with the options from admin/options.sub.
rm -rf builds/Qt-5.15/Debug/devpro cd geopsy-dev dpsubconfig -d cd ../builds/3.5/Qt-5.15/Debug dpsubonfig
Build the general Makefile
dpsubpro qmake
Under MacOSX, with the Qt binaries, the default QMAKESPEC can be macx-xcode. To force the generation of makefiles, run qmake this way:
qmake -spec macx-g++
Compile...
make debug
Qt Creator
Qt Creator does not like 3rd party and script projects included in the package list, so remove them from the global Makefile once these projects are successfully compiled. You will run into errors if you remove these lines before a first successful build.
TEMPLATE = subdirs CONFIG += ordered debug_and_release SUBDIRS = \ devpro \ 3rdparty/dfftpack \ 3rdparty/mseed \ 3rdparty/slink \ lib/QGpCoreTools \ lib/QGpGuiTools \ lib/SciFigs \
In file geopsy-dev.pro, remove all lines starting with 3rdparty and devpro corresponding to projects not built with qmake.
Start Qt creator and open geopsy-dev.pro file located in geopsy-dev.