Compile on MacOS: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
No edit summary
Line 100: Line 100:
#  Change to the directory which the qwtplot3d*.zip locates and type "unzip qwtplot3d*.zip" to extract the files.
#  Change to the directory which the qwtplot3d*.zip locates and type "unzip qwtplot3d*.zip" to extract the files.
#  Change to the directory which the LabRPS*.zip locates and type "unzip LabRPS*.zip" to extract the files.
#  Change to the directory which the LabRPS*.zip locates and type "unzip LabRPS*.zip" to extract the files.
#  Copy both qwt-*.*.* and qwtplot3d folders into <pre>LabRPS_*/3rdparty/</pre>, and change the folder name qwt-*.*.* into qwt
#  Copy both qwt-*.*.* and qwtplot3d folders into {{incode|LabRPS_*/3rdparty/}}, and change the folder name qwt-*.*.* into qwt
#  Change to the newly created directory <pre>LabRPS*/3rdparty/qwt</pre>
#  Change to the newly created directory {{incode|LabRPS*/3rdparty/qwt}}
#  Open qwtconfig.pri with any text editor and add "#" at the beginning of the line "CONFIG += QwtDll" for building static library.
#  Open qwtconfig.pri with any text editor and add "#" at the beginning of the line "CONFIG += QwtDll" for building static library.
#  Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.
#  Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.
#  Type "make". The same option "clean" of make in (7) is still applicable here.
#  Type "make". The same option "clean" of make in (7) is still applicable here.
#  Change to the newly created directory <pre>LabRPS*/3rdparty/qwtplot3d</pre>
#  Change to the newly created directory {{incode|LabRPS*/3rdparty/qwtplot3d}}
#  Open qwtplot3d.pro with any text editor and add a line "CONFIG += staticlib" next to the line "QT += opengl" for building static library.
#  Open qwtplot3d.pro with any text editor and add a line "CONFIG += staticlib" next to the line "QT += opengl" for building static library.
#  Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.
#  Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.

Revision as of 01:06, 25 August 2022

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

Prerequisites

Compiling LabRPS on MacOS 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.

Get the source

In the following instructions, the source and build folders are created side-by-side under

/Users/username/LabRPS

but you can use whatever folders you want.

mkdir ~/LabRPS
cd ~/LabRPS

The following command will clone the LabRPS git repository into a directory called LabRPS-git.

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

Create the build folder.

mkdir ~/LabRPS/build

Building LabRPS

Downloading the requirements:

Please download Qt, GSL, MuParser, Qwt and Qwt3D from their web sites before building:

  1. Qt: ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.4.1.dmg (this is for version 4.4.1, the current one at the time of writing, there may be a newer)
  2. GSL: ftp://ftp.gnu.org/gnu/gsl/ (the current version at the time of writing: 1.11)
  3. muParser: {{{1}}} (the current version at the time of writing: 1.30)
  4. Qwt: {{{1}}} (the current version at the time of writing: 5.1.1)
  5. QwtPlot3D: http://prdownloads.sourceforge.net/qwtplot3d/qwtplot3d-0.2.7.zip?download (the current version at the time of writing: 0.2.7)

(I) Building the OS X binary on one's own platform:

  1. Open the image file and install Qt for Mac.
  2. Open Terminal and change to the directory which the gsl-x.xx.tar.gz locates. For example, type "cd Downloads", if gsl-x.xx.tar.gz locates in the downloads folder of your home directory.
  3. Type " tar -xzf gsl-x.xx.tar.gz" to extract the files
  4. Type "cd gsl-x.xx"
  5. Type "./configure".
  6. Type " sudo make" and enter your password as prompted.
  7. If there is no error occurring, then type "sudo make install" to install GSL. If you regret for the installation, you can type "sudo make uninstall". If there is any error occurs and you want to restart the process, please type "make clean".
  8. Change to the directory which the muparser*.tar.gz locates and type " tar -xzf muparser*.tar.gz" to extract the files.
  9. Type "cd muparser".
  10. Type "./configure --enable-shared=no" because LabRPS requires static library.
  11. Type "make".
  12. Type "sudo make install". The same options of make in (7) are still applicable.
  13. Change to the directory which the qwt*.zip locates and type "unzip qwt*.zip" to extract the files.
  14. Change to the directory which the qwtplot3d*.zip locates and type "unzip qwtplot3d*.zip" to extract the files.
  15. Change to the directory which the LabRPS*.zip locates and type "unzip LabRPS*.zip" to extract the files.
  16. Copy both qwt-*.*.* and qwtplot3d folders into LabRPS_*/3rdparty/, and change the folder name qwt-*.*.* into qwt
  17. Change to the newly created directory LabRPS*/3rdparty/qwt
  18. Open qwtconfig.pri with any text editor and add "#" at the beginning of the line "CONFIG += QwtDll" for building static library.
  19. Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.
  20. Type "make". The same option "clean" of make in (7) is still applicable here.
  21. Change to the newly created directory LabRPS*/3rdparty/qwtplot3d
  22. Open qwtplot3d.pro with any text editor and add a line "CONFIG += staticlib" next to the line "QT += opengl" for building static library.
  23. Type "qmake -spec macx-g++" to create make file for gcc compilier instead of xcode.
  24. Type "make". The same option "clean" of make in (7) is still applicable here.

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