Skip to content

Commit f3166dd

Browse files
authored
Complete rework and formatting
It turned out, that on other computers the original installation instructions did't work. So I tried to overcome the respective caveats. Further I did some better formatting with GitHub Flavored Markdown.
1 parent d9dc1e8 commit f3166dd

1 file changed

Lines changed: 172 additions & 61 deletions

File tree

_docs/Cygwin-Build-for-Windows.md

Lines changed: 172 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,176 @@ At the package selection step, search for the following terms and select the ass
2525
* cpp: all debug, pre-processor, regular expression packages.
2626

2727
#### Example SU2 installation on WINDOWS 10 using 64-bit Cygwin
28-
The shell used for all command line steps is the the default Cygwin bash shell.
29-
30-
1) Install CYGWIN (64-bit version)
31-
a) Download and run https://www.cygwin.com/setup-x86_64.exe
32-
b) Install development tools (also 64-bit versions):
33-
i) gcc, gfortran, python3.7, openmpi, automake, libtools, autoconf, etc.
34-
ii) python-configobj needs to be installed for the same python version
35-
(Python module for handling config files)
36-
often there are installation problems (not yet figured out when and why)
37-
after installation it should reside in the folder /usr/bin as shown below
38-
iii) folder /usr/bin as it should be for python3.7 and python-config
39-
lrwxrwxrwx 1 Andreas None 14 17. Mrz 19:29 /usr/bin/python3.7 -> python3.7m.exe
40-
-rwxr-xr-x 1 Andreas None 3,3K 17. Mrz 19:46 /usr/bin/python3.7-config
41-
-rwxr-xr-x 1 Andreas None 9,1K 15. Feb 10:05 /usr/bin/python3.7m.exe
42-
-rwxr-xr-x 1 Andreas None 3,3K 17. Mrz 19:46 /usr/bin/python3.7m-config
43-
44-
2) Set Python version for the installation process
45-
export PYTHON=/usr/bin/python3.7
46-
47-
3) Goto folder where the SU2 source distribtution has been unzipped
48-
a) download the SU2 source installation file for version 6.2.0
49-
https://github.com/su2code/SU2/archive/v6.2.0.tar.gz
50-
b) unzip and untar
51-
c) change into the folder where files were untarred
52-
NOTE: this is later (see step 7) the folder where the SU2_HOME variable points to
53-
54-
3a) ./bootstrap
55-
56-
4) Launch following configure command:
57-
NOTE: didn't get tecio working, therefore disabled with --disable-tecio
58-
NOTE: "--enable-mpi-cxx" instead of "--enable-mpi"
59-
(see http://cygwin.1069669.n5.nabble.com/libmpi-cxx-dll-a-missing-td142324.html)
60-
61-
./configure --prefix=path_where_you_want_the_Executables --disable-tecio --enable-mpi-cxx CXXFLAGS=-O3
62-
63-
5) Compile and link using:
64-
make
65-
66-
6) Not really needed (if a setup like in 7 is used)
67-
make install
68-
69-
7) Add the $SU2_HOME and $SU2_RUN environment variables to ~/.bashrc (and "source ~/.bashrc")
70-
71-
export SU2_RUN="path_where_you_want_the_Executables" (use same folder here as in the configure command above)
72-
export SU2_HOME="/d/software/CFD/SU2/SU2-6.2.0" <-- UPDATE THIS folder to your environment
73-
export PATH=$PATH:$SU2_RUN
74-
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
75-
76-
8) cd to the QuickStart folder and try serial and parallel versions
77-
78-
SERIAL command:
79-
80-
SU2_CFD.exe inv_NACA0012.cfg
81-
82-
PARALLEL command:
83-
(mpirun and mpiexec should be the same; mpiexec recommended as standard command)
84-
(-oversubscribe allows more processes than cores)
85-
(although I have 8 cores, even with "-n 6" I had to use the option)
86-
(otherwise I got: There are not enough slots available in the system ...)
87-
88-
mpiexec -n 6 -oversubscribe SU2_CFD.exe inv_NACA0012.cfg
8928

29+
The CYGWIN `bash` shell is used for all steps on the command line. It is automatically available after the first installation step (typically to be launched via the CYGWIN desktop icon).
30+
31+
32+
1. Install CYGWIN (64-bit version) and development packages
33+
* Download and run:
34+
35+
[setup-x86_64.exe](https://www.cygwin.com/setup-x86_64.exe)
36+
37+
Inside the Cygwin Setup GUI use `C:\cygwin64` for both `Root Directory` and `Local Package Directory`. `Chose a Download Site` close to you (also http mirrors often work better). Continue to complete the bare minimum installation. This will end with a desktop icon named `Cygwin64 Terminal`. Double-click this to open the shell and launch further commands from there.
38+
39+
For detailed informations on how to install CYGWIN and selected packages see [CYGWIN Installation](https://cygwin.com/install.html).
40+
41+
* Install development tools (dependencies on these packages will be automatically selected by CYGWIN)
42+
43+
> NOTE: A single command installing all required packages in one is given below this list
44+
45+
1. General build environment tools
46+
* autoconf
47+
* autoconf2.5
48+
* autogen
49+
* automake
50+
* automake1.15
51+
* libtool
52+
* make
53+
1. Compilers
54+
* gcc-g++
55+
* mingw64-x86_64-gcc-core
56+
* mingw64-x86_64-gcc-g++
57+
1. Python
58+
* python37
59+
* python37-devel
60+
* python3-configobj
61+
1. OpenMPI
62+
* libopenmpi-devel
63+
* openmpi
64+
1. Miscellaneous
65+
* vim (or any other editor in order to be able to edit files)
66+
* wget (to be able to download from the command line)
67+
* zlib-devel
68+
69+
* All-in-one installation of packages (after the initial minimum installation):
70+
71+
> NOTE: Prepend path to `setup-x86_64.exe` (depending where it has been downloaded)
72+
73+
```bash
74+
setup-x86_64.exe -q -P autoconf,autoconf2.5,autogen,automake,automake1.15,libtool,make,gcc-g++,mingw64-x86_64-gcc-core,mingw64-x86_64-gcc-g++,python37,python37-devel,python3-configobj,libopenmpi-devel,openmpi,vim,wget,zlib-devel
75+
```
76+
77+
1. Configure CYGWINs default mount point (optional, but following steps use a syntax relying on this)
78+
79+
```bash
80+
mount -c / -o binary,noacl,posix=0
81+
mount -m > /etc/fstab
82+
```
83+
84+
85+
1. Configure OpenMPI
86+
87+
Because in OpenMPI the C++ interface was removed, the option `-lmpi_cxx` has to be removed from the linker defaults. We need to check if this option is contained in the wrapper control file. This depends on the installed OpenMPI libraries.
88+
89+
Assuming the 64-bit CYGWIN is installed in `C:\cygwin64` and `/etc/fstab` has been modified as in the previous step:
90+
91+
```bash
92+
cat /c/cygwin64/usr/share/openmpi/mpic++-wrapper-data.txt | grep lmpi_cxx
93+
```
94+
95+
If the option is set, then the following lines would be the result of the above `grep`command:
96+
97+
libs=-lmpi_cxx -lmpi
98+
libs_static=-lmpi_cxx -lmpi -lopen-rte -lopen-pal -lm -lgdi3
99+
100+
> NOTE: If `-lmpi_cxx` was not found, skip the next step
101+
102+
If this is the case, edit `mpic++-wrapper-data.txt` and remove the `-lmpi_cxx` options so that the respective lines look like this:
103+
104+
libs=-lmpi
105+
libs_static=-lmpi -lopen-rte -lopen-pal -lm -lgdi3
106+
107+
108+
1. Set the Python version for the installation process (for permanent setting add this line to `~/.profile`)
109+
110+
```bash
111+
export PYTHON=/usr/bin/python3.7
112+
```
113+
114+
1. Get the SU2 source code:
115+
116+
* Download following file for SU2 version 6.2.0
117+
118+
```bash
119+
wget https://github.com/su2code/SU2/archive/v6.2.0.tar.gz
120+
```
121+
122+
* Extract files and change into the folder where the files were extracted to:
123+
124+
```bash
125+
tar -xzvf v6.2.0.tar.gz
126+
cd SU2-6.2.0
127+
```
128+
129+
> NOTE: This is later the folder where the SU2_HOME variable points to
130+
131+
1. Run the utility for autoconf/automake toolchain setup:
132+
133+
```bash
134+
./bootstrap
135+
```
136+
137+
1. Create Makefiles:
138+
139+
NOTE: didn't yet get `tecio` working, therefore disabled with `--disable-tecio`<br>
140+
NOTE: Removed `-DHAVE_EXECINFO_H` from metis cppflags (potentially could be solved via [gnulib](https://www.gnu.org/software/gnulib/manual/html_node/execinfo_002eh.html))
141+
142+
```bash
143+
./configure --prefix=/home/Andreas/SU2-6.2.0 -enable-mpi --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx --disable-tecio --with-metis-cppflags="-D_FILE_OFFSET_BITS=64 -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE"
144+
```
145+
146+
1. Compile and link using:
147+
148+
```bash
149+
make
150+
```
151+
152+
1. Distribute executables, etc. to their intended locations:
153+
154+
```bash
155+
make install
156+
```
157+
158+
1. Add the `$SU2_HOME` and `$SU2_RUN` environment variables to `~/.bashrc` (and `source ~/.bashrc`)
159+
160+
```bash
161+
export SU2_RUN="path_where_you_want_the_Executables" (use same folder here as in the configure command above)
162+
export SU2_HOME="/d/software/CFD/SU2/SU2-6.2.0" <-- UPDATE THIS folder according to your environment
163+
export PATH=$PATH:$SU2_RUN
164+
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
165+
```
166+
167+
1. Test serial and parallel versions:
168+
169+
```bash
170+
cd $SU2_HOME/QuickStart
171+
```
172+
173+
SERIAL command (due to the previous step `SU2_CFD.exe` should now be available in the path):
174+
175+
```bash
176+
SU2_CFD.exe inv_NACA0012.cfg
177+
```
178+
179+
PARALLEL command:
180+
Both `mpirun` and `mpiexec` do the same; `mpiexec` is recommended as the standard command.
181+
182+
```bash
183+
mpiexec -n 4 SU2_CFD.exe inv_NACA0012.cfg
184+
```
185+
186+
If more processes are requested than cores are available an error will be thrown:
187+
188+
> There are not enough slots available in the system.
189+
190+
On WINDOWS this can be if hyperthreading is active. A system physically having 4 CPUs (cores), would show 8 CPUs in case of hyperthreading. Oversubscribe allows more processes than cores (which not necessarily is faster).
191+
192+
```bash
193+
mpiexec -n 8 -oversubscribe SU2_CFD.exe inv_NACA0012.cfg
194+
```
195+
196+
or
197+
198+
```bash
199+
mpiexec --use-hwthread-cpus -n 8 SU2_CFD.exe inv_NACA0012.cfg
200+
```

0 commit comments

Comments
 (0)