Commit a98a8196 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Updated the build-howto

parent ffb56e3d
A guide on how to build Proview
--------------------------------
Written by: Robert Karlsson
The following libraries (devel and runtime) are needed to build Proview:
gcc
g++
make
flex
libgtk2.0-dev
libdb5.3-dev (Any Berkeley DB version > 4.3, on Fedora db4-devel)
libdb5.3++-dev
libasound2-dev (on Fedora alsa-lib-devel)
doxygen
jdk
Proview has been built with the follwing compilers:
gcc v4.3.2
javac (jdk6)
1. Preparations
--------------
Install the following packages
Mandatory:
make
flex
gcc
g++
libgtk2.0-dev
cpp
libasound2-dev
libdb5.3-dev
libdb5.3++-dev
doxygen
qt4-dev-tools
libphonon4
libphonon-dev
Optional:
openjdk-6-jdk Web interface and java API
libmysql++-dev History database with mysql
libsqlite3-dev History database with sqlite
libhdf5-openmpi-dev History database with hdf5
libusb-1.0.0-dev USB I/O cards (Velleman)
librsvg2-dev SVG image support in Ge
libgstreamer1.0-dev Network video camera
libgstreamer-plugins-base1.0-dev Network video camera
openPOWERLINK-V1.08.2 Ethernet Powerlink zip-file. Build from sources.
libpcap-dev Ethernet Powerlink
There has to be a valid display when building proview.
If you do not have a display, or want to build Proview on a server, see section "Building without a display" below
2. Easy way
-----------
Unpack the source package
> tar -xzvf pwrsrc_4.8.0.tar.gz
Enter the sourcecode root directory
> cd pwr_4.8.0
Execute the makefile
> make
Follow the instructions to insert three lines in your .bashrc file.
3. Thorough way
---------------
This is a more thorough way to install the development environment, which
is recommended if you will make a lots of changes in the source code and
handle different version of proview.
3.1 Setting up the environment
------------------------------
The first thing to do is to set up your environment properly. Add the
following lines to .bashrc:
# Where /home/robert/x4-8-0 is replaced with wherever you unpacked the sources.
export pwre_bin="/home/robert/x4-8-0/pwr/src/tools/pwre/src/os_linux"
export pwre_dir_symbols="$pwre_bin/dir_symbols.mk"
source $pwre_bin/pwre_function
export pwre_env_db="/home/robert/pwre_new"
3.2 Creating the environment
----------------------------
Creating and handling your environment is done with the pwre-function (added
by sourcing $pwre_bin/pwre_function). See section "Cross-compiling" below
about compiling a 32-bit version of Proview on a 64-bit machine.
> pwre
shows all possibilites with the pwre function.
Add environment named 'x460x86' (choose any name you like).
> pwre add x460x86
Source root [...] ? /home/robert/x4-8-0/pwr/src (where /home/robert/x4-8-0 is
replaced with wherever you unpacked the sources)
Import root [] ?
Build root [...] ? /home/robert/pwr/x4-8-0/rls_dbg (choose typically .../pwr/version/rls_dbg)
Build type [dbg] ?
OS [linux] ? (linux or macos)
Hardware [x86] ? (x86 or x86_64)
Description ? robert's environment (whatever...)
list all existing environments:
> pwre list
-- Defined environments:
x460x86
--
himBh
Initiate your new environment:
> pwre init x460x86
Now, create the build tree
> pwre create_all_modules
Finally the environment is set up and we can start the build procedure.
3.3 Building Proview
--------------------
To build Proview from scratch
> pwre build_all_modules
This will build everything and also produces some documentation.
Otherwise Proview is divided in several modules which can be built
separately. The modules are however not independant of eachother.
The modules currently consists of:
abb, bcomp, inor, java, klocknermoeller, nmps, othermanu, profibus, remote,
siemens, ssabox, telemecanique, tlog, wb and xtt.
On top of this there is also a kernel-module under directory src on the top level.
To "move" between the different modules
> pwre module wb (for example)
To "move" back to kernel module just do:
> pwre module
To build all in current module
> pwre build_all
To build parts of current module (for example lib/rt/src in kernel module)
> pwre build lib rt src (command syntax build 'branch' 'subbranch' ['phase'] ['flavour')
Each of the modules have their own build tree. When finished your work in a
specific module this must be merged to the common build tree. This is done
via:
> pwre merge
Some important environment variables:
$pwre_croot The source root
$pwre_sroot Source root in current module
$pwre_broot The build root
$pwr_eexe The common exe directory in build tree
$pwr_elib The common library directory in build tree
$pwr_eobj The common object directory in build tree
$pwr_exe The exe directory for current module
$pwr_lib The library directory for current module
4. Start using Proview
When finished building it is time to start using Proview. This intention of
this guide is not to show you how. Instead please refer to documentation from
the proview homepage [www.proview.se]. There are though some final things you
must set up to be able to work with Proview.
Create directory :
/usr/pwrp/adm/db
This is the place that will keeps track of your projects and volumes aswell as
the different Proview-versions you have installed. If you already have a
Proview-version installed then this directory probably exists.
Copy some files to this directory (if they do not already exist)
> cp $pwre_croot/src/tools/pkg/deb/adm/pwr_* /usr/pwrp/adm/db/.
Create a file name pwr_projectlist.dat in this directory and add the following
line to this file:
%base X4.8.0 /home/robert/pwr/X4-8-0/rls_dbg
where the path is your build-root ($pwre_broot).
Add the following two lines to your .bashrc-file:
export pwra_db="/usr/pwrp/adm/db"
source $pwra_db/pwr_setup.sh
Voila, finished !
Powerlink (optional)
--------------------
Install
libpcap-dev
cmake
cmake-qt-gui
unpack openPOWERLINK-V1.08.2.zip
create build directories for MN and CN
openPOWERLINK-V1.08.2/build
openPOWERLINK-V1.08.2/buildcn
Configure and generate MN with cmake-gui from openPOWERLINK-V1.08.2/build, and build with make
Configure and generate CN with cmake-gui from openPOWERLINK-V1.08.2/buildcn, and build with make
Building Motif version
----------------------
If someone for some unfathomable reason wants to build the old motif version
the following packages has to be installed
libx11-dev
libxt-dev
libmotif-dev
x11proto-print-dev
libxmu-dev
libxpm-dev
libxp-dev
imlib11-dev
build with
> pwre build_all_modules motif
Start wb and motif with
> wb_motif
> rt_xtt_motif
Build on FreeBSD
----------------
Install gnome2 (pkg_add -r gnome2)
Create a link /bin/bash to /usr/local/bin/bash (ln -s /usr/local/bin/bash /bin/bash)
Set default shell of the build user to bash (/usr/local/bin/bash)
Install BerkeleyDB 4.8 (pkg_add -r db48)
Install jdk (cd /usr/port/java/jdk16; make install clean)
Install doxygen (cd /usr/devel/doxygen; make install clean)
Continue to build Proview following the instructions in section 2 or 3 above.
Increase the default value of kern.ipc.shmmax to 67108864. Add the following row to /etc/sysctl.conf
kern.ipc.shmmax=67108864
Build on Mac OS X 1.6
---------------------
Install xCode from the installation CD or download from ...
Download and install fink from www.finkproject.org.
Install gtk+2 (fink install gtk+2; fink install gtk+2-dev)
Download BerkeleyDB 4.8 from www.oracle.com/technetwork/database/berkeleydb/download
Install doxygen (fink install doxygen)
Download libiconv from http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
Continue to build Proview following the instructions in section 2 or 3 above.
Add the following rows to /etc/sysctl.conf
kern.sysv.symmax=167772160
kern.sysv.shmseg=16
kern.sysv.shmall=65536
Building without a display
--------------------------
Install the xserver-xorg-video-dummy package:
> apt-get install xserver-xorg-video-dummy
Start the dummy display with:
> Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config src/tools/dummy_display/xorg.conf :99 &
Set the DISPLAY environment variable accordingly:
> export DISPLAY=:99
Build proview as normal, either by executing the makefile:
> make
or by configuring the build yourself, see section "3. Thorough way" above.
Cross-compiling
---------------
To compile a 32-bit version of Proview on a 64-bit system, you need to install
multiarch support and add a 32-bit architecture:
> apt-get install multiarch
> dpkg --add-architecture i386
> apt-get update
Then you need to install the libraries required to build 32-bit executables:
> apt-get install gcc-multilib g++-multilib libc6:i386 libc6-dev:i386 libc6-i386 libc6-dev-i386
You also need 32-bit versions of all the libraries required by Proview. The
easiest way to get these is to copy the /usr/lib/i386-linux-gnu folder and the
/lib/i386-linux-gnu/ folder from a 32-bit machine to your 64-bit machine. If
you try to install all libraries using "apt-get install x:i386" you will most
likely run into problems with some 32-bit packages replacing your 64-bit
packages and vice versa.
After that, you should be able to compile 32-bit versions by specifying "x86"
as hardware during "pwre add", see section "3.2 Creating the environment" above.
> pwre add proview32bit
...
Hardware [x86] ? x86
#How to build ProviewR
Authors: Robert Karlsson & Christoffer Ackelman
## 1. Preparations
Install the following packages
Mandatory:
> apt-get install doxygen flex gcc g++ make libasound2-dev libdb5.3-dev libdb5.3++-dev
Optional:
> apt-get install openjdk-6-jdk libmysql++-dev libsqlite3-dev libhdf5-openmpi-dev libusb-1.0.0-dev
**openjdk-6-jdk** adds support for the java web interface.
**libmysql++-dev**, **libsqlite3-dev** and **libgdf5-openmpi-dev** add support for **mysql**, **sqlite** and **hdf5** history databases respectively.
**libusb-1.0.0-dev** adds support for USB I/O cards (Velleman)
Mandatory if you want to build the QT version of ProviewR:
> apt-get install qt4-dev-tools libphonon-dev
Mandatory if you want to build the GTK version of ProviewR:
> apt-get install libgtk2.0-dev
Optional if you build the GTK version of ProviewR:
> apt-get install librsvg2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
**librsvg2-dev** adds support for SVG images in Ge in the GTK version of ProviewR.
**libgstreamer1.0-dev** and **libgstreamer-plugins-base1.0-dev** adds support for network video cameras in the GTK version of ProviewR.
**OBS!** If you do not have a valid display when building ProviewR, or build ProviewR on a server, see section "Building without a display" below
## 2. Easy way
Unpack the source package
> tar -xzvf pwrsrc_4.8.0.tar.gz
Enter the sourcecode root directory
> cd pwr_4.8.0
Execute the makefile
> make
When the compilation is finished, follow the instructions to insert the three lines in your .bashrc file.
## 3. Thorough way
This is a more thorough way to install the development environment, which is recommended if you will make a lots of changes in the source code and handle different version of ProviewR.
### 3.1 Setting up the environment
The first thing to do is to set up your environment properly. Add the
following lines to .bashrc:
> export pwre_bin="/home/robert/x5-6-1/src/tools/pwre/src/os_linux"
export pwre_dir_symbols="$pwre_bin/dir_symbols.mk"
source $pwre_bin/pwre_function
export pwre_env_db="/home/robert/pwre_new"
Replace /home/robert/x5-6-1 with the directory where you unpacked the sources.
### 3.2 Creating the environment
Creating and handling your environment is done with the pwre-function (added by sourcing $pwre_bin/pwre_function). See section "Cross-compiling" below about compiling a 32-bit version of ProviewR on a 64-bit machine.
> pwre
shows all possibilites of the pwre build script.
Add an environment named 'x561x86' (choose any name you like).
> pwre add x561x86
> Source root [...] ? /home/robert/x5-6-1/src (where /home/robert/x5-6-1 is replaced with the directory where you unpacked the sources)
Import root [] ?
Build root [...] ? /home/robert/x5-6-1/rls_dbg
Build type [dbg] ?
OS [linux] ? (linux or macos)
Hardware [x86] ? (x86 or x86_64)
Description ? Robert's environment (Optional description)
List all existing environments:
> pwre list
> -- Defined environments:
x460x86
--
Initiate your new environment:
> pwre init x561x86
Now, create the build tree
> pwre create_all_modules
Now the environment is set up and we can start the build procedure.
### 3.3 Building ProviewR
ProviewR is divided into several modules which can be built separately. These modules are:
The ProviewR kernel module **rt**, the ProviewR workbench **wb**, and the ProviewR runtime interface **xtt**.
As well as a number of optional, vendor-specific libraries: **abb**, **bcomp**, **inor**, **java**, **klocknermoeller**, **misc**, **nmps**, **opc**, **otherio**, **othermanu**, **profibus**, **remote**, **sev**, **siemens**, **simul**, **ssabox**, **telemecanique**, **tlog**.
To build all modules from scratch and merge them:
> pwre build_all_modules
Otherwise, you can also build one module at a time. To "move" between the different modules
> pwre module wb (for example)
To build everything in the current module
> pwre build_all
To build parts of current module (for example lib/rt/src in kernel module)
> pwre build lib rt src
Each of the modules have their own build tree. When you are finished with a specific module it must be merged into the common build tree. This is done via:
> pwre merge
## 4. Start using ProviewR
When ProviewR has been built, there are a few final steps you have to do before you start using it.
Create directory that will keep track of your projects and volumes aswell as the different ProviewR-versions you have installed.
> mkdir /usr/pwrp/adm/db
Copy the default configuration files to this directory (if they do not already exist)
> cp $pwre_croot/src/tools/pkg/deb/adm/pwr_* /usr/pwrp/adm/db/.
Create a file name pwr_projectlist.dat in this directory and add the following line to this file:
> %base X5.6.1 /home/robert/X5-6-1/rls_dbg
where /home/robert/X5-6-1/rls_dbg is replaced by your build-root (see section 3.2).
Add the following two lines to your .bashrc-file:
> export pwra_db="/usr/pwrp/adm/db"
> source $pwra_db/pwr_setup.sh
Voila, finished !
## Powerlink (optional)
Install the following packages:
> apt-get install libpcap-dev cmake cmake-qt-gui
unpack openPOWERLINK_V2.7.1.tar.gz
> tar xvzf openPOWERLINK_V2.7.1.tar.gz
Go to the /stack/build/linux folder
> cd openPOWERLINK_V2.7.1.tar.gz/stack/build/linux
Use cmake to generate makefiles
> cmake -DMAKE_BUILD_TYPE=Release ../..
Compile and install
> make
> make install
## Note on building the QT version
If you get the error "No such file "thread/file_qt.h", then the -pthread flag was passed to the moc compiler. Remove the -pthread flag from $cinc in src/tools/bld/src/os_linux/hw_xx/variables.mk."
## Building without a display
Install the xserver-xorg-video-dummy package:
> apt-get install xserver-xorg-video-dummy
Start the dummy display with:
> Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config src/tools/dummy_display/xorg.conf :99 &
Set the DISPLAY environment variable accordingly:
> export DISPLAY=:99
Build ProviewR as normal, either by executing the makefile:
> make
or by configuring the build yourself, see section "3. Thorough way" above.
## Cross-compiling
To compile a 32-bit version of ProviewR on a 64-bit system, you need to install
multiarch support and add a 32-bit architecture:
> apt-get install multiarch
> dpkg --add-architecture i386
> apt-get update
Then you need to install the libraries required to build 32-bit executables:
> apt-get install gcc-multilib g++-multilib libc6:i386 libc6-dev:i386 libc6-i386 libc6-dev-i386
You also need 32-bit versions of all the libraries required by ProviewR. The
easiest way to get these is to copy the /usr/lib/i386-linux-gnu folder and the
/lib/i386-linux-gnu/ folder from a 32-bit machine to your 64-bit machine. If
you try to install all libraries using "apt-get install x:i386" you will most
likely run into problems with some 32-bit packages replacing your 64-bit
packages and vice versa.
After that, you should be able to compile 32-bit versions by specifying "x86"
as hardware during "pwre add", see section "3.2 Creating the environment" above.
> pwre add proview32bit
...
Hardware [x86] ? x86
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment