- UHD 3.15.0
- Boost 1.72.0
- msys2-runtime 3.2.0-15 (probably doesn't matter)
- msys2-runtime-devel 3.2.0-15 (only used for the header error listed below)
- mingw-w64-x86_64-gcc 10.3.0-5
- Get MSYS64 and follow the instructions to the end to download the mingw64 toolchains.
- Download your favourite version of Boost source code (1.72 was tested), unzip it, and build it with the Windows Command Prompt by following this link; note that you will have to add the
msys64\mingw64\bin
to system PATH. Do NOT use the MinGW terminal. During theb2
build step I left out the--build-type=complete
as it wasn't necessary for me. - Run CMake (CMake-GUI was a great help for me) on the downloaded UHD source code (I usually download from the github 'Releases' page as a tar.gz rather than cloning). Make a build folder in
host
(I called minehost\mingwbuild
to distinguish it from my other MSVC build folder). - Select MinGW Makefiles as the configuration/compiler toolchain; if it doesn't find your compiler, make sure to add the MinGW64 bin folder to your system PATH e.g.
D:\msys64\mingw64\bin
. Enable viewing of 'Advanced' entries at the top of the cmake-gui. - Specify the CMake option
Boost_INCLUDE_DIR
as the path where the boost library --prefix was (it should look likePREFIX/include/boost-1_72
or something similar).Boost_DIR
did nothing for me. - For me, the Boost libraries were not found, so I filled them in by myself; I only filled in the Release versions, for example
Boost_CHRONO_LIBRARY_RELEASE
was set toD:/my_mingw_boost_libraries/lib/libboost_chrono-mgw103-mt-x64-1_72.a
.mgw103
should reflect the GCC/G++ version you have installed under mingw (10.3 for me), and the last number1_72
reflects the boost version. Be sure not to pick the debug versions (they have an extra-d-
in the name) for Release, and use the x64 version. - I am not building this with the Python API in mind, so do whatever you wish with it.
- Download libusb and link
LIBUSB_LIBRARIES
tomingw64/dll/libusb-1.0.dll.a
or similar (I did not test using the.dll
version, but since the boost libraries are all.dll.a
I wanted to be consistent).LIBUSB_INCLUDE
should point toinclude/libusb-1.0
or similar. - At this point, the whole project should configure; if any options above don't appear, just reconfigure and fix one missing error at a time. Add an install prefix in
CMAKE_INSTALL_PREFIX
and Generate.
- Open a command prompt (not MSYS/MinGW terminal any more). Navigate to the UHD build folder
/mingwbuild
and runmingw32-make
. Note, you should probably usemingw32-make -j4
if you have more CPU cores (just like make). - Fix the following errors if you see them and re-run the
mingw32-make
command each time.
WinSock.h already included
or something similar. This is due to inclusion ofboost/asio.hpp
, and was fixed for me by moving this include statement to the top of the file. Files affected werehost/lib/deps/rpclib/lib/rpc/server.cc
,host/lib/deps/rpclib/lib/rpc/client.cc
,host/lib/usrp/mpmd/mpmd_find.cpp
,host/lib/usrp/mpmd/mpmd_impl.cpp
,host/include/uhd/transport/nirio/rpc/rpc_client.hpp
. If you're afraid, just make a copy of them before editing the files.- In addition, the file
host/lib/transport/nirio_zero_copy.cpp
needed the#include<uhd/transport/nirio_zero_copy.hpp>
moved to the top as well, for a similarWinSock.h
error. Missing 'wordexp.h'
or something similar. MinGW64 has this header missing, so the easiest way is to open a MSYS2 terminal and install the MSYS2 dev headers viapacman -S msys2-runtime-devel
, then going into yourmsys64\usr\include
folder to findwordexp.h
, and copying it to the MinGW64 folder atmsys64\mingw64\include
.Invalid conversion from boost_native_handle_type to pthread
or something similar. Inhost/lib/utils/thread.cpp
, comment out the entire section containing the offending line. NOTE: UNKNOWN WHETHER THIS WILL IMPACT THE EVENTUAL EXECUTABLES. The offending line for me was
Interestingly, there were other calls to this function that were okay in other files..#ifdef HAVE_PTHREAD_SETNAME pthread_setname_np(thrd->native_handle(), ....); #endif
- Unable to solve linker issues with AcceptEx..