Building from sources using Visual Studio 2008 - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

To build MDSplus using Visual Studio 2008 you will first need to get the MDSplus source code.

Contents

Download MDSplus sources

The MDSplus source code is maintained on github. If you are interested in building MDSplus from the sources we recommend downloading a tarball, or a zip file from there.

  1. choose 'stable' or 'alpha' - ""note alpha is the active development branch and may contain untested code.""
  2. choose 'zip' or 'tar.gz'
  3. download the sources (choose one of):
    wget https://github.com/MDSplus/mdsplus/archive/alpha.zip
    wget https://github.com/MDSplus/mdsplus/archive/alpha.tar.gz
    wget https://github.com/MDSplus/mdsplus/archive/stable.zip
    wget https://github.com/MDSplus/mdsplus/archive/stable.tar.gz

The MDSplus repository can also be cloned from github using:

git clone https://github.com/MDSplus/mdsplus.git

Building a complete MDSplus installation kit is quite complicated and requires your development system to be configured with many software development kits and third party software such as Microsoft Visual Studio 2008 Professional, a Java SDK, ITT's IDL product, Matlab, a Windows SDK from Microsoft to name a few. If you want to build just some of the individual MDSplus libraries and executables you may be able to do so with just the MDSplus source and Visual Studio 2008.


Software Packages Required to Build MDSplus Installation Kits

Product Needed for building
Visual Studio 2008 Any of the MDSplus libraries, applications or installation kits.
Java JDK Java based applications such as jScope and jTraverser. If building the 64-bit MDSplus kit you will need to install both the 32-bit and 64-bit jdks.
ITT Interactive Data Language (IDL) IDL to MDSplus interfaces.
Windows SDK Signed MDSplus installation kits. This is optional and if not installed the installation kits should still build ok but not be signed.
Matlab The Matlab to MDSplus interfaces.

Environment Variables Needed for Builds

Environment Variable Setting
IDL_DIR Location of IDL installation (i.e. C:\Program Files\itt\idl71)
JDK_DIR Location of 32-bit Java JDK (i.e. C:\Program Files (x86)\Java\jdk1.8.0_21\)
JDK64_DIR Location of 64-bit Java JDK (i.e. C:\Program Files\jdk1.6.0_21\)
MATLAB_DIR Location of Matlab installation (i.e. C:\Program Files\Matlab\r2008a\)
mds_sign_it Command used for signing MDSplus installation kits. For example: "\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /n "Thomas W. Fredian" (See signing kits below.) Do not defined this environment variable if you do not have a signing certificate.

To set environment variables under Windows, click right on 'Computer' or 'My Computer' and choose properties, then click on 'Advanced System Settings', then on the advanced tab click 'Environment Variables'. These can be entered under either 'User Variables' or 'System Variables'. The dialog will look something like:

Image:EnvVars.gif

Building MDSplus

When you have completed the pre-build tasks described above, start the Visual Studio 2008 Visual C++ application. Once Visual Studio is running, pull down the "File" menu and select "Open->Project/Solution..." . This should bring up a file selection dialog box. Browse to the mdsplus directory you containing the MDSplus sources and select the mdsplus.sln file and click on the "Open" button. If you are running Visual Studio 2008 Express Edition you will see a couple warning messages about Solution folders being unsupported. This is because Visual Studio 2008 Express Edition does not provide the features for building windows installation kits. You can still build the programs and dll's however. Dismiss these message boxes by clicking on the "Ok" button.

To build a full 64-bit installation kit you need to build several "configuration" and "platform" combinations. At the top of the Visual Studio 2008 window there should be a pulldown menu to select the "configuration" and the "platform". The configurations have names such as "Release" and "Debug" and the platforms have names such as "Java", "Setup32", "Setup64", "x64" and "x86".

When building a 32-bit installation kit build:

  1. "Release/Java" combination and build that to build the java based applications. Next select the
  2. "Release/x86" combination and build that to build the 32-bit libraries and applications. Then select the
  3. "Release/Setup32" combination and build that to create the MDSplus installation kit.

To build a 64-bit kit build

  1. "Release/x64"
  2. "Release/Setup64

Signing the Kits

The MDSplus Setup32 and Setup64 projects will sign the installation kits if the mds_sign_it environment variable is defined correctly. The Microsoft Windows SDK includes a signtool application that can be used to sign installation kits with a certificate. There are many optional qualifiers which can be used to specify information about the certificate to be used for signing the kits. The easiest solution I have found is to obtain a certificate from a CA which is configured to permit signing and install that into the Internet Explorer certificate database. Then you can just define the mds_sign_it environment variable to be the path to the signtool executable followed by " sign /n the-common-name-of-your-signing-certificate". The MDSplus projects will use this string followed by the file names to be signed to sign the packages.