Photometrics / PyVCAM

Python3.X wrapper for Photometrics and QImaging PVCAM based cameras
MIT License
36 stars 17 forks source link

install / build fails on linux #8

Closed jdrogers42 closed 3 years ago

jdrogers42 commented 3 years ago

I just tried installing on debian and get setup.py install fails to build. Attaching the output below. I tried grabbing the previous version from git and am able to install and access the camera, but I get memory allocation errors when I try to use cam.get_frame(). I am more than happy to help test and debug. I will roll up my sleeves in the next few days and see if I can track down the build errors, but thought I would post now. Thanks! JDR

jdrogers@eddie:~/Documents/Code/TeledyneDalsa/PyVCAM/pyvcam_wrapper$ python3 setup.py build Operating system: Linux Machine architecture: x86_64


Pre-install necessary packages

sudo apt-get install python3-pip

sudo pip3 install numpy


Build package: sudo -E python3 setup.py build

Install package: sudo -E python3 setup.py install

Create Wheel dist: sudo -E python3 setup.py sdist bdist_wheel

Uninstall package: sudo pip3 uninstall pyvcam


running build running build_py running build_ext building 'pyvcam.pvc' extension x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/opt/pvcam/sdk/include/ -I/usr/include/python3.9 -c src/pyvcam/pvcmodule.cpp -o build/temp.linux-x86_64-3.9/src/pyvcam/pvcmodule.o -std=c++11 In file included from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822, from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from src/pyvcam/pvcmodule.cpp:1: /usr/lib/python3/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~ src/pyvcam/pvcmodule.cpp: In function ‘PyObject pvc_check_frame_status(PyObject, PyObject)’: src/pyvcam/pvcmodule.cpp:687:29: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 687 | statusStr = "READOUT_NOT_ACTIVE"; | ^~~~~~~~ src/pyvcam/pvcmodule.cpp:690:29: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 690 | statusStr = "EXPOSURE_IN_PROGRESS"; | ^~~~~~ src/pyvcam/pvcmodule.cpp:693:29: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 693 | statusStr = "READOUT_IN_PROGRESS"; | ^~~~~ src/pyvcam/pvcmodule.cpp:697:33: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 697 | statusStr = "READOUT_COMPLETE"; | ^~~~~~ src/pyvcam/pvcmodule.cpp:699:33: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 699 | statusStr = "FRAME_AVAILABLE"; | ^~~~~ src/pyvcam/pvcmodule.cpp:710:29: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 710 | statusStr = "READOUT_FAILED"; | ^~~~ src/pyvcam/pvcmodule.cpp: In function ‘PyObject pvc_get_frame(PyObject, PyObject)’: src/pyvcam/pvcmodule.cpp:861:17: error: ‘md_frame_header_v3’ was not declared in this scope; did you mean ‘md_frame_header’? 861 | md_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3>(pMetaDataFrameHeader); | ^~~~~~ | md_frame_header src/pyvcam/pvcmodule.cpp:861:37: error: ‘pMetaDataFrameHeaderV3’ was not declared in this scope; did you mean ‘pMetaDataFrameHeader’? 861 | md_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3>(pMetaDataFrameHeader); | ^~~~~~ | pMetaDataFrameHeader src/pyvcam/pvcmodule.cpp:861:79: error: ‘md_frame_header_v3’ does not name a type; did you mean ‘md_frame_header’? 861 | md_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3>(pMetaDataFrameHeader); | ^~~~~~ | md_frame_header src/pyvcam/pvcmodule.cpp:861:97: error: expected ‘>’ before ‘’ token 861 | md_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3*>(pMetaDataFrameHeader); | ^

src/pyvcam/pvcmodule.cpp:861:97: error: expected ‘(’ before ‘’ token 861 | md_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3>(pMetaDataFrameHeader); | ^ | ( src/pyvcam/pvcmodule.cpp:861:98: error: expected primary-expression before ‘>’ token 861 | d_frame_header_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3*>(pMetaDataFrameHeader); | ^

src/pyvcam/pvcmodule.cpp:861:121: error: expected ‘)’ before ‘;’ token 861 | r_v3 pMetaDataFrameHeaderV3 = reinterpret_cast<md_frame_header_v3>(pMetaDataFrameHeader); | ^ | ) src/pyvcam/pvcmodule.cpp: In function ‘PyObject pvc_finish_seq(PyObject, PyObject)’: src/pyvcam/pvcmodule.cpp:995:72: warning: passing NULL to non-pointer argument 3 of ‘rs_bool pl_exp_finish_seq(int16, void, int16)’ [-Wconversion-null] 995 | if (PV_OK != pl_exp_finishseq(hCam, camInstance.frameBuffer, NULL)) { | ^~~~ In file included from src/pyvcam/pvcmodule.h:11, from src/pyvcam/pvcmodule.cpp:10: /opt/pvcam/sdk/include/pvcam.h:3761:73: note: declared here 3761 | rs_bool PV_DECL pl_exp_finish_seq(int16 hcam, void pixel_stream, int16 hbuf); | ~~^~~~ src/pyvcam/pvcmodule.cpp: In function ‘PyObject pvc_sw_trigger(PyObject, PyObject)’: src/pyvcam/pvcmodule.cpp:1210:22: error: ‘pl_exp_trigger’ was not declared in this scope 1210 | rs_bool result = pl_exp_trigger(hCam, &flags, value); | ^~~~~~ src/pyvcam/pvcmodule.cpp:1216:23: error: ‘PL_SW_TRIG_STATUS_TRIGGERED’ was not declared in this scope 1216 | else if (flags != PL_SW_TRIG_STATUS_TRIGGERED) { | ^~~~~~~ In file included from src/pyvcam/pvcmodule.cpp:10: src/pyvcam/pvcmodule.h: At global scope: src/pyvcam/pvcmodule.h:48:13: warning: ‘my_set_callback_docstring’ defined but not used [-Wunused-variable] 48 | static char my_set_callback_docstring[] = "Initializes a python callback"; | ^~~~~~~~~ src/pyvcam/pvcmodule.h:37:13: warning: ‘get_enum_param_docstring’ defined but not used [-Wunused-variable] 37 | static char get_enum_param_docstring[] = "Returns the enumerated value of the specified parameter at index."; | ^~~~~~~~ error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

stevebellinger commented 3 years ago

Hello,

It appears you have an outdated pvcam.h which is part of the PVCAM SDK. The SDK version you require has not been released for Linux. I apologize for claiming the build is supported in Linux since the prerequisites are not available to the public. I'm working with the team to rectify this situation.

In the meantime, is Windows an option?

Thank you

jdrogers42 commented 3 years ago

Ah, that makes sense. I will try today to get it working under windows and look forward to the public release of the updated sdk. Thank you for all the work you do!

kasliwalr commented 3 years ago

Hello,

It appears you have an outdated pvcam.h which is part of the PVCAM SDK. The SDK version you require has not been released for Linux. I apologize for claiming the build is supported in Linux since the prerequisites are not available to the public. I'm working with the team to rectify this situation.

In the meantime, is Windows an option?

Thank you

Could you send me the zipped version of the latest SDK so that I can use PyVCAM on Linux? We prefer to run it on Linux

stevebellinger commented 3 years ago

I can not send you the latest SDK. However the release is ready and should be added to the website shortly. I will update this issue accordingly when the SDK is available.

Thank you

stevebellinger commented 3 years ago

The latest SDK for Linux has been posted. https://www.photometrics.com/support/software-and-drivers#software

This version should support building PyVCAM although I have not yet verified. Once I confirm the posted version is compatible I will close this issue.

stevebellinger commented 3 years ago

I have confirmed that PyVCAM will build against PVCAM SDK 3.9.4.2.

jdrogers42 commented 3 years ago

Thank you Steve for the updates, I also have it working now. Great! One note for others, on Debian the install of pvcam sdk does not set the path for root, only for the user (which is probably good). But when you install the pyvcam, the default is to try toinstall in the system /usr/local/lib/python3.9/dist-packages/ which you can only do as root, but root does not see the path to the sdk. Easier to install as user with "python setup.py install --user".

stevebellinger commented 3 years ago

Great to hear. To work around root not seeing the user SDK environment variable I do the following. sudo -E python3 setup.py build