How to build vvvP

Here are instructions for building VVV in Windows, Linux and OS X. Feel free to contact me if you have problems.

Windows

First you need to install the wxWidgets library. You can download the source code from www.wxwidgets.org. vvvP uses version 3.0 or older. The program cannot be built with version 2.8.x.
Download the Windows installer and install the library source code. The "docs\msw\install.txt" file contains instructions about compiling the library. It is probably better to compile wxWidgets as a static library to avoid runtime dependencies.

vvvP uses the following libraries:

  • exiv2 to handle images metadata
  • lcms for color profiles handling
  • boost

You need to download the source code of the libraries, then you need to build exiv2 and lcms. Each library contains information for building.
vvvP does not require to build the boost library: it only uses the header files.

Unpack the vvvP zip source file: you will have a root folder that contains all the downloaded files.

Now it is time to create the build files. vvvP uses CMake so you need to download it.
Create a folder where you will build the program: it can be inside the source code root folder or in another location.
Run CMake (cmake-gui) to show the user interface. Fill the first two text boxes: 

  • In Where is the source code: select the root folder of the downloaded source code.
  • In Where to build the binaries: select the folder that you created to build the program.

Press the Configure button and chose your compiler from the list. CMake will work for some time, then you will see a list of name/value pairs colored in red. You need to set some of those values:

  • Set wxWidgets_CONFIGURATION to mswu
  • Set wsWidgets_ROOT_DIR to the path of your wxWidgets library. For example E:/wxWidgets-2.9.4
  • Set wxWidgets_LIB_DIR to the path of the libraries. For example E:/wxWidgets-2.9.4/lib/vc_lib
  • Select the wxWidgets_USE_REL_AND_DBG checkbox so you will create both a debug and release configuration.
  • Do not care about wxWidgets_wxrc_EXECUTABLE: vvvP does not use the setting.
  • Set EXIV2_INCLUDE_PATH to the folder containing the exiv2 include files. For example E:/C_Prg/exiv2-svn/msvc/include. The CMake script determines the location of the library files from this setting, based on the standard folders layout.
  • Set Boost_INCLUDE_DIR to the root folder of the Boost library. For example E:/boost_1_37.
  • Set LCMS_INCLUDE_PATH to the folder containing the lcms include files. For example E:/C_Prg/lcms2-2.1/include.
  • Set LCMS_PATH_DEBUG to the folder containing the lcms debug libraries. For example E:/C_Prg/lcms2-2.1/Projects/VC2008/debug/lcms2_static.lib.
  • Set LCMS_PATH_RELEASE to the folder containing the lcms release libraries. For example E:/C_Prg/lcms2-2.1/Projects/VC2008/release/lcms2_static.lib.

Click Configure again: you should not see red lines any more (if you see red lines correct the wrong values and configure again).

Press the Generate button.

CMake has created the build files (for example a Visual Studio solution) in the build folder. You can now open that files with your development system and build the program.

Now that you have built vvvP, you need to run it. vvvP uses the Firebird relational database (www.firebirdsql.org) to handle catalogs. You can install the full server or use the embedded version.

  • If you are going to develop VVV it is simpler to install the full server. Choose the superserver (not classic) version 2.0.x. After installation (a very simple task) VVV will be able to handle catalogs.
  • If you prefer not to install the full server you can use the embedded version which ships with the VVV executable. The VVV setup copies vvv.exe and many other files in the installation folder. Simply copy all those files (and subfolders) to the folder where the compiler will save and execute the compiled program. This can be tricky so I recommend installing the full server.

Linux

Build wxWidgets 

First you need to install the wxWidgets library. You can download the source code from www.wxwidgets.org. vvvP uses version 2.9.3 or older. The program cannot be built with version 2.8.x.
You need to download the wxGTK source code and compile it. Expand the archive in a folder and read  install-gtk.txt that contains compilation instructions.

Create one folder in which you will build the library. In that folder you will execute the configure script.
I configure with --disable-shared to statically link wxWidgets and reduce dependencies. 

Configure will run and print a summary of the configuration: depending on your system it will use wxWidgets' version of many libraries or the one that is already installed. Using wxWidgets' own version of the libraries will reduce dependencies too.
For example you can run configure with --with-expat=builtin to force configure to use the wxWidgets' version of expat instead of the one already installed in your computer. Similar switches are available for other libraries too. 

After building the library with make you do not need to install it, unless you prefer to do it.

Build the other libraries

vvvP uses the following libraries:

  • exiv2 to handle images metadata
  • lcms for color profiles handling
  • boost

You need to download the source code of the libraries, then you need to build exiv2 and lcms. Each library contains information for building.
vvvP does not require to build the boost library: it only uses the header files.

Get Firebird

vvvP uses the Firebird database to handle catalogs so it must be linked with the libfbembed.so file. VVV uses Firebird as an embedded database manager, so there is no need to install it. More info here.
In order to build vvvP you need to prepare a folder containing the Firebird files as described in the link above. Just exclude "vvvP" and "vvvp-start.sh" that will be added at a second time.

You can obtain the Firebird files in different ways:

  • Use the files contained in the vvvP precompiled binary.
  • Download the Firebird package for your Linux distribution. I build vvvP with Firebird 2.0.x. Later versions should work but I have not tested them.
  • Build Firebird from sources, it is not difficult. Download version 2.0.x source code and follow these instructions.

If you only want to develop vvvP and you do not want to distribute the compiled program you can simply install the server using the available package. Then link with the installed libfbembed.so file. You can avoid specifying the folder that contains the Firebird runtime (more on this below) since it is only used to create the binary distribution.

Get CMake

vvvP uses CMake to create the build files, so you need to install it. It is usually available as a package.
You will need al least version 2.6. 

Build vvvP

Now it is finally possible to build vvvP. Create a folder that will contain the build files for the release version. I usually create a "build_release" folder into the vvvP root source code folder, but you can create it everywhere. I you want you can also create another folder for build files of a debug version.

Now start the CMake GUI: you will see the user interface. Fill the first two text boxes:

  • In Where is the source code: select the root folder of the downloaded source code.
  • In Where to build the binaries: select the folder that you created to build the program.

Press the Configure button and chose your build environment from the list. You can chose "makefiles" if you only want to build the program. CMake will work for some time, then you will get an error message and you will see a list of name/value pairs colored in red. The error means that CMake has not been able to find some of the needed software, so you need to set it manually in the list. After setting a value press Configure again: you will probably get another error, and you will need to set a new value by hand and to repeat the procedure until you do not get errors any more.

Here is a list of the variables that must be set:

  • CMAKE_BUILD_TYPE: set to Debug or Release.
  • CMAKE_INSTALL_PREFIX: it is the path to a folder that will contain the installed files, ready to be executed.
  • wxWidgets_CONFIG_EXECUTABLE: it is the path of the wx-config file that matches the VVV build configuration. For example /media/disco2/wxGTK-2.9.4/buildgtk/wx-config.
  • wxWidgets_BUILD_PATH: it is the path of the folder where you have built the wxWidgets library.
  • FB_LIB: it is the path to libfbembed.so, and it will be used by the linker. For example /media/disco2/firebird-2.0.6-embedded-runtime/firebird/libfbembed.so.
  • FB_EMBEDDED_PATH: it is the path to the folder that contains the runtime Firebird files as described above. For example /media/disco2/firebird-2.0.6-embedded-runtime/.
  • Set Boost_INCLUDE_DIR to the root folder of the Boost library. For example /media/disco2/boost_1_38_0/.
  • Set EXIV2_INCLUDE_PATH to the folder containing the exiv2 include files. For example /usr/local/include.
  • Set EXIV2_LIB to the path of the exiv2 library. For example /usr/local/lib/libexiv2.a.
  • Set LCMS_INCLUDE_PATH to the folder containing the lcms include files. For example /media/disco2/lcms2-2.1/installed/include/.
  • Set LCMS_LIB to the path of the lcms library. For example /media/disco2/lcms2-2.1/installed/lib/liblcms2.a.

If some libraries are installed CMake might be able to find some of those paths by itself, otherwise you will have to set them by hand.

Once you do not get errors any more in the configuration stage press the Generate button: CMake will create the needed build files in the build folder.

You can use those files to build vvvP with the tools that you selected.

Once you have successfully built vvvP you can build the INSTALL target to create the binary distribution in the install folder, ready to be executed or distributed.

OS X

Building vvvP under OS X is very similar to building it under Linux, so you can read the Linux section for reference. Below you will find the differences from the Linux procedure.

There is one more CMake variable: CMAKE_OSX_ARCHITECTURES. You can set it to i386.

After generating the build files you can use them to build the vvvP executable.

Once you have successfully built VVV you can build the INSTALL target to create the binary distribution in the install folder, ready to be executed.