ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Wed, 29 Oct 2014 10:51:03 -0500Compiling win_ros hydro on Windows7 64bit with VS2013 x64https://answers.ros.org/question/196227/compiling-win_ros-hydro-on-windows7-64bit-with-vs2013-x64/Again, not really a question but a step-by-step rundown. However, if anyone spots inconsistencies or can suggest improvements, i'm all ears.
<ol>
<li>Install Python and winros packages
I installed 64 bit version of Python2.7.5 and then went down the list of packages given here:<br>
<a href="http://www.ros.org/wiki/win_python_build_tools/hydro"> www.ros.org/wiki/win_python_build_tools/hydro</a><br>
and installed 64 bit version where possible. In many of those packages i had to manually specify Python installation directory because it couldn't find it in the registry. The only package i skipped was PySvn but that didn't seem to matter. Extra Python packages i needed to install:
<ol>
<li>“six”: ‘easy_install six’</li>
<li>empy: ‘easy_install empy’</li>
</ol>
</li>
<li>Compile dependencies:
<ol>
<li>tinyxml 2.6.2: <a href="http://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/">http://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/</a><br>
make sure you set /MD(Multi-threaded DLL) flag in C++/Code Generation and also add TIXML_USE_STL to Preprocessor Definitions. There are 4 projects in the solution and 3 of them will fail to compile but all you need is tinyxml project and that’s the one that compiles without errors.</li>
<li>bzip2 1.0.6: <a href="http://www.bzip.org/downloads.html">http://www.bzip.org/downloads.html</a><br>
set the values of Linker:General:Output File to bzip2.dll ( bzip2d.dll for debug version if you wish)
and Linker:Advanced:Import LIbrary to .\Release\bzip2.lib (.\Debug\bzip2d.lib)
</li>
<li>log4cxx 0.10.0. This bugger will give you some trouble but not to worry, here’re some decent instructions on how to wrestle with this project:
<a href="https://blog.lextudio.com/2010/09/how-to-build-log4cxx-in-visual-studio-2010/">https://blog.lextudio.com/2010/09/how-to-build-log4cxx-in-visual-studio-2010/</a><br>
Just make sure you download apr-1.5.1-win32-src.zip and not the old version as it suggests. It works the same for VC2013 but you do need to go into the code and move stuff around. I think i got away with just moving all LOG4CXX_LIST_DEF macros outside of the class declarations and fixing KeySet declarations.</li>
<li>boost 1.47. I wrote a separate post about it <a href="http://answers.ros.org/question/196131/compiling-boost147-on-windows7-64bit-with-vc2013-x64/">http://answers.ros.org/question/196131/compiling-boost147-on-windows7-64bit-with-vc2013-x64/</a><br>
</li>
<li>I found it useful to check the compiled libraries and make sure that they are built with the right compiler and are linked to correct libraries. You can use Dependency Walker to do that. <a href="http://www.dependencywalker.com/">http://www.dependencywalker.com/</a> You want to make sure that you are linking against MSVCP120.DLL and such.</li>
</ol>
</li>
<li>Follow instructions “2.1 Prerequisites” on win_ros page:
<a href="http://wiki.ros.org/win_ros/hydro/Msvc%20Compiled%20SDK">http://wiki.ros.org/win_ros/hydro/Msvc%20Compiled%20SDK</a>
</li>
<li>Since i’m building everything in x64 i’ve made a copy of C:\opt\rosdeps\hydro\x86 and renamed it x64 so that all my dependencies are now in C:\opt\rosdeps\hydro\x64
</li>
<li>Replace all .libs and .dlls in C:\opt\rosdeps\hydro\x64\bin and C:\opt\rosdeps\hydro\x64\lib with the libraries we compiled in the previous steps and add both of these folder to your $PATH
</li>
<li>Modify Boost-debug.cmake in C:\opt\rosdeps\hydro\x64\lib so that the names of boost libraries match those of your newly compiled boost dlls. (Find&Replace works very well here). Ex: change boost_date_time-vc-mt-1_47.dll to boost_date_time-mt.dll
</li>
<li>Following instructions for getting win_ros:<br>
mkdir workspace<br>
cd workspace<br>
winros_init_workspace --track=hydro ws<br>
</li>
<li>
Modify ws\setup.bat for your compiler in my case i changed it to this:<br>
@call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
</li>
<li>winros_init_build --track=hydro<br>
and edit config.cmake to point to the right location of the rosdeps and ros install directory<br>
winros_make<br>
go get a cup of coffee
</li>
<li>Profit!
</li>
</ol>
It would be nice if someone tried doing all this and let me know if something didn't work as expected.Eugene SimineWed, 29 Oct 2014 10:51:03 -0500https://answers.ros.org/question/196227/Compiling boost1.47 on Windows7 64bit with VC2013 x64https://answers.ros.org/question/196131/compiling-boost147-on-windows7-64bit-with-vc2013-x64/I needed to compile boost1.47 in windows for win_ros so i decided to document what i did.
I tried different versions of boost but winros seems to only play nice with this one. If someone manages to compile winros with later version of boost that would be awesome and i’d like to know about it. But since we’re stuck with this boost version we need change a few things for it to compile under VC2013. Out of the box 1.47 doesn’t know about compilers later than VC2010, so we’ll teach it.
<ol>
<li>In "boost_1_47_0\boost\signals\detail\named_slot_map.hpp" and "boost_1_47_0\libs\signals\src\named_slot_map.cpp" change BOOST_WORKAROUND(_MSC_VER, <= 1600) to BOOST_WORKAROUND(_MSC_VER, <= 1900)</li>
<li>Run bootstrap.bat</li>
<li>Now we need to modify some build files. All i did was to get the latest version of boost and copy the parts of of these files that deal with specifying settings for the latest compilers. So in "boost_1_47_0\tools\build\v2\engine\build.bat"
replace
<pre>if NOT "_%VS100COMNTOOLS%_" == "__" (</pre>
with
<pre>
call :Clear_Error
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 14.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 12.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 11.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS100COMNTOOLS%_" == "__" (
</pre>
and later in the same file replace
<pre>:Skip_VC10</pre>
with
<pre>
:Skip_VC10
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc11_" goto Skip_VC11
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC11
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc12_" goto Skip_VC12
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC12
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc14_" goto Skip_VC14
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC14
</pre>
</li>
<li>Now in "boost_1_47_0\tools\build\v2\engine\build.jam" replace
<pre>
## Microsoft Visual C++ 2010
toolset vc10 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
</pre>
with
<pre>
## Microsoft Visual C++ 2010
toolset vc10 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
## Microsoft Visual C++ 2012
toolset vc11 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
## Microsoft Visual C++ 2013
toolset vc12 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
toolset vc14 cl : /Fe /Fe /Fd /Fo : -D
: /nologo
[ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
[ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
-I$(--python-include) -I$(--extra-include)
: kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
</pre>
</li>
<li>Last touch. We need to change one source file so the the compilation won't throw warnings about unknown compiler. Take a look at "boost\config\compiler\visualc.hpp" in the newer version of boost and incorporate options related to the new compilers.
<li>And now comes the hack. I have VS2010 and VS2013 installed on the same machine and when i tired to compile boost it would grab vc10 compiler instead of vc12 like i wanted. So instead of getting to the bottom of it and doing it the right way i simply renamed my VS2010 folder for the time of the compilation and that seemed to do the trick. If someone knows how to make boost grab the right compiler please let me know. (specifying the compiler in the command line didn't help)</li>
<li>And finally compile boost with this command:<br>
<code>b2 -d+2 --prefix=C:\boost --build-type=complete --build-dir=C:\boost\build --layout=tagged threading=multi variant=release address-model=64 link=shared</code>
</li>
</ol>
Eugene SimineTue, 28 Oct 2014 12:18:29 -0500https://answers.ros.org/question/196131/