Good day.
Please, explain in detail building process UHD with CMake for Windows XP. I follow the instructions from the developer, but they are very short, and I worked with CMake for the first time. I downloaded and installed all the necessary components: CMake, Boost, Python with Cheetah and Doxygen. All these components are installed on drive C:\ for simplicity. I launched CMake (for MSVC 2010 compiler) and got output of a build attempt:
The CXX compiler identification is MSVC 16.0.30319.1
Check for working CXX compiler using: Visual Studio 10 2010
Check for working CXX compiler using: Visual Studio 10 2010 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Configuring the python interpreter...
Found PythonInterp: C:/Python27/python.exe (found version "2.7.8")
Python interpreter: C:/Python27/python.exe
Override with: -DPYTHON_EXECUTABLE=<path-to-python>
The C compiler identification is MSVC 16.0.30319.1
Check for working C compiler using: Visual Studio 10 2010
Check for working C compiler using: Visual Studio 10 2010 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check size of void*[8]
Check size of void*[8] - done
Build type not specified: defaulting to release.
Configuring Boost C++ Libraries...
Could NOT find Boost
Boost include directories: Boost_INCLUDE_DIR-NOTFOUND
Boost library directories:
Boost libraries:
Python checking for Python version 2.6 or greater
Python checking for Python version 2.6 or greater - found
Python checking for Cheetah templates 2.0.0 or greater
Python checking for Cheetah templates 2.0.0 or greater - found
Configuring LibUHD support...
Dependency Boost_FOUND = 0
Dependency HAVE_PYTHON_PLAT_MIN_VERSION = TRUE
Dependency HAVE_PYTHON_MODULE_CHEETAH = TRUE
Disabling LibUHD support.
Override with -DENABLE_LIBUHD=ON/OFF
Configuring Examples support...
Dependency ENABLE_LIBUHD = OFF
Disabling Examples support.
Override with -DENABLE_EXAMPLES=ON/OFF
Configuring Utils support...
Dependency ENABLE_LIBUHD = OFF
Disabling Utils support.
Override with -DENABLE_UTILS=ON/OFF
Configuring Tests support...
Dependency ENABLE_LIBUHD = OFF
Disabling Tests support.
Override with -DENABLE_TESTS=ON/OFF
Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.7")
Configuring Manual support...
Dependency DOXYGEN_FOUND = YES
Enabling Manual support.
Override with -DENABLE_MANUAL=ON/OFF
Configuring API/Doxygen support...
Dependency DOXYGEN_FOUND = YES
Enabling API/Doxygen support.
Override with -DENABLE_DOXYGEN=ON/OFF
Could NOT find GZip (missing: GZIP_EXECUTABLE)
Configuring Man Pages support...
Dependency GZIP_FOUND = FALSE
Dependency NOT_WIN32 =
Disabling Man Pages support.
Override with -DENABLE_MAN_PAGES=ON/OFF
######################################################
# UHD enabled components
######################################################
* Manual
* API/Doxygen
######################################################
# UHD disabled components
######################################################
* LibUHD
* Examples
* Utils
* Tests
* Man Pages
Building version: 003.007.002-0-unknown
Using install prefix: C:/Program Files/UHD
Compatible images can be downloaded from: http://files.ettus.com/binaries/master_images/archive/uhd-images_003.007.002-48-g403e539d.zip
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/uhd/host
used as include directory in directory C:/uhd/host/docs
Configuring incomplete, errors occurred!
See also "C:/uhd/host/build/CMakeFiles/CMakeOutput.log".
I was particularly interested in why not find a boost (specify which folder to variable Boost_DIR
??), how to include LIBUHD
(I tried to manually create a variable ENABLE_LIBUHD
of type BOOL
and assign it a value of 1 - but nothing changes).
Everything is very unclear, please maximum details.
THANKS!
You want to get on the usrp-users mailing list.
I managed to lose my build, and lose my formula, so I've had to reproduce it. I figured now that I've gone through the process, I will improve the formula I posted here:
1) Git the source - git clone git://github.com/EttusResearch/uhd.git I did the GIT into c:\ettus_b210\uhd_build which creates the directory "uhd"
2) Install boost http://sourceforge.net/projects/boost/files/boost-binaries/ I used 1_55_0. This distribution will install in c:\local\boost_1_55_0 Choose the build for your build environment - I am using Windows 32-bit VS2010.
3) Install libusb.http://sourceforge.net/projects/libusbx/files/releases/1.0.18/binaries/ The "libusbx" referenced here has been subsumed into libusb with this release. I have mine installed in C:\libusbx\libusbx-1.0.18-win
4) Install Python and the Python tools indicated
Download and install Python (minimum 2.6.x) binaries. I recommend Python 2.7, which comes with easy install script that will help you getting Cheetah. (if you have MATLAB installed, then you probably have Python2.7) https://www.python.org/download/
Install Cheetah First install Python Setup Tools https://pypi.python.org/pypi/setuptools Open a cmd window and execute it After downloading and extracting the package, in a cmd window run easy_install cheetah
CHECK which Python version is being called.
The easy way here was to have Python27 installed, then using easy_install Script to install Cheetah.
If running the command below in a cmd windows shows something different from python 2.7, then modify registry entries (Local Machine and ROOT). In a command-line windows run:
ftype|find /I "python"
You should get something like:
Python.CompiledFile="C:\Python27\python.exe" "%1" %*
Python.File="C:\Python27\python.exe" "%1" %*
Python.NoConFile="C:\Python27\pythonw.exe" "%1" %*
Also make sure these entries have the correct version shown in the entries below:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
5) Install cmake - I used 3.0.0, but anything past 2.8.0 should work.
On the CMake dialog:
Directory to build ing c:\ettus_b210\uhd_build\uhd\build
NOTE: this is your choice where you want things to be build - it won't build in the source directories
Enable Advanced View
Boost_DEBUG=True
NOTE: the case is important on this flag
BOOST_INCLUDE_DIR=c:\local\boost_1_55_0
NOTE: this is the directory that contains the directory "boost", which is how the boost headers are included
BOOST_LIBRARYDIR=c:\local\boost_1_55_0\lib32-msvc-10.0
NOTE: I am using VS2010, and this is the library for that build environment.
LIBUSB_INCLUDE_DIRS=C:\libusbx\libusbx-1.0.18-win\include\libusbx-1.0
LIBUSB_LIBRARIES=C:\libusbx\libusbx-1.0.18-win\MS32\dll\libusb-1.0.lib
NOTE: this is the .lib file in the DLL subdirectory - they want the library itself not the containing directory
CMAKE_INSTALL_PREFIX=c:/ettus_b210/install
NOTE: the default it to build into "C:\Program Files (x86)\UHD", which would overwrite the downloaded working binaries. Ya don't wanna do that.
I have disabled driver components that are not necessary for the B2x0, but building with all of this turned on works too.
[Configure] and [Generate] There should not be any errors.
NOTE: you will see "Boost_DIR-NOTFOUND"... this boost installation does not include a .cmake file, so the lack of this .cmake file is what the winge is about. The Boost_DEBUG will cause the BOOST environment to be dumped in the window.
NOTE: make quite certain that LIBUSB_FOUND = TRUE in the log window. It seems that LIBUSB is "slippery" and gets dropped out of the config for some reason. This might be some subtle issue with cmake 3.0.0. Check the LIBUSB_* variables again and configure/generate until is works.
Open VS2010, open the UHD.sln "Solution" file, and the many executables will show up. [Build][Solution] - 10 minutes later should be all built.
Select INSTALL [Build][Build INSTALL] will place the binaries in the directory designated with CMAKE_INSTALL_PREFIX.
If you installed the binaries and images, then
If you are modifying one of the examples to your own needs, then just add that file to the CMakeLists.txt in the examples directory:
SET(example_sources
benchmark_rate.cpp
network_relay.cpp
rx_multi_samples.cpp
rx_samples_to_file.cpp
rx_samples_thread_to_file.cpp
rx_samples_to_udp.cpp
rx_timed_samples.cpp
test_dboard_coercion.cpp
test_messages.cpp
test_pps_input.cpp
test_timed_commands.cpp
transport_hammer.cpp
tx_bursts.cpp
tx_samples_from_file.cpp
tx_timed_samples.cpp
tx_waveforms.cpp
txrx_loopback_to_file.cpp
latency_test.cpp
fpgpio.cpp
)
CMake [Configure][Generate] re-creates the solution tree. VS2010 [Build][Solution] will then build the new entry in the project list.
Cmake has a handy "show changes", so these are my changed to the UHD baseline as final documentation:
Commandline options:
-DCMAKE_INSTALL_PREFIX:PATH="C:/ettus_b210/uhd_build/uhd/install" -DBoost_DATE_TIME_LIBRARY_DEBUG:FILEPATH="Boost_DATE_TIME_LIBRARY_DEBUG-NOTFOUND" -DLIBUSB_INCLUDE_DIRS:PATH="C:/libusbx/libusbx-1.0.18-win/include/libusbx-1.0" -DENABLE_USRP1:BOOL="0" -DENABLE_B100:BOOL="0" -DBoost_DIR:PATH="Boost_DIR-NOTFOUND" -DBOOST_INCLUDEDIR:PATH="C:/local/boost_1_55_0" -DLIBUSB_LIBRARIES:FILEPATH="C:/libusbx/libusbx-1.0.18-win/MS32/dll/libusb-1.0.lib" -DBoost_LIBRARY_DIR:PATH="C:/local/boost_1_55_0/lib32-msvc-10.0" -DBOOST_ALL_DYN_LINK:BOOL="1" -DBoost_DEBUG:BOOL="1" -DBoost_INCLUDE_DIR:PATH="C:/local/boost_1_55_0/boost" -DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING="/debug /INCREMENTAL"
Cache file:
CMAKE_INSTALL_PREFIX:PATH=C:/ettus_b210/uhd_build/uhd/install
Boost_DATE_TIME_LIBRARY_DEBUG:FILEPATH=Boost_DATE_TIME_LIBRARY_DEBUG-NOTFOUND
LIBUSB_INCLUDE_DIRS:PATH=C:/libusbx/libusbx-1.0.18-win/include/libusbx-1.0
ENABLE_USRP1:BOOL=0
ENABLE_B100:BOOL=0
Boost_DIR:PATH=Boost_DIR-NOTFOUND
BOOST_INCLUDEDIR:PATH=C:/local/boost_1_55_0
LIBUSB_LIBRARIES:FILEPATH=C:/libusbx/libusbx-1.0.18-win/MS32/dll/libusb-1.0.lib
Boost_LIBRARY_DIR:PATH=C:/local/boost_1_55_0/lib32-msvc-10.0
BOOST_ALL_DYN_LINK:BOOL=1
Boost_DEBUG:BOOL=1
Boost_INCLUDE_DIR:PATH=C:/local/boost_1_55_0/boost
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL