Saturday, May 16, 2015

How to build the open source Jedox Palo Olap client libraries for .NET

Jedox recently published the source code of the latest version of its Olap server. I am taking this opportunity to follow up my last post on how to build the Palo server. Today I am concentrating on the Palo .NET client, again I am describing the steps that worked for me to build the x64 version.

A. Preparation
  • You need:
    • Visual Studio, in my case I am using Visual Studio 2013, Professional
    • .NET Framework 4.0 or higher, in my case I am using version 4.5
 To build the Jedox Palo .NET client you need the following open source libraries:
  • Boost
  • ICU
  • OpenSSL
Please read my post about how to build the Palo server if you want more information on where to download these libraries. I am using the same files for the client as I have used for the server.

The root folder of the client source code is molap\client_libraries\5.1, so this is the location where we start from. If you are using .NET framework 4.5 you have to apply a little workaround to successfully load the Visual Studio solution:
  1. Go to the sub folder Jedox.Palo.Comm
  2. Within this folder there is a file called Jedox.Palo.Comm.vcxproj
  3. Open this file in your favourite text editor
  4. Change the value for TargetFrameworkVersion from v4.0 to v4.5
  5. Delete the node <TargetFrameworkProfile>Client</TargetFrameworkProfile>. In .NET framework 4.5 the client profile doesn't exist anymore
  6. Save and close the file
  7. Double-click palolibs.sln. If you are receiving a warning message that the right target framework is not installed choose the option to upgrade the Visual Studio projects.
  8. The Visual Studio solution should now load successfully

B. Build Visual Studio projects
  1. Go to Build, Configuration Manager and select Release, x64
  2. Open the propoerties of the Jedox.Palo.Comm project
    • Select Release configuration, platform x64
    • Go to Configuration Properties, C/C++, General, Additional Include Directories
    • Add the missing include path for Boost
    • You should end up with a configuration like this:
     
  3. Open the properties of the JedoxXIHelper project
    • Select Release configuration, platform x64
    • Go to Configuration Properties, C/C++, General, Additional Include Directories
    • Add the missing include path for Boost
    • You should end up with a configuration like this:
     
    • Next go to Linker, General, Additional Library Directories
    • Add the correct path to Boost
    • You should end up with a configuration like this:
     
  4. Open the properties of the libpalo_ng project
    • Select Release configuration, platform x64
    • Go to Configuration Properties, C/C++, General, Additional Include Directories
    • Add the correct include path for ICU, Boost and OpenSSL
    • You should end up with a configuration like this:
      • Next go to Linker, General, Additional Library Directories
      • Delete all the existing entries and add the correct path values for the library folders
      • You should end up with a configuration like this:
        • Next go to Linker, Input, Additional Dependencies
        • Rename the following references:
          • Rename libeay32.lib to libeay32MD.lib
          • Rename ssleay32.lib to ssleay32MD.lib
        • You should end up with a configuration like this:
           
      • Open the properties of the libpalo2 project
        • Select Release configuration, platform x64
        • Do the same configuration as for the Jedox.Palo.Comm project described in step 2 (just add Boost as an additional include directory to the compiler settings)
      Now we are finished with setting up dependencies which is most of the work but still we are not at the end. We also have to replace a codeline:
      • Open the file connection.cpp in the Jedox.Palo.Comm project
      • Go to line 2337 and replace the following code:
        m_data.coords[i] = std::make_pair<bool, std::vector<std::string> >(data.Coords[i].BoolVal, elems);
        with
        m_data.coords[i] = std::make_pair(!!data.Coords[i].BoolVal, elems);
      If you don't replace the code line you may get a compilation error. I think this is because I am using .NET framework 4.5, but I am not sure.

      Finally we have to create an snk file for building the .NET client. Please ask Google on how to do this. After you have created the file place it into the root folder of the Jedox.Palo.Comm project. The name of the file has to be jedox.palo.comm.snk.
      Now we are finished with the configuration and we are ready to build the solution. Right-click the Jedox.Palo.Comm project and select Build.

      C. Amendments
      As I already mentioned in my last post about building the server I don't know if there is an easier way to configure the projects. At the end I think you get usable client libraries. I have not experienced any unexpected behaviour in comparison to the pre-built versions shipped with Jedox Base so far. If you have any comments or concerns please let me know.

      3 comments:

      1. This comment has been removed by the author.

        ReplyDelete
      2. is it possible to share the built project? If there is no law transgression? thanks in advance.

        ReplyDelete
      3. Hi,
        Can you do a tutorial for building palo for excel?
        I guess the code is :
        https://svn.code.sf.net/p/palo/code/_attic_/3.X-4.X/palo_for_excel/3.X/

        ReplyDelete