HaukeHeibelDevelopment

Chair for Computer Aided Medical Procedures & Augmented Reality
Lehrstuhl für Informatikanwendungen in der Medizin & Augmented Reality

Development

Pimping the Visual Studio Debug Output

When you want to do proper debugging in Visual Studio and you are using boost's uBlas library or our NuDe library, you might want to copy the following data to the file autoexp.dat in the folder <MS Visual Studio Dir>/Common7/Packages/Debugger.

The file autoexp.dat contains two different section, namely [Visualizer] and [AutoExpand]. It is important that the provided scripts go not to the end of the file but into the section [Visualizer].

Syntax Highlighting: internal error

Compiling Atlas 3.8.2

Notes:

  • Requires a Cygwin installation with g77/gcc
  • This is more or less intended for me, so I do not loose this information
  • You must not put ATLAS into a directory containing whitespaces
  • In my experience compiling with VS.Net does not have any advantages

Directory abbreviations:

<CYG_DIR>.... The Cygwin base installation directory
<VIS_DIR>.... The Visual Studio .Net install directory
<LAP_DIR>.... The LAPACK (not CLAPCKI) source directory
<SRC_DIR>.... The ATLAS source directory
<BLD_DIR>.... The actual build directory of the atlas libraries

Preparing the Visual Studio Compiler:

1. Edit <CYG_DIR>/Cygwin.bat such that it configures the VS.Net environment variables. Syntax Highlighting: internal error

Building ATLAS with full LAPACK (Fortran interace):

1. Start Cygwin, go to <SRC_DIR> and type Syntax Highlighting: internal error

2. Switch back to Windows, copy <LAP_DIR>/make.inc.example to <LAP_DIR>/make.inc and start editing it. The important entries should now look like (conforming to the build parameters ATLAS is going to use): Syntax Highlighting: internal error

3. Go back to Cygwin and build LAPACK Syntax Highlighting: internal error There we go, the lapack lib (lapack_LINUX.a) is readily built.

4. Go back to ATLAS, clean up and perform the actual build Syntax Highlighting: internal error

Compiling Fortran Code into a Library

In the Cygwin shell (bash or whatever you have) go to the diretory containing the Fortran code and type

Syntax Highlighting: internal error

This will create a lot of object files. These object files can now be put together in a static library with the help of lib.exe from VS.Net. So we open the "Visual Studio Command Prompt" and move once more to the directory containing the Fortran code and now also the object files. The library is created by typing

Syntax Highlighting: internal error

That's all...

Links of stupid errors

Qt Convenience Macro

This little macro allows you to add the Qt mocing process as a custom build step to your Qt header file. The script automatically adds the information to all build configurations and creates the .cpp file relative to your header file, i.e. in this case ../src. Assuming your header file is located in include/MyQtHeader.h, the moced file will be located at src/moc_MyQtHeader.h.

To integrate the macro into your Visual Studio hit ALT+F11 in you IDE. This should bring up the Macro IDE. In the macro IDE double-click on MyMacros. You can now modify existing dummy modules or create a new module via MyMacros->Add->AddModule. Be sure that the module's name is equal to QtModule. Now you just need to paste the code below into your module and save it. The final step is to add the missing references to Microsoft.VisualStudio.VCProject and Microsoft.VisualStudio.VCProjectEngine. That's it. You can now close the Macro IDE after saving everything.

Back within your normal VS IDE, create yourself a new toolbar (this is done via the Customize... option from the toolbar context menu). Your new macro can be found in the Commands tab under the category Macros (it might require a restart but I am not sure).

When you execute the macro, it will be applied to the opened file currently being active. No checking against the Q_OBJECT macro is done, so its up to you to check that.

After having built your project once, check the location of your moc_*.cpp file and add it to your project.

Syntax Highlighting: internal error

Dealing with the OpenCV CVS snapshot

OpenCV should compile right away without any project file tweaks. Once you are done, feel free to use the batch script provided on this site to copy all required files to the Janus file server.

Dealing with Boost SVN snapshots

This mini tutorial starts assuming you have the current version SVN snapshot of the Boost libraries checked out to your hard disk. For the remainder of the tutorial I will for sake of simplicity refer to this folder as %BOOST_ROOT%.

Compilation and installation of BJam

The first step of the installation deals with the compilation of BJam which is required in turn to compile and install the Boost libraries. To install BJam change to the directoy %BOOST_ROOT%/tools/src. If you have bad luck you might need to edit build.jam to properly build a multi threaded version of BJam (libc.lib is not supported any more in Visual Studio .Net 2005), i.e. you need to set the proper build flags according to your compiler. In case of the Intel Compiler, the flags /MT and /MTd need to be replaced by /ML and /MLd. Once everything is configure, you simply need to execute the batch file build.bat. The last step is to switch to the directory %BOOST_ROOT%/tools/src/bin.netx86 and copy the bjam.exe just flat into your %BOOST_ROOT%.

Thats was it for getting BJam up and running and we can now safely continue with compiling and installing the actual Boost libraries.

Compilation and installation of the Boost libraries

At first we switch to the directory %BOOST_ROOT% in which the current SVN snapshot is located.

Some of the Boost libraries are not simple template header files but require actual object code to work. We choose to compile the libraries as dynamic libraries which will yield a .lib and a .dll file for each library. Currently (Sept. 2007) we are just using the following set of Boost libraries:

  • Graph
  • IOStreams
  • Program Options
  • RegEx
  • Serialization
  • Signals
  • System
  • Thread
  • Wave

The proper BJam flags that are required to build boost properly are:

Parameter Effect
--with-graph Explicitly build the graph library.
--with-iostreams Explicitly build the iostreams library.
--with-program_options Explicitly build the program options library.
--with-regex Explicitly build the regex library.
--with-serialization Explicitly build the serialization library.
--with-signals Explicitly build the signals library.
--with-system Explicitly build the system library.
--with-thread Explicitly build the thread library.
--with-wave Explicitly build the wave library.
variant=debug/release Force building debug respectively release versions of the libraries.
threading=multi Force to build multi-threaded libraries.
link=shared Force to build dynamic libraries.
stage Copy object and other intermediate files to the directory %BOOST_ROOT%/stage.
install Install the header and library files to c:/boost/.

After the Boost library has been completely build, copy the data from c:/boost/include/boost[version]/boost to //Janus/3rdparty/boost/boost and the data from c:/boost/lib to //Janus/3rdparty/boost/lib.

Grepping for Symbols

Syntax Highlighting: internal error

I Attachment sort Action Size Date Who Comment
camp-boost-bjam.bat manage 0.8 K 24 Sep 2007 - 10:16 HaukeHeibel The batch file with proper BJam parameters for the CAMP library.
camp-opencv.bat manage 0.6 K 24 Sep 2007 - 11:57 HaukeHeibel The batch file for copying all required files to the Janus file server.

Edit | Attach | Refresh | Diffs | More | Revision r1.27 - 20 Oct 2008 - 08:10 - HaukeHeibel

Lehrstuhl für Computer Aided Medical Procedures & Augmented Reality    rss.gif