EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
942 stars 645 forks source link

Source build failure on Windows for UHD 4.5.0.0 when building with Python API and SIM #708

Open icyveins7 opened 8 months ago

icyveins7 commented 8 months ago

Issue Description

When building UHD 4.5.0.0 from source (downloading the source from Releases directly) and enabling the LibUHD - Python API and SIM (i.e. simulator), the build fails when processing host\build\python\simulator\usrp_mpm.vcxproj. Internally, this calls a setup.py from host\build\python\simulator, which incorrectly parses the package_dir value in the dictionary.

In my case, this resulted in the path being written as

'E:/uhd-4.5.0.0/host/build/python/simulator'

which caused MSVC to interpret the path with the escaped characters, causing the following error:

error : package directory 'E:uhd-4.5.0.0\host\build\python\simulator\usrp_mpm' does not exist

Note the missing backslash after the drive letter.

Setup Details

UHD 4.5.0.0 source build (downloaded from Releases page of github) Windows 10 Visual Studio 2022 CMake 3.27.7 Python 3.11 (Built with a virtual environment interpreter)

Expected Behavior

Build should succeed.

Actual Behaviour

Error when processing host\build\python\simulator\usrp_mpm.vcxproj.

error : package directory 'E:uhd-4.5.0.0\host\build\python\simulator\usrp_mpm' does not exist

Steps to reproduce the problem

CMake as usual. Enable Python API during CMake. Build.

Additional Information

The fix for this was simple: I changed my line in host\build\python\simulator\setup.py from

package_dir={'': 'E:/uhd-4.5.0.0/host/build/python/simulator'},

to

package_dir={'': r'E:\uhd-4.5.0.0\host\build\python\simulator'},

This is odd, because in the parent folder, the host\build\python\setup.py file does it correctly:

package_dir={'': r'E:\uhd-4.5.0.0\host\build\python'},