diff --git a/ChangeLog.md b/ChangeLog.md index a3854186..46557996 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,10 @@ * Corrected handling of spurious wakes in FrameGrabber * Fixed ComputeCartesian python unit test to properly blank out invalid pixels + * Changed `build` Dockerfiles to use pip for numpy/pytest + * Fixed race condition in PCICClient unit tests + * Changed setup.py to honor the environment variables per the Windows installation instructions + * Updated installation documentation for Windows ## Changes between ifm3d 0.15.1 and 0.16.0 * Created new `framegrabberudp` module for consuming data over UDP interface diff --git a/doc/python.md b/doc/python.md index dde7a8a2..4678e72b 100644 --- a/doc/python.md +++ b/doc/python.md @@ -190,10 +190,10 @@ The `pybind11` module takes one additional dependency: #### [Pybind11](https://github.com/pybind/pybind11) Download: -``` +``` cd %IFM3D_BUILD_DIR% git clone https://github.com/pybind/pybind11.git -cd pybind11 +cd pybind11 git checkout tags/v2.3.0 ``` @@ -201,7 +201,7 @@ Build: ``` mkdir build cd build -cmake -A x64 -DPYBIND11_TEST=OFF -DCMAKE_INSTALL_PREFIX=%IFM3D_BUILD_DIR%\install .. +cmake -G %IFM3D_CMAKE_GENERATOR% -DPYBIND11_TEST=OFF -DCMAKE_INSTALL_PREFIX=%IFM3D_BUILD_DIR%\install .. cmake --build . --clean-first --config %CONFIG% --target INSTALL ``` @@ -241,9 +241,9 @@ $ python -m pip install pytest The tests can be executed as follows: -``` -$ cd modules/pybind11/test -$ python -m pytest . +``` +$ cd modules/pybind11/test +$ python -m pytest . ``` ## Usage diff --git a/doc/windows.md b/doc/windows.md index 23aa0790..f211f157 100644 --- a/doc/windows.md +++ b/doc/windows.md @@ -214,7 +214,7 @@ Build: cd %IFM3D_BUILD_DIR%\opencv mkdir build_cmake cd build_cmake -cmake -G %IFM3D_CMAKE_GENERATOR% -DWITH_CUDA=OFF -DWITH_EIGEN=ON -DWITH_IPP=ON -DWITH_JASPTER=ON -DWITH_JPEG=ON -DWITH_OPENEXR=OFF -DWITH_OPENNI=OFF -DWITH_PNG=ON -DWITH_QT=OFF -DWITH_QT_OPENGL=OFF -DWITH_TBB=OFF -DWITH_TIFF=ON -DWITH_VIDEOINPUT=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_PACKAGE=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_openvc_python=OFF -DCMAKE_PREFIX_PATH="%IFM3D_BUILD_DIR%\install" -DCMAKE_INSTALL_PREFIX=%IFM3D_BUILD_DIR%\install .. +cmake -G %IFM3D_CMAKE_GENERATOR% -DWITH_CUDA=OFF -DWITH_EIGEN=ON -DWITH_IPP=ON -DWITH_JASPTER=ON -DWITH_JPEG=ON -DWITH_OPENEXR=OFF -DWITH_OPENNI=OFF -DWITH_PNG=ON -DWITH_QT=OFF -DWITH_QT_OPENGL=OFF -DWITH_TBB=OFF -DWITH_TIFF=ON -DWITH_VIDEOINPUT=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_PACKAGE=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DCMAKE_PREFIX_PATH="%IFM3D_BUILD_DIR%\install" -DCMAKE_INSTALL_PREFIX=%IFM3D_BUILD_DIR%\install .. cmake --build . --clean-first --config %CONFIG% --target INSTALL ``` diff --git a/docker/build/amd64/ubuntu-ros/16.04/Dockerfile b/docker/build/amd64/ubuntu-ros/16.04/Dockerfile index 0965f708..9705d914 100644 --- a/docker/build/amd64/ubuntu-ros/16.04/Dockerfile +++ b/docker/build/amd64/ubuntu-ros/16.04/Dockerfile @@ -29,13 +29,16 @@ RUN apt-get update && \ libxmlrpc-c++8-dev \ python-dev \ python3-dev \ - python-pytest \ - python3-pytest \ - python-numpy \ - python3-numpy \ + python-pip \ + python3-pip \ locales \ sudo +RUN yes | python -m pip install --upgrade pip setuptools +RUN yes | python -m pip install pytest numpy +RUN yes | python3 -m pip install --upgrade pip setuptools +RUN yes | python3 -m pip install pytest numpy + RUN mkdir -p /opt && \ cd /opt && \ git clone https://github.com/pybind/pybind11 && \ diff --git a/docker/build/amd64/ubuntu-ros/18.04/Dockerfile b/docker/build/amd64/ubuntu-ros/18.04/Dockerfile index aeca90c8..f817caa0 100644 --- a/docker/build/amd64/ubuntu-ros/18.04/Dockerfile +++ b/docker/build/amd64/ubuntu-ros/18.04/Dockerfile @@ -29,13 +29,16 @@ RUN apt-get update && \ libxmlrpc-c++8-dev \ python-dev \ python3-dev \ - python-pytest \ - python3-pytest \ - python-numpy \ - python3-numpy \ + python-pip \ + python3-pip \ locales \ sudo +RUN yes | python -m pip install --upgrade pip setuptools +RUN yes | python -m pip install pytest numpy +RUN yes | python3 -m pip install --upgrade pip setuptools +RUN yes | python3 -m pip install pytest numpy + RUN mkdir -p /opt && \ cd /opt && \ git clone https://github.com/pybind/pybind11 && \ diff --git a/docker/build/amd64/ubuntu/16.04/Dockerfile b/docker/build/amd64/ubuntu/16.04/Dockerfile index 074d8ce2..2e51c171 100644 --- a/docker/build/amd64/ubuntu/16.04/Dockerfile +++ b/docker/build/amd64/ubuntu/16.04/Dockerfile @@ -32,10 +32,8 @@ RUN apt-get update && \ libproj-dev \ python-dev \ python3-dev \ - python-pytest \ - python3-pytest \ - python-numpy \ - python3-numpy \ + python-pip \ + python3-pip \ build-essential \ coreutils \ findutils \ @@ -43,6 +41,11 @@ RUN apt-get update && \ locales \ sudo +RUN yes | python -m pip install --upgrade pip setuptools +RUN yes | python -m pip install pytest numpy +RUN yes | python3 -m pip install --upgrade pip setuptools +RUN yes | python3 -m pip install pytest numpy + RUN mkdir -p /opt && \ cd /opt && \ git clone https://github.com/pybind/pybind11 && \ diff --git a/docker/build/amd64/ubuntu/18.04/Dockerfile b/docker/build/amd64/ubuntu/18.04/Dockerfile index b5a24a97..1c4fa9db 100644 --- a/docker/build/amd64/ubuntu/18.04/Dockerfile +++ b/docker/build/amd64/ubuntu/18.04/Dockerfile @@ -32,10 +32,8 @@ RUN apt-get update && \ libproj-dev \ python-dev \ python3-dev \ - python-pytest \ - python3-pytest \ - python-numpy \ - python3-numpy \ + python-pip \ + python3-pip \ build-essential \ coreutils \ findutils \ @@ -43,6 +41,9 @@ RUN apt-get update && \ locales \ sudo +RUN yes | python -m pip install pytest numpy +RUN yes | python3 -m pip install pytest numpy + RUN mkdir -p /opt && \ cd /opt && \ git clone https://github.com/pybind/pybind11 && \ diff --git a/modules/pcicclient/test/ifm3d-pcicclient-tests.cpp b/modules/pcicclient/test/ifm3d-pcicclient-tests.cpp index 93307162..db87926f 100644 --- a/modules/pcicclient/test/ifm3d-pcicclient-tests.cpp +++ b/modules/pcicclient/test/ifm3d-pcicclient-tests.cpp @@ -16,7 +16,7 @@ class PCICClientTest : public ::testing::Test virtual void TearDown() { - + } ifm3d::Camera::Ptr cam_; @@ -80,30 +80,30 @@ TEST_F(PCICClientTest, PCICTimeout) EXPECT_THROW(std::make_shared(cam_), ifm3d::error_t); return; } - - ifm3d::PCICClient::Ptr pc = std::make_shared(cam_); + + ifm3d::PCICClient::Ptr pc = std::make_shared(cam_); std::unique_ptr reboot_thread_ = std::make_unique([&]{ - + EXPECT_NO_THROW(this->cam_->Reboot(ifm3d::Camera::boot_mode::PRODUCTIVE)); - - std::this_thread::sleep_for(std::chrono::seconds(1)); - }); + std::this_thread::sleep_for(std::chrono::seconds(5)); - if(reboot_thread_ && reboot_thread_->joinable()) reboot_thread_->join(); + }); + + if(reboot_thread_ && reboot_thread_->joinable()) reboot_thread_->join(); for(int i = 0; i < 20; ++i) - { + { result.clear(); if(!pc->Call("V?",result,5000)) - { + { pc = std::make_shared(cam_); - } + } } - + EXPECT_GT(result.size(), 0); pc->Stop(); - + } diff --git a/setup.py b/setup.py index 4a35cd9b..938a799d 100644 --- a/setup.py +++ b/setup.py @@ -85,8 +85,17 @@ def build_extension(self, ext): if platform.system() == "Windows": cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)] - if sys.maxsize > 2**32: + + if 'IFM3D_BUILD_DIR' in os.environ: + cmake_args += ['-DCMAKE_PREFIX_PATH=' + os.environ['IFM3D_BUILD_DIR'] + '\\install'] + + # If a generator was specified, use it. Otherwise use the machine's + # architecture and the default generator. + if 'IFM3D_CMAKE_GENERATOR' in os.environ: + cmake_args += ['-G', os.environ['IFM3D_CMAKE_GENERATOR'].replace('"','')] + elif sys.maxsize > 2**32: cmake_args += ['-A', 'x64'] + build_args += ['--', '/m'] else: cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]