1 #------------------------------------------------------------------------------
3 # \\ / F ield | foam-extend: Open Source CFD
4 # \\ / O peration | Version: 3.2
5 # \\ / A nd | Web: http://www.foam-extend.org
6 # \\/ M anipulation | For copyright notice see file Copyright
7 #------------------------------------------------------------------------------
9 # This file is part of foam-extend.
11 # foam-extend is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by the
13 # Free Software Foundation, either version 3 of the License, or (at your
14 # option) any later version.
16 # foam-extend is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # doc/buildInstructions/Windows/README.txt
28 # Environment setup and build instructions for MinGW-based Windows builds.
31 # Cesare Guardino, Alstom Power Ltd., (2015)
33 #------------------------------------------------------------------------------
38 It is strongly recommended to install all required systems tools and utilities
39 in a directory with no embedded white spaces. You can skip some steps if you
40 already have the correct tools installed on your system.
43 2. INSTRUCTIONS FOR BUILDING ON WINDOWS
44 =======================================
46 1) Download and install 7-Zip (see reference list below). This is necessary to
47 be able to unzip the rest of the required packages mentioned in later steps.
49 2) Download and install wget, CMake, Git, MinGW-w64, ParaView, PExports, Java,
50 Subversion, Python (see reference list below). Note that some components
51 (for example PExports and GMake) may already be available in other packages
52 (such as Strawberry Perl), although you need to be careful of the
55 3) Download and install MSYS (see reference list below). If this is your first
56 use of MSYS, create a file fstab in c/MinGW/msys/1.0/etc with single-line
61 to mount your home directory (this assumes you have installed MSYS to the default
63 From Windows, you will find your home directory under
64 c:/MinGW/msys/1.0/home/<user name>
66 4) Download the foam-extend source code from
68 http://sourceforge.net/projects/openfoam-extend/
72 git clone --branch nextRelease git://git.code.sf.net/p/foam-extend/foam-extend-3.2
74 5) Open a new MSYS shell and chdir to your foam-extend-3.2 source directory.
76 6) Edit the user-modifiable entries in etc/bashrc.mingw to point to the
77 locations where you have installed the required system tools in the first two
78 steps (the first two functions only in bashrc.mingw). The order in which they
79 are added to the PATH (in the add_to_path function) is very important. The
80 PATH is read from left to right, so ensure OpenMPI and MinGW compiler are
81 prepended last to the PATH, so they are found first.
83 7) Source the file edited in the previous step using the command:
85 (notice the dot "." command to source a file). This action sources other
86 files as required, and also performs a check on the versions of the installed
87 system tools. An example output is shown at the end of this file.
89 8) If "mpirun.exe" failed to run due to a missing DLL (eg. msvcr100.dll), you
90 may need to install the Microsoft Visual C++ 2010 Redistributable Package (see
91 reference list below).
93 9) If the version checks were all successful and printed the expected version
94 details, proceed with compiling the code. Run "Allwmake.mingw". This will
95 download and build all required third-party dependencies, build the entire
96 foam-extend code, and also create a stand-alone .zip package.
98 10) After the build has completed, you can run foam in either of two ways:
100 (a). From the MSYS shell. This allows use of the utility programs and shell
101 scripts in the bin directory (such as paraFoam). This is the recommended
102 approach for developers.
104 (b). From a standard Windows CMD.exe command prompt using the created
105 foam-extend-3.2-win-x64.zip stand-alone package. This can be used on any
106 Windows machine without access to MSYS shells or compilers. See the
107 READMEBinaryPackage.txt contained within the package for further details.
110 3. EXTERNAL PACKAGE REFERENCE
111 =============================
114 Version: 9.20 (or above)
115 URL : http://www.7-zip.org/a/7z920-x64.msi
116 For : Extracting .zip and .7z files (can also be used to extract .tar.gz, .tar.bz2 etc.)
119 Version: 3.2.3 (or above)
120 URL : http://www.cmake.org/files/v3.2/cmake-3.2.3-win32-x86.zip
121 For : Required for building metis and parmetis third-party libraries.
125 URL : https://git-scm.com/download/win
126 For : Version control system. Choose "Use Git from the Windows command prompt" and "Check out as-is. Commit as-is" in installer.
129 Version: Version 8 Update 60
130 URL : http://www.java.com
133 Name : Microsoft Visual C++ 2010 Redistributable Package (x64)
135 URL : http://www.microsoft.com/en-us/download/details.aspx?id=14632
136 For : msvcr100.dll required by OpenMPI
139 Version: 4.8.2 (or above)
140 URL : http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.8.2/threads-win32/seh/x86_64-4.8.2-release-win32-seh-rt_v3-rev3.7z/download
141 For : Windows port of GCC C/C++ compiler (also includes Fortran compiler).
145 URL : http://www.mingw.org/download/installer
146 For : Provides Linux-like emulation shell and utilities (eg. find, grep, ls, make etc.) and tools (eg. bison, flex, m4, yacc etc.).
147 Only the "mingw-developer-toolkit" and "msys-base" is required, DO NOT download ming32-* compiler packages (we use MinGW-w64 instead).
148 Assuming you installed this to the default /c/MinGW directory, you will need to "cp -p make.exe gmake.exe" in /c/MinGW/msys/1.0/bin (unless have Strawberry Perl).
151 Version: 1.6.1 (or above)
152 URL : http://www.open-mpi.org/software/ompi/v1.6/downloads/OpenMPI_v1.6.1-1_win64.exe
153 For : Bulding and running OpenMPI applications. Do not add to PATH in installer.
156 Version: 4.3.1 (or above)
157 URL : http://www.paraview.org/download/
158 For : Graphically visualising foam results.
161 Version: 0.44 (or above)
162 URL : http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/pexports-0.46/pexports-0.46-mingw32-bin.tar.xz/download
163 For : Extracting symbols from OpenMPI DLLs to pass to dlltool.exe (supplied in MinGW-w64 package). Move directory "bin" to "pexports-0.46" after unpacking.
167 URL : https://www.python.org/download/releases/2.7/
170 Name : Strawberry Perl
171 Version: 5.20.2.1 (or above)
172 URL : http://strawberryperl.com/download/5.20.2.1/strawberry-perl-5.20.2.1-64bit.msi
173 For : Running Perl scripts, "pexports.exe" and "gmake.exe" utilities
177 URL : http://sourceforge.net/projects/win32svn/files/1.8.13/
181 Version: 1.11.4-1 (or above)
182 URL : http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-bin.zip, http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-dep.zip, http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-doc.zip
183 For : Automatically downloading files from internet (eg. for use in automated build scripts)
185 git clone --branch nextRelease git://git.code.sf.net/p/openfoam-extend/foam-extend-3.1
188 4. EXAMPLE OUTPUT FROM SOURCING etc/bashrc.mingw
189 ================================================
192 Setting environment variables for user-defined installed system tools and utilities ...
194 Sourcing: /c/Users/UserName/Git/foam-extend-3.2/etc/bashrc
195 Sourcing: /c/Users/UserName/Git/foam-extend-3.2/etc/prefs.sh.mingw
196 Sourcing: /c/Users/UserName/Git/foam-extend-3.2/etc/settings.sh
197 MESQUITE_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/mesquite-2.1.2
198 METIS_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/metis-5.1.0
199 PARMETIS_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/parmetis-4.0.3
200 PARMGRIDGEN_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/ParMGridGen-1.0
201 LIBCCMIO_DIR is initialized to:
202 SCOTCH_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/scotch_6.0.0
203 SCOTCH_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/packages/scotch_6.0.0
204 CMAKE_DIR is initialized to:
205 M4_DIR is initialized to:
206 BISON_DIR is initialized to:
207 FLEX_DIR is initialized to: /C/MinGW/msys/1.0//bin/..
208 ZOLTAN_DIR is initialized to:
209 PYTHON_DIR is initialized to:
210 PYFOAM_DIR is initialized to:
211 PYFOAM_SITE_DIR is initialized to: /c/Users/UserName/Git/foam-extend-3.2/ThirdParty/PyFoamSiteScripts
212 HWLOC_DIR is initialized to:
213 QT_DIR is initialized to:
214 PARAVIEW_DIR is initialized to:
215 LLVM_DIR is initialized to:
216 MESA_DIR is initialized to:
217 Sourcing: /c/Users/UserName/Git/foam-extend-3.2/etc/aliases.sh
219 Adding user-defined installed system tools to PATH ...
220 Setting OpenMPI environment settings ...
222 Checking versions of installed system tools (based on PATH) ...
223 7-Zip: /c/Program Files/7-Zip/7z.exe [ 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18]
224 Bison: /bin/bison.exe [bison (GNU Bison) 2.4.2]
225 CMake: /c/Programs/cmake-3.2.3-win32-x86/bin/cmake.exe [cmake version 3.2.3]
226 Flex: /bin/flex.exe [flex 2.5.35]
227 G++: /c/Programs/mingw64/bin/g++.exe [g++.exe (x86_64-win32-seh-rev3, Built by MinGW-W64 project) 4.8.2]
228 GCC: /c/Programs/mingw64/bin/gcc.exe [gcc.exe (x86_64-win32-seh-rev3, Built by MinGW-W64 project) 4.8.2]
229 GMake: /c/Programs/strawberry-perl-5.20.2.1-64bit/c/bin/gmake.exe [GNU Make 4.0.90]
230 Git: /c/Programs/Git/cmd/git.exe [git version 1.9.5.msysgit.1]
231 Java: /c/ProgramData/Oracle/Java/javapath/java.exe [java version "1.8.0_45"]
232 M4: /bin/m4.exe [m4 (GNU M4) 1.4.16]
233 Make: /bin/make.exe [GNU Make 3.81]
234 MinGW-w64: /c/Programs/mingw64
235 OpenMPI: /c/Programs/OpenMPI_v1.6.1-x64/bin/mpirun.exe [mpirun.exe (OpenRTE) 1.6.1]
236 PEexports: /c/Programs/pexports-0.46/bin/pexports.exe [PExports 0.44 Copyright 1998, Anders Norlander]
237 ParaView: /c/Programs/ParaView-4.3.1
238 Perl: /bin/perl.exe [ This is perl, v5.8.8 built for msys-64int]
239 Python: /c/Programs/Python27/python.exe [Python 2.7.9]
240 Subversion: /c/Programs/svn-win32-1.8.13/bin/svn.exe [svn, version 1.8.13 (r1667537)]
241 Vim: /bin/vim.exe [VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 19 2011 15:37:04)]
242 Wget: /c/Programs/wget-1.11.4-1/bin/wget.exe [GNU Wget 1.11.4 Copyright (C) 2008 Free Software Foundation, Inc.]
245 FOAM_INST_DIR=/c/Users/UserName/Git
246 WM_PROJECT_DIR=/c/Users/UserName/Git/foam-extend-3.2
248 ENVIRONMENT SETUP COMPLETE.