Skip to content

Commit

Permalink
Merge pull request #36 from areaDetector/libuvc-epics-build
Browse files Browse the repository at this point in the history
Build libuvc via EPICS build system
  • Loading branch information
jwlodek committed Dec 1, 2020
2 parents a78ce52 + 7fbd342 commit 6895b2e
Show file tree
Hide file tree
Showing 22 changed files with 8,770 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bin/
*~
lib/
*.so*
libuvc/
os/
configuration/
uvc_locater
Expand All @@ -24,4 +23,4 @@ OLD_FILES/
*_BAK.adl
ptz_test
pt_test
zoom_test
zoom_test
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ ADUVC requires libusb, libuvc, epics-base, epics-modules, ADCore, and ADSupport.
Release Notes
=============


R1-6 (1-December-2020)
----
* Features Added
* `libuvc` now builds via the EPICS build system


R1-5 (29-October-2020)
----
* Features Added
Expand Down
7 changes: 7 additions & 0 deletions docs/ADUVC/ADUVC.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ Release Notes
.. rubric:: Release Notes
:name: release-notes-1

.. rubric:: R1-6 (1-December-2020)
:name: r1-6-1-december-2020

- Features Added

- libuvc now builds via the EPICS build system

.. rubric:: R1-5 (29-October-2020)
:name: r1-5-29-october-2020

Expand Down
10 changes: 8 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ <h4>Usage:</h4>
<h4>Release Notes:</h4>
<div class="text-section-local">
<!--RELEASE START-->

<h1>Release Notes</h1>
<h4>R1-6 (1-December-2020)</h4>
<ul>
<li>Features Added<ul>
<li><code>libuvc</code> now builds via the EPICS build system</li>
</ul>
</li>
</ul>
<h4>R1-5 (29-October-2020)</h4>
<ul>
<li>
Expand Down Expand Up @@ -231,7 +237,7 @@ <h4>R0-1 (Beta) (5-November-2018)</h4>
<li>No custom screens (uses ADBase screen)</li>
</ul>
</li>
</ul></ul> <!--RELEASE END-->
</ul></ul></ul> <!--RELEASE END-->
</div>
<hr />
<h4>Issues and pull requests:</h4>
Expand Down
4 changes: 2 additions & 2 deletions docs/scripts/updateReleaseNotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# Created on: January 10, 2019
#

python -m markdown ../../RELEASE.md > output.html
python insertMarkdown.py
python3 -m markdown ../../RELEASE.md > output.html
python3 insertMarkdown.py
31 changes: 22 additions & 9 deletions uvcSupport/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
TOP=..
include $(TOP)/configure/CONFIG

SRC_DIRS += ../include

SRC_DIRS += ../libuvc

INC += libuvc/libuvc.h
INC += libuvc/libuvc_config.h
INC += libuvc/libuvc_internal.h
INC += utlist.h


# should be able to compile libuvc on arm
ifeq (linux-x86_64, $(findstring linux-x86_64, $(T_A)))
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.a
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so.0
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so.0.0.6
LIBRARY = uvc
endif

# Should be able to compile libuvc on arm
ifeq (linux-arm, $(findstring linux-arm, $(T_A)))
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.a
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so.0
LIB_INSTALLS_Linux += ../os/$(EPICS_HOST_ARCH)/libuvc.so.0.0.6
LIBRARY = uvc
endif

# TODO: Try building libuvc on windows
#ifeq (windows-x64, $(findstring windows-x64, $(T_A)))
#endif

uvc_SRCS += ctrl.c
uvc_SRCS += ctrl-gen.c
uvc_SRCS += device.c
uvc_SRCS += diag.c
uvc_SRCS += frame.c
uvc_SRCS += frame-mjpeg.c
uvc_SRCS += init.c
uvc_SRCS += misc.c
uvc_SRCS += stream.c

uvc_LIBS += jpeg
uvc_SYS_LIBS += usb-1.0

include $(TOP)/configure/RULES
2 changes: 1 addition & 1 deletion uvcSupport/cameraDetector/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all:
g++ -I../include -L../os/linux-x86_64 uvc_locater.cpp -o uvc_locater ../os/linux-x86_64/libuvc.a -lusb-1.0 -lpthread
g++ -I../include -L../../lib/linux-x86_64 uvc_locater.cpp -o uvc_locater ../../lib/linux-x86_64/libuvc.a -lusb-1.0 -lpthread
clean:
rm uvc_locater
19 changes: 11 additions & 8 deletions uvcSupport/install-libuvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ EPICS_HOST_ARCH=linux-x86_64
echo "Building libuvc with expected EPICS target $EPICS_HOST_ARCH..."


if [ -d 'libuvc' ];
if [ -d 'libuvc-build' ];
then
echo "Removing existing libuvc build artefacts..."
rm -rf libuvc
rm -rf libuvc-build
fi

# We perform the build in a secondary location
mkdir libuvc-build
cd libuvc-build

echo "Grabbing libuvc..."
# Install libuvc by cloning from github and running cmake
Expand All @@ -23,7 +26,7 @@ cmake -DCMAKE_BUILD_TYPE=Release ..
make

# return to support directory
cd ../..
cd ../../..

# Remove existing include folder if necessary.
if [ -d 'include' ];
Expand All @@ -33,13 +36,13 @@ fi

echo "Copying and updating include files..."
# Copy the library include files
cp -r libuvc/include .
cp -r libuvc-build/libuvc/include .


# Remove template file and replace with auto-populated
# header file generated by cmake build
rm include/libuvc/libuvc_config.h.in
cp libuvc/build/include/libuvc/libuvc_config.h include/libuvc/.
cp libuvc-build/libuvc/build/include/libuvc/libuvc_config.h include/libuvc/.

# The internal uvc include file has a failing include for libusb.
sed -i "s/#include <libusb.h>/#include <libusb-1.0\/libusb.h>/g" include/libuvc/libuvc_internal.h
Expand All @@ -64,9 +67,9 @@ fi
echo "Copying compiled library files..."
mkdir os
mkdir os/$EPICS_HOST_ARCH
cp libuvc/build/libuvc.a os/$EPICS_HOST_ARCH/.
cp libuvc/build/libuvc.so* os/$EPICS_HOST_ARCH/.
cp libuvc-build/libuvc/build/libuvc.a os/$EPICS_HOST_ARCH/.
cp libuvc-build/libuvc/build/libuvc.so* os/$EPICS_HOST_ARCH/.

# Remove build artefacts.
rm -rf libuvc
rm -rf libuvc-build
echo "Finished installing libuvc."
Loading

0 comments on commit 6895b2e

Please sign in to comment.