Difference between revisions of "AnyWave:BuildSDK"

From WikiMEG
Jump to: navigation, search
(Prepare to build)
Line 1: Line 1:
The following instructions will guide you to build AnyWave from the git repository, on Debian Jessie.<br />
 
This can also be applied to Mac OS Systems (although you will need to find the corresponding packages) if your are using repositories like homebrew.<br />
 
 
 
=Prepare to build=
 
=Prepare to build=
 
AnyWave requires some librairies and tools to be installed on your system before trying to build it.<br />
 
AnyWave requires some librairies and tools to be installed on your system before trying to build it.<br />
 
Use the following command to get the required packages:<br />
 
Use the following command to get the required packages:<br />
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo apt-get install svn git cmake qt5-default libqt5-dev libvtk6-dev libvtk6.1 libopenblas-base libopenblas-dev libarmadillo-dev libarmadillo4 tcsh
+
sudo apt-get install svn cmake qt5-default libqt5-dev libvtk6-dev libopenblas-base libopenblas-dev libmatio-dev tcsh libfftw3-dev qtbase5-dev libqwt-qt5-dev qttools5-dev-tools  libqt5script5 libqt5scripttools5 qtscript5-dev libqt5svg5-dev lbXt-dev
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=VTK=
+
=Building VTK (optional)=
The VTK library 6.x is required. The debian package may be built using qt4 not qt5, so you may have to compile VTK by yourself using qt5.<br />
+
The VTK library 6.x is required and the package should be available in Ubuntu 16.04.<br />
 +
If you are using another distribution, you may have to build VTK by yourself:<br />
 
Download VTK 6.3.0 [http://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz here]<br />
 
Download VTK 6.3.0 [http://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz here]<br />
 
Uncompress the archive and make a separate folder to build it.<br />
 
Uncompress the archive and make a separate folder to build it.<br />
Line 24: Line 22:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
This will build VTK with the current Qt 5.2.1 version installed. The VTK libraries will be built as shared libraries.
+
This will build VTK with Qt 5.2.1. The VTK libraries will be built as shared libraries.
  
=QWT=
+
=Building Qwt (optional)=
The Qwt library is also required to build AnyWave. The available debian package might contain a version built with qt4, not qt5. So you may have to compile the library yourself using qt5 libraries.<br />
+
The Qwt library is also required to build AnyWave. If the package is not available for your distribution, then you will have to build it yourself:<br />
 
Get the sources:
 
Get the sources:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 40: Line 38:
 
This should build qwt as a shared library and install it to /usr/local/qwt-6.1.2
 
This should build qwt as a shared library and install it to /usr/local/qwt-6.1.2
  
=Clone the repository=
+
=Get the AnyWave source files=
clone the git repo in a folder:
+
Either download the archive from SourceForge or get the SVN repository:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/anywave aw-git
+
svn checkout svn://svn.code.sf.net/p/anywave/anywave aw-sf
</syntaxhighlight>
+
Now make a folder that will become the root folder for the SDK:
+
<syntaxhighlight lang="bash">
+
mkdir aw-sdk
+
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 61: Line 55:
  
 
=Build AnyWave=
 
=Build AnyWave=
Go to the sdk folder and launch cmake build:
+
Go to the source folder and build:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
cd aw-sdk
+
cd aw-sf
cmake ../aw-git
+
mkdir build
 +
cd build
 +
cmake ..
 
make install
 
make install
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 
If cmake failed to find some libraries, like VTK or Qwt you may have to define the default path for them as follow:
 
If cmake failed to find some libraries, like VTK or Qwt you may have to define the default path for them as follow:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 73: Line 70:
 
make install
 
make install
 
</syntaxhighlight>
 
</syntaxhighlight>
If everything goes well, you will find AnyWave in your aw-sdk/bin folder.<br />
+
 
 +
If everything goes well, you will find AnyWave in your aw-sf/bin folder.<br />
 
A Plugin folder will also be present, containing the default plugins built along with AnyWave.<br />
 
A Plugin folder will also be present, containing the default plugins built along with AnyWave.<br />
 
Depending if you add the MATLAB support, a shared library will be found in the lib folder.<br />
 
Depending if you add the MATLAB support, a shared library will be found in the lib folder.<br />
Line 79: Line 77:
  
 
=Preparing the SDK to develop plugins=
 
=Preparing the SDK to develop plugins=
After you successfully built AnyWave, you will use the sdk folder as a SDK root folder for plugins.<br />
+
After you successfully built AnyWave, you will use it as the sdk for plugins.<br />
 
You must add an environment variable called '''AWSDK''' to hold the path to the SDK folder:
 
You must add an environment variable called '''AWSDK''' to hold the path to the SDK folder:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
export AWSDK=/path-to/aw-sdk
+
export AWSDK=/path-to/aw-sf
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 
We strongly suggest that you add this line to your .bash_profile file so it will become available in your bash environment.<br />
 
We strongly suggest that you add this line to your .bash_profile file so it will become available in your bash environment.<br />
 
You are ready to develop plug-ins.
 
You are ready to develop plug-ins.

Revision as of 15:08, 31 May 2017

Prepare to build

AnyWave requires some librairies and tools to be installed on your system before trying to build it.
Use the following command to get the required packages:

sudo apt-get install svn cmake qt5-default libqt5-dev libvtk6-dev libopenblas-base libopenblas-dev libmatio-dev tcsh libfftw3-dev qtbase5-dev libqwt-qt5-dev qttools5-dev-tools  libqt5script5 libqt5scripttools5 qtscript5-dev libqt5svg5-dev lbXt-dev

Building VTK (optional)

The VTK library 6.x is required and the package should be available in Ubuntu 16.04.
If you are using another distribution, you may have to build VTK by yourself:
Download VTK 6.3.0 here
Uncompress the archive and make a separate folder to build it.
Use cmake with variables to add Qt Support and Qt5 path:

cd /path/to/VTK-Release-qt5.2.1-build
cmake -DVTK_QT_VERSION:STRING=5 \
     -DQT_QMAKE_EXECUTABLE:PATH=/path/to/qt5.2.1-install/5.2.1/gcc_64/bin/qmake \
     -DVTK_Group_Qt:BOOL=ON \
     -DCMAKE_PREFIX_PATH:PATH=/path/to/qt.5.2.1-install/5.2.1/gcc_64/lib/cmake  \
     -DBUILD_SHARED_LIBS:BOOL=ON
     /path/to/VTK

This will build VTK with Qt 5.2.1. The VTK libraries will be built as shared libraries.

Building Qwt (optional)

The Qwt library is also required to build AnyWave. If the package is not available for your distribution, then you will have to build it yourself:
Get the sources:

svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1 qwt6.1

Build with the default options:

cd qwt6.1
qmake qwt.pro
sudo make install

This should build qwt as a shared library and install it to /usr/local/qwt-6.1.2

Get the AnyWave source files

Either download the archive from SourceForge or get the SVN repository:

svn checkout svn://svn.code.sf.net/p/anywave/anywave aw-sf

MATLAB support

AnyWave can run MATLAB scripts which are bundled in a plug-in. To do so, the MATLAB support must be built.
This requires MATLAB to be installed on the computer.
If you want to build the MATLAB support, you must define an environment variable called MATLAB_ROOT before starting to build AnyWave:

export MATLAB_ROOT=/usr/local/MATLAB/R2015a

We strongly suggest that you add this bash command to your .bash_profile file so it will be available in your bash environment.
The path in this example is the location where MATLAB 2015a is installed by default on Debian. AnyWave will get the necessary headers and libraries from there.

Build AnyWave

Go to the source folder and build:

cd aw-sf
mkdir build
cd build
cmake ..
make install

If cmake failed to find some libraries, like VTK or Qwt you may have to define the default path for them as follow:

cd aw-sdk
cmake -DVTK_DIR=/path-to-VTK6.3/lib/cmake/vtk-6.3 -DQWT_DIR=/usr/local/qwt-6.1.2 ../aw-git
make install

If everything goes well, you will find AnyWave in your aw-sf/bin folder.
A Plugin folder will also be present, containing the default plugins built along with AnyWave.
Depending if you add the MATLAB support, a shared library will be found in the lib folder.
Copy this bin folder wherever you want on your system (/usr/local/AnyWave/bin for example), add it to the default path and launch AnyWave using Anywave.sh

Preparing the SDK to develop plugins

After you successfully built AnyWave, you will use it as the sdk for plugins.
You must add an environment variable called AWSDK to hold the path to the SDK folder:

export AWSDK=/path-to/aw-sf

We strongly suggest that you add this line to your .bash_profile file so it will become available in your bash environment.
You are ready to develop plug-ins.