Build openCONFIGURATOR on Windows 7

I’m experimenting with RPi2 and openPOWERLINK and after having an issue and posting on the openPOWERLINK discussion forum, the openPOWERLINK team replied suggesting that I try to increase the cycle time and poll response time using openCONFIGURATOR. So I downloaded the openCONFIGURATOR Windows build from their SourceForge site. But I wasn’t able to use it, my AVG Anti Virus found a virus in it. Probably a false positive but that stimulated me to get the source code and compile it on my Windows 7.

Anyway I ended up installing just the Eclipse (Mars 4.5.1) openCONFIGURATOR plugin that comes with a pre-compiled library, so in fact I didn’t need to compile it, but I leave here the necessary information, in case someone needs it.

To get the source code I installed Git for Windows from here.

And then used it to get the source code from Git (git://git.code.sf.net/p/openconf/openconfigurator2) into my working folder (C:\Users\pedro\dev-VS2008\openconfigurator2):

git-get-source-code

I have a Microsoft Visual Studio 2008 so I opened up a Visual Studio 2008 Command Prompt (in All Programs / Microsoft Visual Studio 2008 / Visual Studio Tools) and I gave the following commands:

cd C:\Users\pedro\dev-VS2012\openconfigurator2\build\windows
cmake -G”NMake Makefiles” -DCMAKE_BUILD_TYPE=Release ..\..

But I have an error:

CMake Error at CMakeLists.txt:95 (MESSAGE):
Boost libraries not found.  Please add BOOST_ROOT environment variable to system.

The Boost library is missing on my Windows system… So lets get it, go to the Boost web site, download the latest source code version, compile and install it. The default compile parameters built the toolset 12.0 and the openCONFIGURATOR is looking for the -vc90-mt files so I had to specify the toolset in the last build command below. I also need to ask for a complete build type, this way I have all versions of the Boost library, it takes more space in your hard drive but you are sure you’ll have it:

cd C:\Users\pedro\dev-VS2008\boost_1_59_0
bootstrap.bat
.\b2 –toolset=msvc-9.0 –build-type=complete

You should have at the end this message:

The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
C:\Users\pedro\dev-VS2008\boost_1_59_0
The following directory should be added to linker library paths:
C:\Users\pedro\dev-VS2008\boost_1_59_0\stage\lib

So lets open the Windows Advanced System Settings:

windows-advanced-system-settings

Open the Environment Variables and add the BOOST_ROOT environment variable:

add-boost-root

Also add the BOOST_LIBRARYDIR environment variable:

add-boost-librarydir

Now you have to close and reopen the Visual Studio 2008 Command Prompt so that it takes into account the new environment variables.

Now lets try again to build the openCONFIGURATOR:

cd <openCONFIGURATOR_dir>\build\windows
cmake -G”NMake Makefiles” -DCMAKE_BUILD_TYPE=Release ..\..

This time it found the boost libraries! So lets continue:

nmake

Oups… a compile error in ComplexDataType.h file:

fatal error C1083: Cannot open include file: ‘cstdint’

Looking around on internet I find many complaints about the bad C language support of the MS compiler. I also find here that <cstdint> is supported from MSVC2012.

I happen to also have a free version of VS 2012 so lets try it out. Close the Visual Studio 2008 Command Prompt and open the Visual Studio 2012 Command Prompt, then to start all over again delete all files inside <openCONFIGURATOR_dir>\build\windows folder. Now the compile commands again, from the <openCONFIGURATOR_dir>\build\windows folder. To be sure I have a proper source code tree I deleted the C:\Users\pedro\dev-VS2008\openconfigurator2 folder and used Git to clone the source code into C:\Users\pedro\dev-VS2012\openconfigurator2 folder (yes, better to be organized):

cd C:\Users\pedro\dev-VS2012\openconfigurator2
cmake -G”NMake Makefiles” -DCMAKE_BUILD_TYPE=Release ..\..
nmake

And it works! Notice that this time openCONFIGURATOR looked for the -vc120-mt version of the Boost library. If you didn’t compile Boost in this toolset type then you’ll have to go back and do it.

[100%] Built target openconfigurator_core_lib

As I said on the top of this article, I’m not going to use this as I’m using instead the Eclipse plugin, but I learned a couple of things while trying to compile this library on Windows :-)

 

Advertisements

Author: pedro_nf

Independent contractor on IT solutions and automation

One thought on “Build openCONFIGURATOR on Windows 7”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s