Compile on Windows: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
(Created page with "{{Docnav |Licence |Compile on Linux }} {{TOCright}} This page explains step by step '''how to compile LabRPS 0.001 or newer on Windows''' using using MSYS2/MinGW. For other platforms see Compiling. == Prerequisites == Compiling LabRPS on Windows requires several tools and libraries. ===Required=== # A compiler. LabRPS is tested with MinGW—other compilers may work, but instructions for their use are not included her...")
 
 
(36 intermediate revisions by the same user not shown)
Line 6: Line 6:
{{TOCright}}
{{TOCright}}


This page explains step by step '''how to compile LabRPS 0.001 or newer on Windows''' using using MSYS2/MinGW. For other platforms see [[Compiling|Compiling]].
This page explains step by step '''how to compile LabRPS 0.001 or newer on Windows''' using using MinGW. For other platforms see [[Compiling|Compiling]].


== Prerequisites ==  
== Prerequisites ==  
Line 12: Line 12:
Compiling LabRPS on Windows requires several tools and libraries.
Compiling LabRPS on Windows requires several tools and libraries.


===Required===
* 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.


# 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.
* [https://www.qt.io/ Qt for C++ (>=4.3)].


# [http://www.qtsoftware.com/downloads/opensource/appdev Qt for C++ (>=4.3)].
* [http://qwt.sourceforge.net/index.html Qwt (>=5.1.0)].


# [http://qwt.sourceforge.net/index.html Qwt (>=5.1.0)].
* [http://qwtplot3d.sourceforge.net/ QwtPlot3D (>=0.2.6)].


# The [http://qwtplot3d.sourceforge.net/ QwtPlot3D (>=0.2.6)].
* [http://www.gnu.org/software/gsl/ GSL (>=1.8)].


# The [http://www.gnu.org/software/gsl/ GSL (>=1.8)].
* [http://beltoforion.de/en/muparser/ muParser (>=1.28)].


# The [http://muparser.sourceforge.net muParser (>=1.28)].
* [http://www.zlib.net/ zlib (>=1.2.3)].
 
# The [http://www.zlib.net/ zlib (>=1.2.3)].


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


===Optional programs===
==Source code==  
 
*  A GUI frontend for Git. There are several frontends available, see [https://en.wikipedia.org/wiki/Comparison_of_Git_GUIs this list]. The main benefit of a frontend is that you don't have to learn the Git commands to get the source code of LabRPS or to send patches to the GitHub repository of LabRPS.
 
In the following we describe source code handling using the [https://tortoisegit.org/ TortoiseGit] frontend. This frontend integrates directly into Windows file explorer and has a large user community to get help in case you have problems.
 
===Source code===  


Now you can get the source code of LabRPS:
Now you can get the source code of LabRPS:
Line 45: Line 37:
# Create a new folder where the source code will be downloaded.
# Create a new folder where the source code will be downloaded.
# Right-click on this folder in the Windows file explorer and select '''Git Clone''' in the context menu.
# Right-click on this folder in the Windows file explorer and select '''Git Clone''' in the context menu.
# A dialog will appear. In it, enter the URL for the LabRPS Git repository
# A dialog will appear. In it, enter the URL for the LabRPS Git repository: {{URL|https://github.com/LabRPS/LabRPS.git}}.<br>
 
''https://github.com/LabRPS/LabRPS.git''


and click '''OK'''.
and click '''OK'''.
Line 61: Line 51:
}}
}}


====Building LabRPS====
==Building LabRPS==


:1. Download the "Qt/Windows Open Source Edition" from [http://www.qtsoftware.com/downloads/opensource/appdev/windows-cpp http://www.qtsoftware.com/downloads/opensource/appdev/windows-cpp]. 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/](ftp://ftp.trolltech.com/qt/source/).
# Download the "Qt/Windows Open Source Edition" from {{URL|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: {{URL|ftp://ftp.trolltech.com/qt/source/}}
:2. Download Python from [http://www.python.org/download/ http://www.python.org/download/] and install it.
# Download Python from {{URL|http://www.python.org/download/}} and install it.
:3. Download the source code of LabRPS from [http://LabRPS.sourceforge.net/download.html http://LabRPS.sourceforge.net/download.html] and unpack it.
# Download the source code of LabRPS from {{URL|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 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".
#. Download the SIP source code for Windows from {{URL|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 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".
# Download the PyQt v4 source code for Windows from {{URL|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 http://gnuwin32.sourceforge.net/packages/gsl.htm] and unpack them into the 3rdparty subfolder of the LabRPS package.
# Download the "Developer files" of the GSL from {{URL|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 [http://sourceforge.net/project/showfiles.php?group_id=13693 http://sourceforge.net/project/showfiles.php?group_id=13693] and unpack it into the 3rdparty subfolder of the LabRPS package. Rename the "qwt-x.y.z" directory that gets created to "qwt".
# Download the source code of the latest version of Qwt from {{URL|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 http://qwtplot3d.sourceforge.net/web/navigation/download_frame.html] and unpack it into the 3rdparty subfolder of the LabRPS package.
# Download the source code of QwtPlot3D from {{URL|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 [http://sourceforge.net/project/showfiles.php?group_id=137191 http://sourceforge.net/project/showfiles.php?group_id=137191 http://sourceforge.net/project/showfiles.php?group_id=137191] 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".
: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".
# 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".


==== Additional information====
== 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
}}


## Forums and mailing lists:
  <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>


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 [http://sourceforge.net/forum/?group_id=199120 LabRPS forum] or subscribe to the [http://sourceforge.net/mail/?group_id=199120 LabRPS mailing list].
==Additional information==


### License:
# 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 [http://labrps.com/boards LabRPS forum].
 
# License LabRPS is distributed under the terms of the [http://www.gnu.org/licenses/gpl.html 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`.
LabRPS is distributed under the terms of the [http://www.gnu.org/licenses/gpl.html 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 [http://www.fsf.org/licensing/essays/free-sw.html "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 [http://en.wikipedia.org/wiki/Alternative_terms_for_free_software Open Source, FOSS, or FLOSS]. When we say that LabRPS is "free", we are talking about
Thus it is [http://www.fsf.org/licensing/essays/free-sw.html "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 [http://en.wikipedia.org/wiki/Alternative_terms_for_free_software Open Source, FOSS, or FLOSS]. When we say that LabRPS is "free", we are talking about
Line 91: Line 139:
*  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.
*  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. See [http://LabRPS.sourceforge.net/contributing/index.html here] for why we can do this and why we're working on LabRPS. 
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.
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.



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