Developers - KerryL/DataPlotter GitHub Wiki
Prerequisites
DataPlotter depends on these 3rd party libraries:
- wxWidgets (v3.1.0)
- FreeType2 (currently using v2.4.10, anything in the 2.4 series should be OK)
- GLEW (v1.13.0)
Windows
Download from above links and build from source. I used dynamic libraries for Debug configuration and static libraries for the Release configuration. Also, I used static linking (/MT flag) to the MSVC++ runtime libraries, too, which is not the default setting for any of the 3rd part libraries. You'll need to change this when building the libraries, or you can leave the libraries alone and change this within the DataPlotter project. The advantage of static linking is that the users don't need to install MSVC++ redistributable packages (so you can run it off of a thumb drive, for example).
TODO: Add step-by-step instructions
After getting these libraries built, you'll need to define some environment variables. To do this, go to the Property Manager tab (bottom of Solution Explorer, by default), expand the project and a configuration (either one works), then right-click on Microsoft.Cpp.Win32.User and choose Properties. Go to User Macros, click Add Macro, and define the following macros. Be sure to check Set this macro as an environment variable in the build environment before clicking OK for each macro.
- WXWIN, pointing to your root wxWidgets directory
- FREETYPE, pointing to your root FreeType2 directory
- OPENGL, pointing to the location of your OpenGL v3.3+ headers (if not already on your path)
- GLEW, pointing to your GLEW install directory
- LIBPLOT2D, pointing to your LibPlot2D directory
Linux
Beginners
If you're new to Linux development, the following steps will get your system set up to build DataPlotter and it's dependencies.
$ sudo apt-get install git build-essential gnome-devel
Building wxWidgets
With recent versions of Ubuntu, I haven't had much luck with the pre-built packages (or they don't exist), so I always end up building wxWidgets from source. If starting from a fresh install of Ubuntu, the entire process took about 30 minutes on a modest machine. Here are the required steps to accomplish this:
- Install FreeType2, GLEW and OpenGL headers
$ sudo apt-get install libfreetype6 libfreetype6-dev mesa-common-dev libglu1-mesa-dev libglew-dev
-
Download the source tarball here
wxWidgets 3.1.0 is required to support modern OpenGL functionality.
-
Extract the tarball to your location of choice, then build and install the libraries and development files:
$ tar -xjf wxWidgets-3.1.0.tar.bz2
$ cd wxWidgets-3.1.0
$ mkdir gtk-build
$ cd gtk-build
$ ../configure --with-opengl
$ make
$ sudo make install
If you're using wx2.8.x and configure is having trouble finding the Open GL libraries, see this post. The post describes a solution that works for wxWidgets 2.9 and later - for wxWidgets 2.8.12, I found that adding the following line after SEARCH_LIB
is defined in the configure file in the root wxWidgets directory (created when you executed tar -xzf wxWidgets-2.8.12.tar.gz
), which was after line 25062 for 2.8.12:
SEARCH_LIB="${SEARCH_LIB} /usr/lib/x86_64-linux-gnu"
Of course, you'll need to adjust the path if that's not where your Open GL libraries installed to. If you're using an older version of wxWidgets on an older OS, or a newer version on a newer OS, you should have no issues. For me, wxWidgets 2.8.12 worked find (without the above modification) on Ubuntu 12.04, but gave me trouble in 13.10. wxWidgets 3.1.0 worked just find with Ubuntu 13.10.
Mac
Currently not supported - but it might not take much to get it working! If you're interested in porting to Mac, let me know.
Getting the source
Unless you're new to GitHub, you probably know what to do here. It's easy:
$ git clone https://github.com/KerryL/DataPlotter.git
Since DataPlotter requires LibPlot2D, you'll also need to clone and build it:
$ git clone https://github.com/KerryL/LibPlot2D.git
$ cd LibPlot2D
$ make
$ sudo make install
Building
Windows
Building should be self explanatory for anyone familiar with MSVC++. Two configurations are provided - Debug and Release.
Linux
There is a makefile and a makfile.inc included in the repository. These are set up to use the GNU toolchain. Just type make to build and make clean to clean. Compiling and liking should complete without any warnings (unless you're building an older version of wxWidgets with a newer compiler, in which case you might get many warnings about unused typedefs within wx headers). By default, the object files will be put in .obj/ and the binary will be put in bin/. You'll need to move the customFormats.xml file into the same directory as the binary before running.
In order to execute DataPlotter on my system, I had to edit my ~/.bashrc file to include the following:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib