【问题标题】:Build UHD with CMake for Windows XP(32-bit)使用 CMake for Windows XP(32 位)构建 UHD
【发布时间】:2014-09-29 10:29:03
【问题描述】:

美好的一天。

请详细解释使用 CMake for Windows XP 构建 UHD 的过程。 我关注the instructions from the developer,但它们很短,我第一次使用 CMake。 我下载并安装了所有必要的组件:CMake、Boost、Python with Cheetah 和 Doxygen。为简单起见,所有这些组件都安装在驱动器 C:\ 上。我启动了 CMake(用于 MSVC 2010 编译器)并获得了构建尝试的输出:

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".

我对为什么找不到提升特别感兴趣(指定哪个文件夹到变量Boost_DIR ??),如何包含LIBUHD(我尝试手动创建ENABLE_LIBUHD 类型的ENABLE_LIBUHD 变量BOOL 并分配它的值为 1 - 但没有任何变化)。

一切都非常不清楚,请尽可能详细。

谢谢!

【问题讨论】:

    标签: boost cmake drivers windows-xp-sp3 usrp


    【解决方案1】:

    你想加入 usrp-users 邮件列表。

    我设法失去了我的构建,失去了我的公式,所以我不得不重现它。现在我想我已经完成了这个过程,我会改进我在这里发布的公式:

    1) Git 源代码 - git clone git://github.com/EttusResearch/uhd.git 我在 c:\ettus_b210\uhd_build 中做了 GIT,它创建了目录“uhd”

    2) 安装 boost http://sourceforge.net/projects/boost/files/boost-binaries/ 我用的是 1_55_0。此发行版将安装在 c:\local\boost_1_55_0 为您的构建环境选择构建 - 我使用的是 Windows 32 位 VS2010。

    3) 安装 libusb.http://sourceforge.net/projects/libusbx/files/releases/1.0.18/binaries/ 此处引用的“libusbx”已包含在此版本的 libusb 中。我的安装在 C:\libusbx\libusbx-1.0.18-win

    4) 安装 Python 和指示的 Python 工具

    下载并安装 Python(最低 2.6.x)二进制文件。我推荐 Python 2.7,它带有简单的安装脚本,可以帮助你获得 Cheetah。 (如果你安装了 MATLAB,那么你可能有 Python2.7) https://www.python.org/download/

    安装猎豹 首先安装 Python 设置工具 https://pypi.python.org/pypi/setuptools 打开一个cmd窗口并执行它 下载解压包后,在cmd窗口运行easy_install cheetah

    检查正在调用哪个 Python 版本。

    这里最简单的方法是安装 Python27,然后使用 easy_install 脚本安装 Cheetah。

    如果在 cmd 窗口中运行以下命令显示与 python 2.7 不同的内容,则修改注册表项(本地计算机和 ROOT)。 在命令行窗口中运行:

    ftype|find /I "python"
    

    你应该得到类似的东西:

    Python.CompiledFile="C:\Python27\python.exe" "%1" %*
    Python.File="C:\Python27\python.exe" "%1" %*
    Python.NoConFile="C:\Python27\pythonw.exe" "%1" %*
    

    还要确保这些条目具有以下条目中显示的正确版本:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe 
    

    5) 安装 cmake - 我使用的是 3.0.0,但任何超过 2.8.0 的版本都可以使用。

    在 CMake 对话框中:

    • 指向源 c:\ettus_b210\uhd_build\uhd
    • 编译目录 c:\ettus_b210\uhd_build\uhd\build

      注意:这是您希望构建内容的选择 - 它不会在源目录中构建

    • 启用高级视图

    • BOOST_ALL_DYN_LINK [X]
    • Boost_DEBUG=True

      注意:此标志的大小写很重要

    • BOOST_INCLUDE_DIR=c:\local\boost_1_55_0

      注意:这是包含目录“boost”的目录,这是包含 boost 标头的方式

    • BOOST_LIBRARYDIR=c:\local\boost_1_55_0\lib32-msvc-10.0

      注意:我使用的是 VS2010,这是该构建环境的库。

    • 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

      注意:这是 DLL 子目录中的 .lib 文件 - 他们希望库本身而不是包含目录

    • CMAKE_INSTALL_PREFIX=c:/ettus_b210/install

      注意:默认将其构建到“C:\Program Files (x86)\UHD”中,这将覆盖下载的工作二进制文件。你不想那样做。

    • 我已禁用 B2x0 不需要的驱动程序组件,但在所有这些开启的情况下构建也可以。

    • [配置] 和 [生成] 不应该有任何错误。

      注意:您将看到“Boost_DIR-NOTFOUND”...此 boost 安装不包含 .cmake 文件,因此缺少此 .cmake 文件是winge的意义所在。 Boost_DEBUG 将导致 BOOST 环境转储到窗口中。

      注意:确保在日志窗口中 LIBUSB_FOUND = TRUE。似乎 LIBUSB 很“滑”,并且由于某种原因被从配置中删除。这可能是 cmake 3.0.0 的一些微妙问题。再次检查 LIBUSB_* 变量并配置/生成直到工作正常。

    打开VS2010,打开UHD.sln“解决方案”文件,会出现很多可执行文件。 [Build][Solution] - 10 分钟后应该全部构建完成。

    选择 INSTALL [Build][Build INSTALL] 会将二进制文件放在使用 CMAKE_INSTALL_PREFIX 指定的目录中。

    如果你安装了二进制文件和图像,那么

    如果您根据自己的需要修改示例之一,则只需将该文件添加到示例目录中的 CMakeLists.txt 中:

    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] 重新创建解决方案树。 VS2010 [Build][Solution] 将在项目列表中构建新条目。

    Cmake 有一个方便的“显示更改”,因此我将这些更改为 UHD 基线作为最终文档:

    命令行选项:

    -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
    

    【讨论】:

    • 太棒了!谢谢你很配!问题是提升:我自己构建了它并且 BOOST_ALL_DYN_LINK 被禁用。您似乎已经为 MS Win 32 + MS VC 2010 一劳永逸地解决了这个问题。您不告诉我们您是如何使用这些示例的吗?想用С++写一个程序(用Qt,编程没问题)研究从驱动向设备传输数据(不带设备),但不知道从何下手。
    • 库尔。我强烈建议加入 usrp-users 组;他们对我很有帮助。我正在与一位同事合作,使用 b210 评估项目的 AD9361。我已经扩展了驱动程序以允许我直接访问 SPI 寄存器。如果没有与 b210 设备通信,此驱动程序将无能为力...
    【解决方案2】:

    对于所有在使用 NSIS 构建二进制安装程序时遇到困难的人来说,只是上面的补充(为了更好地理解,我复制了上面的路径): 如果构建失败并出现错误“!宏:名为“RemoveSection”的宏已经存在/找到”,只需编辑目录 c:/ettus_b210/uhd_build/uhd/build_CPack_Packages/win32/NSIS 中的 NSIS 项目文件。搜索“RemoveSection”并将每个条目替换为“RemoveSection_CPack”。更改 NSIS 项目文件后,只需右键单击 NSIS 项目文件,然后单击“编译 NSIS 脚本”。 NSIS 打开并正在构建二进制安装程序。

    这应该至少在 NSIS 3.02.1 之前有效。

    【讨论】:

      猜你喜欢
      • 2014-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-17
      • 2013-11-14
      • 2012-01-26
      • 1970-01-01
      • 2011-06-19
      相关资源
      最近更新 更多