Compile on Windows: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 63: Line 63:
# Download the source code of muParser from {{URL|https://sourceforge.net/projects/muparser/files/}} and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "muparser_vxyz" directory that gets created to "muparser".
# Download the source code of muParser from {{URL|https://sourceforge.net/projects/muparser/files/}} and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "muparser_vxyz" directory that gets created to "muparser".
# Open the start menu, find the folder created by the Qt SDK and start a "Qt Command Prompt". Execute "cd <directory containing LabRPS sources>", then "build". LabRPS and its dependencies should be built automatically and installed into the directory "output".
# Open the start menu, find the folder created by the Qt SDK and start a "Qt Command Prompt". Execute "cd <directory containing LabRPS sources>", then "build". LabRPS and its dependencies should be built automatically and installed into the directory "output".
== Windows(cross compile on linux using MXE) ==
MXE is a version of MinGW that has been compiled on Linux and acts as a cross-compilation environment targeting the Windows operating system. More details can be found at {{URL|http://mxe.cc/}}
<ol>
  <li>Install all dependencies required for MXE according to your linux distro as described [http://mxe.cc/#requirements here]</li>
  <li>Download current version of MXE(lets use the home directory $HOME)</li>
  {{Code|code=
cd ~
git clone https://github.com/mxe/mxe.git
cd mxe
}}
  <li>Install dependencies required by Labrps(this may take some time)</li>
{{Code|code=
make qt gsl zlib muparser
}}
  <li>Create a symbolic link of MXE version of qmake(qt4) & minGW and copy it to /bin directory   
Note:Qt 4 is in the "qt" subdirectory. Qt 5 is in the "qt5" subdirectory (use QT4)</li>
{{Code|code=
sudo ln -sf ~/mxe/usr/i686-w64-mingw32.static/qt/bin/qmake /bin/mxe-qmake-qt4
sudo ln -sf ~/mxe/usr/BIN/i686-w64-mingw32.static-g++ /bin/i686-w64-mingw32.static-g++
sudo ln -sf ~/mxe/usr/BIN/i686-w64-mingw32.static-gcc-ar /bin/i686-w64-mingw32.static-gcc-ar
}}
  <li>Download QWT5 sources from {{URL|https://sourceforge.net/projects/qwt/files/qwt/5.2.1/}}, unpack, edit qwtconfig.pri & comment out the following lines:</li>
{{Code|code=
#CONFIG += thread
#CONFIG += QwtDll
}}
  <li>open terminal, get in to qwt5 directory & start build</li>
{{Code|code=
mxe-qmake-qt4
make
}}
  <li>Download qwtplot3d sources from {{URL|https://sourceforge.net/projects/qwtplot3d/}}, unpack, edit qwtplot3d.pro & comment out the following lines:</li>
{{Code|code=
#win32:TEMPLATE    = vclib
#win32:CONFIG    += dll exceptions
#win32:dll:DEFINES    += QT_DLL QWT3D_DLL QWT3D_MAKEDLL
}}
Note: patches may be required.. for eg arch based systems may need [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-gcc44.patch?h=packages/qwtplot3d https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-gcc44.patch?h=packages/qwtplot3d] & [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-qt-4.8.0.patch?h=packages/qwtplot3d https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-qt-4.8.0.patch?h=packages/qwtplot3d]
<li>open terminal, get in to qwtplot3d directory & start build</li>
{{Code|code=
mxe-qmake-qt4
make
}}
  <li>Download latest sources of LabRPS(lets use the home directory $HOME)</li>
{{Code|code=
cd ~
git clone https://github.com/LabRPS/LabRPS.git
}}
  <li>create include & lib directory inside ~/LabRPS/3rdparty/</li>
  <li>copy contents of src directory(only *.h files) inside qwtplot3d to ~/LabRPS/3rdparty/include</li>
  <li>copy contents of include directory inside qwtplot3d to ~/LabRPS/3rdparty/include</li>
  <li>copy lib/libqwt.a inside qwt to ~/LabRPS/3rdparty/lib</li>
  <li>copy lib/libqwtplot3d.a inside qwtplot3d to ~/LabRPS/3rdparty/lib</li>
  <li>now we can build LabRPS</li>
{{Code|code=
cd ~/LabRPS
mxe-qmake-qt4
make
}}
After build process you will get LabRPS.exe inside ~/LabRPS/LabRPS directory...
</ol>


==Additional information==
==Additional information==

Latest revision as of 03:54, 25 August 2022

Arrow-left.svg Previous: Licence

This page explains step by step how to compile LabRPS 0.001 or newer on Windows using using MinGW. For other platforms see Compiling.

Prerequisites

Compiling LabRPS on Windows requires several tools and libraries.

  • A compiler. LabRPS is tested with MinGW—other compilers may work, but instructions for their use are not included here. More details in #Compiler, below.

QwtPlot3D and Qwt must be compiled against Qt 5.x! If these are compiled with Qt3 or Qt4, the application might crash.

Source code

Now you can get the source code of LabRPS:

Using a frontend

When using the Git frontend TortoiseGit:

  1. Create a new folder where the source code will be downloaded.
  2. Right-click on this folder in the Windows file explorer and select Git Clone in the context menu.
  3. A dialog will appear. In it, enter the URL for the LabRPS Git repository: https://github.com/LabRPS/LabRPS.git.

and click OK.

The latest source code will be downloaded from the LabRPS Git repository and the folder will be tracked by Git.

Using the command line

To create a local tracking branch and download the source code, open a terminal (command prompt) and switch there to the directory you want the source, then type:

git clone https://github.com/LabRPS/LabRPS.git

Building LabRPS

  1. Download the "Qt/Windows Open Source Edition" from https://www.qt.io/. It comes with a graphical installer. When the Qt installer asks you to install MinGW, say yes unless you already have it on your system. In that case you have to tell the Qt installer where to find it. In the case that PyQt (see blow) does not yet support the latest version of Qt, you can get older versions here: ftp://ftp.trolltech.com/qt/source/
  2. Download Python from http://www.python.org/download/ and install it.
  3. Download the source code of LabRPS from http://LabRPS.sourceforge.net/download.html and unpack it.
  4. . Download the SIP source code for Windows from http://www.riverbankcomputing.co.uk/software/sip/download and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "sip-x.y" directory that gets created to "sip".
  5. Download the PyQt v4 source code for Windows from http://www.riverbankcomputing.co.uk/software/pyqt/download and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "PyQt-win-gpl-x.y.z" directory that gets created to "PyQt-win-gpl".
  6. Download the "Developer files" of the GSL from http://gnuwin32.sourceforge.net/packages/gsl.htm and unpack them into the 3rdparty subfolder of the LabRPS package.
  7. Download the source code of the latest version of Qwt from https://sourceforge.net/projects/qwt/files/ and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "qwt-x.y.z" directory that gets created to "qwt".
  8. Download the source code of QwtPlot3D from http://qwtplot3d.sourceforge.net/web/navigation/download_frame.html and unpack it into the 3rdparty subfolder of the LabRPS package.
  9. Download the source code of muParser from https://sourceforge.net/projects/muparser/files/ and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "muparser_vxyz" directory that gets created to "muparser".
  10. Open the start menu, find the folder created by the Qt SDK and start a "Qt Command Prompt". Execute "cd <directory containing LabRPS sources>", then "build". LabRPS and its dependencies should be built automatically and installed into the directory "output".

Windows(cross compile on linux using MXE)

MXE is a version of MinGW that has been compiled on Linux and acts as a cross-compilation environment targeting the Windows operating system. More details can be found at http://mxe.cc/

  1. Install all dependencies required for MXE according to your linux distro as described here
  2. Download current version of MXE(lets use the home directory $HOME)
  3. cd ~
    git clone https://github.com/mxe/mxe.git
    cd mxe
  4. Install dependencies required by Labrps(this may take some time)
  5. make qt gsl zlib muparser
  6. Create a symbolic link of MXE version of qmake(qt4) & minGW and copy it to /bin directory Note:Qt 4 is in the "qt" subdirectory. Qt 5 is in the "qt5" subdirectory (use QT4)
  7. sudo ln -sf ~/mxe/usr/i686-w64-mingw32.static/qt/bin/qmake /bin/mxe-qmake-qt4
    sudo ln -sf ~/mxe/usr/BIN/i686-w64-mingw32.static-g++ /bin/i686-w64-mingw32.static-g++
    sudo ln -sf ~/mxe/usr/BIN/i686-w64-mingw32.static-gcc-ar /bin/i686-w64-mingw32.static-gcc-ar
  8. Download QWT5 sources from https://sourceforge.net/projects/qwt/files/qwt/5.2.1/, unpack, edit qwtconfig.pri & comment out the following lines:
  9. #CONFIG += thread
    #CONFIG += QwtDll
  10. open terminal, get in to qwt5 directory & start build
  11. mxe-qmake-qt4
    make
  12. Download qwtplot3d sources from https://sourceforge.net/projects/qwtplot3d/, unpack, edit qwtplot3d.pro & comment out the following lines:
  13. #win32:TEMPLATE    = vclib
    #win32:CONFIG     += dll exceptions
    #win32:dll:DEFINES    += QT_DLL QWT3D_DLL QWT3D_MAKEDLL

    Note: patches may be required.. for eg arch based systems may need https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-gcc44.patch?h=packages/qwtplot3d & https://projects.archlinux.org/svntogit/packages.git/tree/trunk/qwtplot3d-qt-4.8.0.patch?h=packages/qwtplot3d

  14. open terminal, get in to qwtplot3d directory & start build
  15. mxe-qmake-qt4
    make
  16. Download latest sources of LabRPS(lets use the home directory $HOME)
  17. cd ~
    git clone https://github.com/LabRPS/LabRPS.git
  18. create include & lib directory inside ~/LabRPS/3rdparty/
  19. copy contents of src directory(only *.h files) inside qwtplot3d to ~/LabRPS/3rdparty/include
  20. copy contents of include directory inside qwtplot3d to ~/LabRPS/3rdparty/include
  21. copy lib/libqwt.a inside qwt to ~/LabRPS/3rdparty/lib
  22. copy lib/libqwtplot3d.a inside qwtplot3d to ~/LabRPS/3rdparty/lib
  23. now we can build LabRPS
  24. cd ~/LabRPS
    mxe-qmake-qt4
    make

    After build process you will get LabRPS.exe inside ~/LabRPS/LabRPS directory...

Additional information

  1. Forums and mailing lists If you want to discuss LabRPS with other users (or the developers) or if you are insterested in its further development, you can go to the LabRPS forum.
  2. License LabRPS is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this license is provided in the file `gpl.txt`.

Thus it is "free software". "Free software" is a matter of liberty, not price. To understand the concept, you should think of "free" as in "free speech", not as in "free beer". "Free software" is also often called Open Source, FOSS, or FLOSS. When we say that LabRPS is "free", we are talking about

  • The freedom to run the program, for any purpose (freedom 0).
  • The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this.

That said, LabRPS is also free as in "free beer". We do not charge money for anything you can download on our homepage and we will not do so in the future. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Arrow-left.svg Previous: Licence