Project

General

Profile

Actions

Notes on developing with Visual Studio and Bilder

Visual Studio has some nice features for development work, but bilder does not create solution files at this time. So, for development work, I create separate par-vs and ser-vs directories in the builds/vorpal directory to create Visual Studio files. Then, I run cmake with the same cmake line used for ser/par, but with the GENERATOR changed to the appropriate Visual Studio generator for the system (VS9/10 32/64 bit).

These solution files build fine, but the real advantage of the IDE is using the debugger. To get the debugger to work in Visual Studio, some changes need to be made to the solution files after the fact. First, select all of the vorpal code directories (vpbase, vpstd, etc. but not vorpal) and in the General section of the C/C++ section in the properties dialog, change 'Debug Information Format' to 'Program Database (/Zi)'. Then in the Optimization section, change 'Optimization' to 'Disabled (/Od)' and 'Inline Function Expansion' to 'Default'. Hit 'OK'. Now, select the vorpal target and any other targets you need to link (for instance, the unit test targets) and open the properties dialog. Make the same changes made to the code directories, then open the Linker section and select the Debugging section. Change 'Generate Debug Info' to 'Yes (/DEBUG)'. Then hit OK. You can now build and use the debugger for serial code.

For MPI code, there is one more step, which requires a Pro edition of Visual Studio. In the executable (usually vorpal) properties, select the top level Debugging section under Configuration Properties. Then select the MPI Cluster Debugger. Now, set 'MPIRun Command' to the full path to mpiexec.exe (do not forget the .exe). Set 'MPIRun Arguments' to whatever arguments you want (I have -np 4). Set 'MPIRun Working Directory' to the full path to the location of your input file. Set 'Application Command' to the full path to the executable after it is built (e.g. C:\projects\vpall-trunk\builds\vorpal\par-debug\vorpal\Release\vorpal.exe). Set 'Application Arguments' to your vorpal arguments. Set 'MPIShim Location' to the full path to MPIShim, which should be in your Visual Studio distribution (hypothesis: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\mpishim.exe). Leave the other settings alone and hit ok. You can now debug the vorpal target by running it specifically, or you can right-click on the vorpal target and set it to be the start up project so that you can just hit F5 to start the debugger.

Updated by Redmine Admin almost 9 years ago · 1 revisions