Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API will not compile on Windows #174

Closed
jaykuhn opened this issue May 1, 2018 · 16 comments
Closed

Python API will not compile on Windows #174

jaykuhn opened this issue May 1, 2018 · 16 comments

Comments

@jaykuhn
Copy link

jaykuhn commented May 1, 2018

I have easily built the standard interface on Windows. However on Windows I am having problems. I believe they are related to versioning. I have checked out the latest Git code for the python branch. I am using boost 1.58. Some of the things I noticed.
• CMake fails because BOOST_PYTHON_FOUND is not found. I have set the recommended variables. I can make it complete by adding BOOT_PYTHON_FOUND true in the CMake GUI.
• Transport/zero_copy uses socket.native(.. However in later versions of boost is depreciated and the call is to native_handle. However 1.58 versions of the boost binaries only go up to VS version 12.
• The maint branch calls native_handle.
• I get compiler errors such as:
2> libusb1_base.cpp
2>C:\Users\Jay\Ettus\git_python_api\uhd\host\lib\transport\libusb1_base.cpp(394):
error C2600: 'uhd::transport::usb_device_handle::~usb_device_handle' : cannot define a compiler-generated special member function (must be declared in the class first)

• I have also seen compiler errors complain about definition of a Virtual method.
• I want to try a latter VS executable but boost 1.53 binaries at sourceforge only go up to msvc-12.0

Jay

@brentstapleton
Copy link
Contributor

Hi @jaykuhn, the Python API has recently been updated to include a lot of fixes and features from the UHD master branch. Has the update fixed the issues you saw?

@michael-west
Copy link
Contributor

Closing for now due to no update from user. Please re-open if not fixed.

The Python API is now merged into the master branch and will be included in the upcoming UHD 3.13.0.0 release.

@mbr0wn
Copy link
Contributor

mbr0wn commented Jul 18, 2018

...also, it builds on Windows. @jaykuhn if you're having issues please get back to us, we've noticed that only certain versions of Python and Boost work on Windows.

@jaykuhn
Copy link
Author

jaykuhn commented Jul 26, 2018 via email

@jaykuhn
Copy link
Author

jaykuhn commented Jul 30, 2018 via email

@trungnob
Copy link
Contributor

trungnob commented Jul 30, 2018

hi Jay,
I've successfully compiled PythonAPI with following:
1/ Visual studio 2017 x64 on Windows 10. (Version 15.7.4)
2/ Python2.7 x64( not the one come with Visual studio) with numpy installed
3/ BoostPython 1.65.1 or 1.66 x64 non-static non-debug.
4/ UHD release build only (non debug build and non static linking)

@jaykuhn
Copy link
Author

jaykuhn commented Jul 31, 2018 via email

@jaykuhn
Copy link
Author

jaykuhn commented Aug 1, 2018 via email

@jaykuhn
Copy link
Author

jaykuhn commented Aug 2, 2018

Trung,

With a lot of trial and error I am getting close. I could use more instruction on how to install.
Current error is:
ImportError: cannot import name libpyuhd

There is no file or directory called libpyund. The string does appear inside of of pyuhd.dll

Visual Studio BUILD and INSTAL finished with no error:

I am using sample code from https://kb.ettus.com/UHD_Python_API

At first import uhd was not found. So I added C:/Program Files/UHD/lib/site-packages and now found.

C:\Program Files\UHD\bin;

Jay

@trungnob
Copy link
Contributor

trungnob commented Aug 3, 2018

@jaykuhn sorry for the late reply. I still don't see your email. I think you may send to the wrong address.
But I'm glad that you got it compiled! It meant it is 90% done. The installation is a bit of weird first of:
1/ Add to system PATH the path to boost python library (.dll)
2/ Add to system PATH the path to libusb.dll ( I assumed you build with usb dll)
3/ Add to system PATH the path to pyuhd.dll (which is UHD/lib/python/pyuhd.dll)
4/ change file name pyuhd.dll -> libpyuhd.pyd
5/ complete adding system PATH as you said above UHD\bin and UHD\lib\examples\ etc ... to all the UHD executable.

@jaykuhn
Copy link
Author

jaykuhn commented Aug 3, 2018 via email

@trungnob
Copy link
Contributor

trungnob commented Aug 3, 2018

I'm not familiar with Anaconda but that error telling me that the path to numpy's pyd files some what not correct.
In previous procedures, I actually missed the python path which may not be in the system path.
On my system the numpy's pyd files are at C:\Program Files\Python27\Lib\Site-packages\numpy\ core\multiarray.pyd

@jaykuhn
Copy link
Author

jaykuhn commented Aug 4, 2018 via email

@jaykuhn
Copy link
Author

jaykuhn commented Aug 6, 2018 via email

@jaykuhn
Copy link
Author

jaykuhn commented Aug 6, 2018 via email

@mbr0wn
Copy link
Contributor

mbr0wn commented Aug 6, 2018

These questions are better suited to the mailing list and unrelated to the original issue. Please send them to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants