Introduction

Generation means starting from a pre-built version of ROOT and creating the full set of .NET wrappers. There are scripts included that should make this, nominally, a one-step process. However there are a few things that make this fragile.

Configuration

  • Windows 7, 64 bit (though ROOT is 32 bit only on Windows)
  • Visual C++ 2010 Pro (Express might work, but I’ve not tested it).
  • ROOT built libraries. These must have been built against VS2010! There are several places to get this:
    • Use the ROOT Builder project, also located here on codeplex, to build a version straight out of SVN.
    • The ROOT team has been working towards automated builds of VS2010 – at some point they will become available on the ROOT download page.
    • Sometimes I generate builds and link them to download pages of this project (along with .NET wrappers).

Generating the Wrappers

  1. Know where the inputs are:
    1. ROOT (probably located in c:\root)
    2. Where you want to store the wrappers when you are done (c:\root\NETWrappers??).
  2. Download the Wrapper and Wrapper Generators modules from the ROOT.NET source code. A zip file of the source code is supplied with in the recent releases, you can just download that.
  3. Start a visual studio command  prompt window
  4. Make sure that root runs correctly in that window (i.e. you should be able to just type “root” and have it pop up).
  5. cd into the Wrapper Generators directory in the source code you’ve downloaded (and unzipped).
  6. Run "DoEverythingAtOnce\BuildROOTWrapers %ROOTSYS% rootWrappers %ROOTSYS%\NETWrappers”
* rootWrappers is a temp subdirectory where the root files can be found.
  1. This takes a while. On a core i7 portable it can take almost an hour!!
  2. When it is done, you can find everything in the Release directory under Wrappers\rootWrappers \release.

Caveats

While I’ve done my best to make this just work, root is a constantly evolving bit of software. Here are some further comments and limitations.

  • The version of ROOT you are building against must math the version you are using to build the wrappers. MS’s C++ STL has changed its interface as it had changed its versions. As a result if the versions don’t match, then subtle errors are introduced.
  • VS 2010 has a different (and better) build system than 2008 for C++. And building this project requires some fairly detailed knowledge of the build system. As a result this tool currently works only with VS2010. This also means you need a version of root built against 2010.
  • ROOT developers sometimes create include files that can’t work from files located in c:\root\include – which means they can’t be compiled. For the most part these are automatically detected and removed from consideration.
  • Due to differences in how DLL’s on Windows and SO’s on Linux work, it is possible to have a header file which has some methods which do not work on Windows. The most comment I’ve seen is inline-access to a static variable. The inline access must be moved to a separate .cxx file. This only causes a problem if you actually try to use the inline routine. The wrapper generator is very greedy – it attempts to access every single method it can. As a result it will often find problems like this that have been around for years (by versions 5.26 and 5.28 all of these had been cleaned up or escaped). if you encounter this, please let the ROOT team know and you can then tell the Wrapper generation to ignore the files by editing WrapperConfigurationInfo::GetListOfBadMethods. That method will give you a quick overview of some of the situations that have had to be explicitly dealt with.

Last edited Dec 22, 2010 at 9:11 AM by gwatts, version 4

Comments

No comments yet.