Skip to content

Commit abd0ba5

Browse files
authored
Merge pull request #7 from chiefenne/patch-2
Complete CYGWIN installation rework and doc formatting
2 parents dae12fb + b662ad6 commit abd0ba5

File tree

1 file changed

+164
-61
lines changed

1 file changed

+164
-61
lines changed

_docs/Cygwin-Build-for-Windows.md

Lines changed: 164 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,168 @@ 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+
1. Install CYGWIN (64-bit version) and development packages
32+
* Download and run:
33+
34+
[setup-x86_64.exe](https://www.cygwin.com/setup-x86_64.exe)
35+
36+
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.
37+
38+
For detailed informations on how to install CYGWIN and selected packages see [CYGWIN Installation](https://cygwin.com/install.html).
39+
40+
* Install development tools (dependencies on these packages will be automatically selected by CYGWIN)
41+
42+
> NOTE: A single command installing all required packages in one is given below this list
43+
44+
1. General build environment tools
45+
* autoconf
46+
* autoconf2.5
47+
* autogen
48+
* automake
49+
* automake1.15
50+
* libtool
51+
* make
52+
1. Compilers
53+
* gcc-g++
54+
* mingw64-x86_64-gcc-core
55+
* mingw64-x86_64-gcc-g++
56+
1. Python
57+
* python37
58+
* python37-devel
59+
* python3-configobj
60+
1. OpenMPI
61+
* libopenmpi-devel
62+
* openmpi
63+
1. Miscellaneous
64+
* vim (or any other editor in order to be able to edit files)
65+
* rsh
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,rsh,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+
1. Configure OpenMPI
85+
86+
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.
87+
88+
Assuming the 64-bit CYGWIN is installed in `C:\cygwin64` and `/etc/fstab` has been modified as in the previous step:
89+
90+
```bash
91+
cat /c/cygwin64/usr/share/openmpi/mpic++-wrapper-data.txt | grep lmpi_cxx
92+
```
93+
94+
If the option is set, then the following lines would be the result of the above `grep`command:
95+
96+
libs=-lmpi_cxx -lmpi
97+
libs_static=-lmpi_cxx -lmpi -lopen-rte -lopen-pal -lm -lgdi3
98+
99+
> NOTE: If `-lmpi_cxx` was not found, skip the next step
100+
101+
If this is the case, edit `mpic++-wrapper-data.txt` and remove the `-lmpi_cxx` options so that the respective lines look like this:
102+
103+
libs=-lmpi
104+
libs_static=-lmpi -lopen-rte -lopen-pal -lm -lgdi3
105+
106+
1. Set the Python version for the installation process (for permanent setting add this line to `~/.profile`)
107+
108+
```bash
109+
export PYTHON=/usr/bin/python3.7
110+
```
111+
112+
1. Get the SU2 source code:
113+
114+
* Download following file for SU2 version 6.2.0
115+
116+
```bash
117+
wget https://github.com/su2code/SU2/archive/v6.2.0.tar.gz
118+
```
119+
120+
* Extract files and change into the folder where the files were extracted to:
121+
122+
```bash
123+
tar -xzvf v6.2.0.tar.gz
124+
cd SU2-6.2.0
125+
```
126+
127+
> NOTE: This is later the folder where the SU2_HOME variable points to
128+
129+
1. Run the utility for autoconf/automake toolchain setup:
130+
131+
```bash
132+
./bootstrap
133+
```
134+
135+
1. Create Makefiles:
136+
137+
> NOTE: didn't yet get `tecio` working, therefore disabled with `--disable-tecio`<br>
138+
> 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))
139+
140+
```bash
141+
./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"
142+
```
143+
144+
1. Compile and link using:
145+
146+
```bash
147+
make
148+
```
149+
150+
1. Distribute executables, etc. to their intended locations:
151+
152+
```bash
153+
make install
154+
```
155+
156+
1. Add the `$SU2_HOME` and `$SU2_RUN` environment variables to `~/.bashrc` (and `source ~/.bashrc`)
157+
158+
```bash
159+
export SU2_RUN="path_where_you_want_the_Executables" (use same folder here as in the configure command above)
160+
export SU2_HOME="/d/software/CFD/SU2/SU2-6.2.0" <-- UPDATE THIS folder according to your environment
161+
export PATH=$PATH:$SU2_RUN
162+
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
163+
```
164+
165+
1. Test serial and parallel versions:
166+
167+
```bash
168+
cd $SU2_HOME/QuickStart
169+
```
170+
171+
SERIAL command (due to the previous step `SU2_CFD.exe` should now be available in the path):
172+
173+
```bash
174+
SU2_CFD.exe inv_NACA0012.cfg
175+
```
176+
177+
PARALLEL command:
178+
Both `mpirun` and `mpiexec` do the same; `mpiexec` is recommended as the standard command.
179+
180+
```bash
181+
mpiexec -n 4 SU2_CFD.exe inv_NACA0012.cfg
182+
```
183+
184+
If more processes are requested than cores are available an error will be thrown:
185+
186+
> There are not enough slots available in the system.
187+
188+
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).
189+
190+
```bash
191+
mpiexec -n 8 -oversubscribe SU2_CFD.exe inv_NACA0012.cfg
192+
```

0 commit comments

Comments
 (0)