File: README_VisualStudio.txt

package info (click to toggle)
molmodel 3.1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,384 kB
  • sloc: cpp: 39,830; perl: 526; ansic: 107; makefile: 41
file content (140 lines) | stat: -rw-r--r-- 4,448 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Instructions for creating a Visual Studio project by hand to run a 
Molmodel example program.
Molmodel 2.2, June 2011

----------------------------------------------------------------------------
NOTE: By far the easiest way to create a Visual Studio project is to use
CMake (www.cmake.org). We have supplied a CMakeLists.txt file here which 
will build a single Visual Studio project containing all the examples.
That works on all platforms also, using whatever build system is appropriate.
----------------------------------------------------------------------------

But, if you insist on building a Visual Studio project by hand, here are
the instructions.



Below we will use $(SimTK_INSTALL_DIR) to mean the SimTK installation 
directory, which is typically %ProgramFiles%\SimTK but can be anything.
(On English systems this will be C:\Program Files\SimTK or 
C:\Program Files (x86)\SimTK for 64 bit platforms.). You
should create a SimTK_INSTALL_DIR environment variable and
set it to the appropriate Simbody installation directory.

You must already have the Simbody and Molmodel binaries installed from 
SimTK.org; go to https://simtk.org/home/simbody, Downloads tab, then
https://simtk.org/home/molmodel, Downloads tab.

To use the Visual Studio solution file provided in this directory proceed 
to step 5)

To create a new Visual Studio project for a Molmodel example from scratch
follow all steps:


1) Create new Visual Studio project based on an example source file:

  * In Visual Studio, select File->New->Project...->Visual C++->Win32->Win32 Console Application

  * Select a name for the new project, select a location, and select "Create new Solution"

  * Click "Next"; select "Console Application" and "Empty project"

  * Drag the desired example .cpp program into the "Source files" folder on the left.


2) Set up include directory

  * Far click the Project name on the left bar, select "Properties"

  * Set the "Configuration:" pulldown to "All Configurations"

  * Under Configuration Properties->C++->General select "Additional Include Directories"

  * Select the "..." button, then the new directory (folder) button

  * Browse to $(SimTK_INSTALL_DIR)/include, and add it to the "Additional Include Directories" section

  * Click "OK"


3) Set up library directories

  * Far click the Project name on the left bar, select "Properties"

  * Set the "Configuration:" pulldown to "All Configurations"

  * Under Configuration Properties->Linker->General select "Additional Library Directories"

  * Select the "..." button, then the new directory (folder) button

  * Add $(SimTK_INSTALL_DIR)/lib to the "Additional Library Directories" section.

  * Click "OK"


4) Set up library names

  * Right click the Project name on the left bar, select "Properties"

  a) Debug versions
     NOTE: Debug libraries are very sensitive to compiler version; if you can't
     use the prebuilt ones follow the Release instructions below unless you 
     have built your own Debug libraries from source.
     CAUTION: You may not be able to use Release libraries with a main 
     program compiled with Debug.

    * Set the "Configuration:" pulldown to "Debug"

    * Under Configuration Properties->Linker->Input select "Additional Dependencies"

    * Select the "..." button
  
    * Add the following library names:
       SimTKmolmodel_d.lib
       SimTKsimbody_d.lib
       SimTKmath_d.lib
       SimTKcommon_d.lib
       SimTKlapack.lib
     Note that there is no "_d" lapack library; that's OK.

  * Click "Apply"

  a) Release versions

    * Set the "Configuration:" pulldown to "Release"

    * Under Configuration Properties->Linker->Input select "Additional Dependencies"

    * Select the "..." button
  
    * Add the following library names:
       SimTKmolmodel.lib
       SimTKsimbody.lib
       SimTKmath.lib
       SimTKcommon.lib
       SimTKlapack.lib

  * Click "Apply"


5) Run the program

* select "Release" configuration in the Visual Studio main toolbar if you 
  want speed; Debug is typically 10X slower.

* Type Ctrl-F5, or click Debug->"Start Without Debugging"

* Your program should run

* Type Ctrl-C in the console (Command Prompt) window to stop the program


6) To run another example program:
  
  * Delete the previous example .cpp file from the "Source Files" folder

  * Drag the new example .cpp file into the "Source Files" folder
  
  * Select "Release" configuration, Ctrl-F5, etc.