From GridLAB-D Wiki
Jump to: navigation, search

The developer solution file gridlabd.sln that comes with the source code is in the VS2005 folder. After you open the solution in Visual Studio you can immediately do the first build, which takes several minutes to complete.

Afterward you first build, you can unload the cppunit and xerces-c projects because they will not need to be built again.

Generally, if you are debugging a module, you will need to specify the debug executable. If you are running on a system that has both a release and your development version, you must also add the following to your debugger environment. The configuration in Table 1 assume that the file are running is in the project test folder and all the output should go there too.

Table 1 - VS2005 module debugging configuration properties
Command $(SolutionDir)win32/debug/gridlabd.exe'
Command Argument [options] your_file.glm
Working Directory $(ProjectDir)test
Attach No
Debugger Type Auto
Environment GLPATH=$(SolutionDir)../core/rt
Merge Environment Yes
SQL Debugging No

Configuration options

It may be necessary to include the follow code in your GLM file to get GridLAB-D to use MSVC.

// $Id$
// Copyright (C) 2008 Battelle Memorial Institute
// Configuration to use when debugging GLM files with MSVC

// set this to your MSVC installation folder
#setenv MSVC=C:/Program Files/Microsoft Visual Studio 8

// enable use of MSVC instead of GNUtools
#define use_msvc=1 

// this disables automatic rebuild suppression of runtime classes 
// compilation based on modification time
#set force_compile=1

// customize to your local setup
#setenv path=${MSVC}/Common7/IDE;${MSVC}/VC/bin
#setenv include=${MSVC}/VC/include
#setenv lib=${SystemRoot}/system32;${MSVC}/VC/lib;${MSVC}/VC/PlatformSDK/Lib

This code may be found in the rt/debugger.conf file and included using the GLM directive

#include "rt/debugger.conf"

on any Windows platform. It is possible that the contents of debugger.conf need to be modified to match your system's particulars.