CIBC:Seg3D2:Building Releases

From SCIRun Documentation Wiki
Jump to: navigation, search

Building Seg3D 2 Releases

Initial Steps

  • If incrementing the major and/or minor version numbers, or a new author needs to be added, get a new splash screen from Nathan Galli with up-to-date information (author list, version number etc.). The copyright year should also be kept up-to-date.
  • Create a new branch. Previous Seg3D 2 branches can be explored in the Subversion repository browser.

Release Branch

  • Update splash screen images
    • Splash screen images are found in src/Resources/Images and are referenced in src/Interface/Application/SplashScreen.ui and src/Resources/QtResources.qrc.
  • Update release notes in src/ReleaseNotes.txt
  • Update release numbers in src/CMakeLists.txt

Seg3D building distribution instructions

We normally build the following set of binaries and source distributions

  • Win32
  • Win64
  • Mac OS X 10.5 and up on x64
  • Source as a windows zip file
  • Source as a *nix tgz file (gzip compression format)

Windows

Build Machine

Use a Windows 64-bit machine with Visual Studio 2008 for building Windows releases. NSIS, and CMake 2.8.5 or greater should be installed.

Difficulties

Microsoft runtime redistributable libraries and ensuring that everything is build against the right versions and that libraries are included in the right order.

Besides Visual Studio you need to install Qt. We normally build Qt from source to ensure it is built against the same runtime redistributable libraries (deployed as private side-by-side assemblies) are shipped with the Visual Studio SDK. These two MSDN articles: Redistributing Visual C++ Files and Choosing a Deployment Method contain very useful information about Visual Studio redistributable libraries.

Installing Qt on your system and building from scratch

1. Download the open source version. Seg3D2 version 2.1.2 was built against Qt 4.7.4, and that is the current version used by Seg3D developers.

2. Unzip the contents of the zip file and store it in a directory and update the file mkspecs/win32-msvc2008/qmake.conf (or if building with 2010 the corresponding one).

Change the line (without it Win64 XP (the first 64bit version) will not launch Seg3D):

 QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib

to

 QMAKE_LIBS_CORE = ole32.lib uuid.lib ws2_32.lib advapi32.lib shell32.lib user32.lib kernel32.lib

3. Launch the Visual Studio Command Prompt in 64-bit or 32-bit mode depending on which version to build. This should be available in the start menu under Visual Studio.

4. Create a directory called C:\Qt\4.7.4-32bit and change into that directory (for 64bit build of course name the directory C:\Qt\4.7.4-64bit, or where ever you want the installed version, it will be hard coded into qmake) and copy all the source files into that directory.

5. Now run configure.exe from this directory with the following parameters (if building with Visual Studio 2010, change the -plaform flag accordingly).

 configure.exe -platform win32-msvc2008 -no-gif -qt-libpng -qt-zlib -no-libmng -qt-libtiff -qt-libjpeg -no-openssl -no-phonon -no-qt3support -D _BIND_TO_CURRENT_VCLIBS_VERSION=1

It will ask a few question on license before configuring.

6. Now run nmake and compile all of Qt; this is a long build.

7. Repeat the process for the 64-bit version, but reset the path so it will find the other qmake and use the 64bit version of the command prompt.


Building Seg3D for 32-bit and 64-bit

1. Most likely both 64-bit and 32-bit Qt have been installed on the same system. Hence before running cmake one needs to make sure that the right qmake is found. Normally we set this up in the System Path: In the Control Panel select System and go to advanced settings and click on environment variables. Edit the path so that C:\Qt\4.7.4-32bit is in the path for the 32 bit version and C:\Qt\4.7.4-64bit is in the path for a 64bit version.

2. Check on the prompt (cmd) whether the right version is found: type qmake --version. This will tell which version is run. If it is the right one proceed.

3. Download Seg3D code and launch the visual CMake interface. It will ask where the source code (src) is and where the binary code needs to be installed (bin). The main Seg3D directory has both a src and a bin directory. When setting up the project. You will be prompted for which version of visual studio to use. Pick either the 64bit or 32bit version depending on which one you are building.

4. Run both configure and generate. If Qt was setup correctly everything should proceed normally.

5. Open the project file in Visual studio and build the package target. Ensure that you are building in release mode and not in debug mode (package will not work properly in debug mode as the debug SxS are not copied)

A complete binary will appear in the bin directory. It is an exe file that includes the installers.

Mac OS X

Build Machine

Use a Mac OS X Snow Leopard machine that fully supports the x84_64 architecture for creating Mac builds and source archives.


Difficulties

Getting Xcode to build against the right SDK.

The OS X binary installers are built with the following (advanced) settings. If using ccmake or the cmake gui, advanced view mode should be on. CMAKE_OSX_ARCHITECTURES: x86_64 CMAKE_OSX_DEPLOYMENT_TARGET: 10.5 CMAKE_OSX_SYSROOT: /Developer/SDKs/MacOSX10.5.sdk/

(Also documented on this page).

Installing QT

1. We have used precompiled Qt packages from Nokia. Go to the Nokia site and download the Qt 4.7.4 installer.

2. Install the package and Qt should be ready to go

Configuring Seg3D for CMake

The build script build.sh, which is available in Seg3D 2.1.3 or greater, will configure a Seg3D build as described below. The note about using Qt 4.7.4 still applies. Use the --set-osx-version-min flag to set the target SDK to the minimum SDK version we support (OS X 10.5 currently). Use the --release flag to explicitly set up a release build. Use the --xcode-build flag to configure and run an Xcode build.

Full build instructions

1. Download/svn check out the source. Go to the bin directory and type "ccmake ../src -G Xcode"

2. This will open cmake and change the following options to build a OS X 10.5 compatible version (Does not work with Xcode 4.x as Apple no longer supports OSX 10.5). Press 't' to toggle to advanced mode set CMAKE_OSX_ARCHITECTURES to 10.5 and set CMAKE_OSX_SYSROOT to /Developer/SDKs/MacOSX10.5.sdk

NOTE: We have not checked whether Nokia is still building against 10.5.sdk. We know version 4.7.4 works fine on OS X 10.5. If they use the latest compilers support may have dropped and you will have to build against 4.7.4, or build Qt from source.

3. Configure everything by pressing 'c' and then 'g'. CMake will complain about ITK using experimental code, however that one we know works better than the default code, which is broken up to the latest ITK release. When a warning is show just press ok and continue. It's an ITK problem.

4. Open the project file in Xcode and build the package target and a new dmg will appear in the binary directory.

Source distributions

Generally source distributions should be built on a Mac OS X workstation as it supports both compression formats:

1. Check out the code using svn export so the svn directories are not included. Generally the repository url will be a release branch.

 svn export [repository url] Seg3D2-<release version number>-code

2. Create a Windows compatible zip file using the command line zip tool:

 zip -r Seg3D2-<release version number>-code.zip Seg3D2-<release version number>-code

3. Create a gzipped tar archive file:

 tar czvf  Seg3D2-<release version number>-code.tgz Seg3D2-<release version number>-code


If the full (major.minor.patch) release version number is 2.1.4, and the repository url of the release branch is https://code.sci.utah.edu/svn/seg3d2/branches/2.1, then the source distribution build steps will be:

 svn export https://code.sci.utah.edu/svn/seg3d2/branches/2.1 Seg3D2-2.1.4-code
 zip -r Seg3D2-2.1.4-code.zip Seg3D2-2.1.4-code
 tar czvf Seg3D2-2.1.4-code.tgz Seg3D2-2.1.4-code