Skip to content

Commit 120a4fa

Browse files
committed
HACKING: big update for windows
Based on notes from a Windows CI machine install in 2020. Signed-off-by: Brice Goglin <[email protected]>
1 parent 2189d1c commit 120a4fa

File tree

1 file changed

+47
-44
lines changed

1 file changed

+47
-44
lines changed

HACKING

+47-44
Original file line numberDiff line numberDiff line change
@@ -75,62 +75,65 @@ Notes to developers:
7575
/bin/sh ../libtool --tag=CC --mode=compile gcc [...] -c -o topology.lo topology.c
7676

7777

78+
79+
80+
Building on Windows
81+
82+
- hwloc may be built natively on Windows using CMake (see contrib/windows-cmake/)
83+
or a MSVC solution (see contrib/windows/).
84+
85+
- Otherwise, hwloc's usual Autotools build system supports Cygwin as well as
86+
MinGW (used below for building official zipballs for Windows releases).
87+
88+
7889
Building the Windows zipballs on Windows with MinGW:
7990

91+
- Based on the install of a hwloc Windows CI machine in 2020.
92+
93+
- See also job-3-mingw.bat and job-3-mingw.sh for in contrib/ci.inria.fr/
94+
for details on how the hwloc CI runs on such a platform.
95+
8096
- Install prerequisites:
81-
- Visual C++ Express, currently available at:
82-
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express)
83-
- mingw-w64-bin_i686-mingw_<date>.zip if building a 64bits zipball:
84-
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/
85-
- mingw-w32-bin_i686-mingw_<date>.zip If building a 32bits zipball,
86-
or if building a 64bits zipball on a 32bits Windows:
87-
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Automated%20Builds/
88-
- MSYS-<date>.zip
89-
http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/
90-
- findutils-<version>-bin.zip
91-
http://sourceforge.net/projects/ezwinports/files/
92-
Unpack all these ZIPs in a path that does not contain spaces,
93-
to avoid problems later.
94-
95-
- Launch msys.bat (in the root directory of the extracted MSYS ZIP).
96-
97-
- Your path must contain:
98-
- The bin directory of the extracted MinGW ZIP
99-
(it contains <arch>-gcc)
100-
- The <arch>/lib directory of the extracted MinGW ZIP
101-
(it contains libgcc*.DLL, needed for C++ tests during make check)
102-
- Visual C++ Express bin and IDE directories
103-
- The bin directory of the non-cross-compiling MinGW ZIP
104-
when building a 64bits zipball on a 32bits Windows
105-
- The bin directory of the findutils ZIP to find the "find" command
106-
(the Windows find command cannot be used)
107-
- Examples of PATH (depends on where ZIPs were extracted and were Visual Studio was installed):
108-
- For a 32bits zipball:
109-
$ PATH=/c/hwloc/mingw32/bin:/c/hwloc/mingw32/i686-w64-mingw32/lib:”/c/Program Files/Microsoft Visual Studio 10.0/VC/bin”:”/c/Program Files/Microsoft Visual Studio 10.0/Common7/IDE”:$PATH
110-
- For a 64bits zipball:
111-
$ PATH=/c/hwloc/mingw64/bin:/c/hwloc/mingw64/x86_64-w64-mingw32/lib:”/c/Program Files/Microsoft Visual Studio 10.0/VC/bin”:”/c/Program Files/Microsoft Visual Studio 10.0/Common7/IDE”:$PATH
112-
- For a 64bits zipball on a 32bits Windows:
113-
$ PATH=/c/hwloc/mingw64/bin:/c/hwloc/mingw32/bin:/c/hwloc/mingw32/i686-w64-mingw32/lib:”/c/Program Files/Microsoft Visual Studio 10.0/VC/bin”:”/c/Program Files/Microsoft Visual Studio 10.0/Common7/IDE”:$PATH
114-
- Check that running "lib", "link" and "cl" finds the right tools (installed by Visual Studio)
115-
and displays their usage output (list of command-line options).
116-
117-
- Download a hwloc tarball (building from SVN requires autotools, doxygen, LaTeX, etc.),
97+
- MSYS2 from https://www.msys2.org/
98+
- Run a MSYS2 terminal and install MinGW compilers and some tools:
99+
$ pacman -Suy
100+
$ pacman -S tar zip coreutils diffutils findutils make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
101+
- Visual Studio (e.g. 2019 Community Edition)
102+
During installation, make sure you activate
103+
- C++ Desktop Development,
104+
- Windows 10 SDK (or more recent)
105+
- x64/x86 Build Tools (e.g. version v142),
106+
- C++ Modules for Build Tools (e.g. v142),
107+
- C++/CLI for Build Tools (e.g. v142),
108+
- C++ Clang and CMake tools (not needed for MinGW-only builds).
109+
110+
- Start a 64bits build msys2 terminal with
111+
> C:\msys64\usr\bin\env MSYSTEM=MINGW32 HOME=%cd% /usr/bin/bash -li
112+
- or 32bits with
113+
> C:\msys64\usr\bin\env MSYSTEM=MINGW64 HOME=%cd% /usr/bin/bash -li
114+
115+
- Configuration of the MSYS2 terminal environment:
116+
- Your path must contain:
117+
- The MSYS bin directories (for MinGW gcc, etc)
118+
- For instance /mingw64/bin/ for 64bits build, /mingw32/bin/ for 32bits.
119+
- The directory of the some MSVC command-line tools such as "lib.exe", "cl.exe", etc
120+
- For instance, for 64bits build: "/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/"
121+
- and for 32bits build: "/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/"
122+
- Check that running "lib", "link" and "cl" finds the right tools (installed by Visual Studio)
123+
and displays their usage output (list of command-line options).
124+
125+
- Download a hwloc tarball
126+
(don't use GIT unless you want to install autotools, doxygen, LaTeX, etc on Windows),
118127
extract it and enter the directory.
119128

120129
- Set the install prefix to what the zipball name must be:
121130
$ prefix=$PWD/hwloc-win<size>-build-<version>
122131
- Configure
123-
- For a 32bits zipball:
124-
$ ./configure --prefix=$prefix --enable-static --host=i686-w64-mingw32
125-
- For a 64bits zipball:
126-
$ ./configure --prefix=$prefix --enable-static --host=x86_64-w64-mingw32
127-
132+
$ ./configure --prefix=$prefix --enable-static CC="gcc -static-libgcc"
128133
- Build
129134
$ make
130135
- If not building a 64bits zipball on a 32bits machine, test things:
131136
$ make check
132-
If your Windows is not configured in English, some failure may occur in tests/xml
133-
because floats are localized.
134137

135138
- Install
136139
$ make install

0 commit comments

Comments
 (0)