source: trunk/documents/UserDoc/UsersGuides/InstallationGuide/html/PCMachines/pcMachines.html @ 1219

Last change on this file since 1219 was 1208, checked in by garnier, 15 years ago

CVS update

File size: 8.0 KB
Line 
1<HTML>
2<HEAD>
3<TITLE>PC Machines</TITLE>
4</HEAD>
5<BODY>
6<TABLE WIDTH="100%"><TR>
7<TD>
8
9
10<A HREF="../index.html">
11<IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></A>
12<A HREF="../UnixMachines/unixMachines.html">
13<IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></A>
14<IMG BORDER="0" SRC="../../../../resources/html/IconsGIF/NextGR.gif" ALT="Next">
15</TD>
16<TD ALIGN="Right">
17<FONT SIZE="-1" COLOR="#238E23">
18<P ALIGN="Right">
19<B>Installation Guide</B><BR>
20</FONT>
21</TD>
22</TR></TABLE>
23<P>
24<BR><BR>
25
26<P ALIGN="Center">
27<FONT SIZE="+4" COLOR="#238E23">
28<B>3. Tips for Installing on Windows</B>
29</FONT>
30<BR><BR>
31
32<HR ALIGN="Center" SIZE="7%">
33<BR><BR>
34
35<!-- ============================================== Section --> 
36<HR>
37<A name="3.1">
38<H2>3.1 Windows with the Cygwin Toolset and Microsoft Visual C++</H2></A>
39
40<P>
41To compile and run Geant4 under Windows systems, some additional information
42and tools are required, although the installation produre is similar to that
43required on a UNIX based system. On Windows, the Cygwin toolset and the
44Microsoft Visual C++ compiler are used.<br>
45Cygwin32 is a UNIX development environment available for Microsoft Windows.
46You can freely obtain Cygwin32 from
47<A target="ext" HREF="http://cygwin.com">Cygwin</a> or
48<A target="ext" HREF="http://x.cygwin.com">Cygwin/X</a>.<br>
49We do not support direct use of Visual Studio; i.e. we do not provide
50Visual Studio workspace (.dsw) or project (.dsp) files, nor we do provide
51makefiles for the <TT>nmake</TT> application of MS Visual C++.
52<P>
53We use several of the tools provided by the Cygwin toolset:
54<UL>
55<LI><TT>make.exe</TT> as a make tool</LI>
56<LI><TT>g++.exe</TT> as a tool to analyse source file dependencies and create
57    dependency (<TT>.d</TT>) files</LI>
58<LI>several other unix tools like <TT>cp</TT>, <TT>mv</TT>, <TT>rm</TT>,
59    <TT>touch</TT>, etc.</LI>
60</UL>
61At the installation of the Cygwin toolset it is therefore required to
62explicitely select some packages (i.e. <i>gmake</i>, <i>gcc</i>, <i>binutils</i> and
63<i>tcsh</i> from the "devel" category) in addition to those which are part of
64the default installation.<BR>
65For more details on the toolset, please see the documentation available on the
66<a target="ext" href="http://cygwin.com">Cygwin pages</a>. The User's Guide has
67quick start guides and help with setting up Cygwin with <TT>setup.exe</TT>.<BR>
68Links to some installation tips for the Cygwin toolset and also "step by step"
69installation guides can be found in
70<A HREF="../../../ForApplicationDeveloper/html/Appendix/buildFile.html">section 10.6</A>
71of the Application Developers Guide.
72<P>
73The usage of Cygwin32 for the build environment results in a build procedure
74similar to that on a UNIX system.  The documentation in the User's Guide for
75Application Developers, Section 10.5, is largely applicable in this case.
76<P>
77The following steps are required to install geant4:
78<OL>
79  <LI> Install Cygwin (see also notes above):<BR>
80    We do not depend on any specific feature of the version of Cygwin,
81    so newer versions (or slightly older) are expected to work.</LI>
82  <LI> Set the environment for MS Visual C++, i.e. set the paths to libraries,
83    include files, and executables for MS Visual C++. This can be done by
84    modifying the start-up batch file <TT>cygwin.bat</TT> of Cygwin32 to
85    include all the MSDOS commands found in the file
86    <TT>vcvars32.bat</TT> provided in MS Visual C++ (in the VC++ .NET compiler
87    installation directory, and usually located inside the
88    <TT>Common7/Tools</TT> directory). This modification should be done after
89    the installation of the Cygwin toolset, so that the environment gets
90    properly set at the time of the invocation of the shell.</LI>
91  <LI> Unpack the source code into a directory of your choice.</LI>
92  <LI> Start the <TT>Cygwin</TT> shell from the start menu.</LI>
93  <LI> At this point you're ready to install Geant4. If manual installation
94    is chosen, you must set the necessary environment variables. There are
95    various ways to do so; for example through a command file for the Cygwin
96    bash shell.  This command file could be named <TT>geant4-setup.sh</TT>,
97    and you must execute it with<BR>
98    <PRE>
99        . geant4-setup.sh
100    </PRE>
101    including the leading dot and blank space. You could also have this as
102    your <TT>.bashrc</TT> file. The commands in the command file should be:
103    <PRE>
104        # Set G4SYSTEM
105        export G4SYSTEM=WIN32-VC
106        #
107        # Set Path to CLHEP
108        export CLHEP_BASE_DIR=C:/usr/local
109        #
110        # --- Other optional settings
111        #Turn on verbose to show command used for compilation
112        #export CPPVERBOSE=1
113        #
114    </PRE>
115    Note, in the example above, CLHEP was installed in <TT>C:/usr/local</TT>,
116    therefore <TT>include/CLHEP</TT> and <TT>lib/CLHEP.lib</TT> must be
117    included therein.</LI>
118  <LI> Once the environment is correctly set, the libraries are built using
119       make from the <TT>geant4/source</TT> directory typing <TT>make</TT> 
120       from the <tt>Cygwin bash</TT> shell prompt.</LI>
121</OL>
122Examples can be built in the same way as the libraries from
123examples/novice/N01, for instance:
124type <TT>make</TT> from the shell prompt.<BR>
125Note that, depending on which external software is used, there may be
126some warnings in linking; e.g., we get
127<TT>"unrecognized source file type -file.o-,object file assumed"</TT>, or
128warnings of conflictings libraries.  This often seems to be caused by an
129external library compiled for a different run time environment.
130
131<P> 
132The binary of the example is placed by default into the
133<TT>geant4/bin/WIN32-VC</TT> directory. You may run it either from this
134directory or from the <TT>examples/novice/N01</TT> directory; sample input
135and output files are placed in each of the <TT>examples/novice</TT>
136directories. Some of the examples will need to read data files, and
137the place has to be given in environment variables again similar to the
138following example:
139<PRE>
140        #
141        # Environment variables needed to find geant4 data files:
142        #
143        # Data for neutron scattering processes,
144        #    distributed in a separate tar file, then placed under data
145        export NeutronHPCrossSections=c:/usr/local/geant4/data/G4NDL
146        #
147        # Nuclear Photon evaporation data,
148        #    distributed with the source files under data
149        export G4LEVELGAMMADATA=c:/usr/local/geant4/data/PhotonEvaporation
150        #
151        # Data for radiative decay hadronic processes under data,
152        #    distributed in a separate tar file
153        export G4RADIOACTIVEDATA=c:/usr/local/geant4/data/RadiativeDecay
154        #
155        # Data for low energy electromagnetic processes,
156        #    distributed in a separate tar file, then placed under data
157        export G4LEDATA=c:/usr/local/geant4/data/G4EMLOW
158        #
159</PRE>
160<P>
161All compiler and linker options are set in <TT>config/sys/WIN32-VC.gmk</TT>.
162If you require options different from our choice, you can modify this file.
163
164<!-- ============================================== Section --> 
165<HR>
166<A name="3.2">
167<H2>3.2 Building Kernel Libraries DLLs</H2></A>
168<p>
169DLLs (Dynamic Link Libraries) on Windows are supported for .NET VC++ and can
170be built for the <TT>compound</TT> kernel libraries of Geant4 (see the
171<a href="../UnixMachines/unixMachines.html">Installation Procedure</a> of this
172Guide for a dissertation on <TT>global/compound</TT> libraries).
173<P>
174The libraries can be built either manually, issuing the command:
175<PRE>
176        make dll
177</PRE>
178from the directory <TT>$G4INSTALL/source</TT> or by specifying it through
179the <TT>Configure</TT> script used for the installation.<BR>
180Then, to build any application making use of the installed DLLs, the
181environment variable <TT>G4LIB_USE_DLL</TT> must be set in the environment.<BR>
182Once the application is built, it is required to specify to the system the path
183where the DLLs are installed. To do so, add the absolute path (in Cygwin format)
184of the DLLs installation directory to the <TT>PATH</TT> variable; for example:
185<PRE>
186        export PATH=$PATH:/usr/local/geant4/lib/$G4SYSTEM
187</PRE>
188You may then be able to run successfully your application.
189</P>
190
191<HR>
192<A HREF="../../../../Authors/html/subjectsToAuthors.html">
193<I>About the authors</I></A>
194
195</BODY>
196</HTML>
197
Note: See TracBrowser for help on using the repository browser.