Build wpilib with cmake instead of gradle (#15)
* Move java lib install to /usr/local/frc/java * Build and install both debug and normal OpenCV libraries * Install OpenCV cmake files * Build OpenCV Java with version 8 target * Build static OpenCV for static allwpilib binaries * Move netconsoleTee install to /usr/local/frc/bin * Move multiCameraServer default app install to /usr/local/frc/bin * Install more FRC binaries * Fix /home/pi/zips/java-multiCameraServer.zip owner to pi:pi * Remove azure 60 minute timeout * Add openjdk-8-jdk to Azure docker image (this is needed for cmake to find javah as only cmake 3.9 is available)
This commit is contained in:
parent
0c1008defa
commit
43c710ec39
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -7,6 +7,3 @@
|
||||||
[submodule "deps/allwpilib"]
|
[submodule "deps/allwpilib"]
|
||||||
path = deps/allwpilib
|
path = deps/allwpilib
|
||||||
url = https://github.com/wpilibsuite/allwpilib.git
|
url = https://github.com/wpilibsuite/allwpilib.git
|
||||||
[submodule "deps/thirdparty-opencv"]
|
|
||||||
path = deps/thirdparty-opencv
|
|
||||||
url = https://github.com/wpilibsuite/thirdparty-opencv.git
|
|
||||||
|
|
|
@ -7,6 +7,6 @@ RUN apt-get -y update \
|
||||||
git vim parted \
|
git vim parted \
|
||||||
quilt realpath qemu-user-static debootstrap zerofree pxz zip dosfstools \
|
quilt realpath qemu-user-static debootstrap zerofree pxz zip dosfstools \
|
||||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file \
|
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file \
|
||||||
build-essential cmake python3 ant sudo \
|
build-essential cmake python3 ant sudo openjdk-8-jdk \
|
||||||
&& apt-get -y -t stretch-backports install openjdk-11-jdk \
|
&& apt-get -y -t stretch-backports install openjdk-11-jdk \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
|
@ -9,6 +9,8 @@ jobs:
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'Ubuntu 16.04'
|
vmImage: 'Ubuntu 16.04'
|
||||||
|
|
||||||
|
timeoutInMinutes: 0
|
||||||
|
|
||||||
container: pi-gen
|
container: pi-gen
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
17
deps/02-extract.sh
vendored
17
deps/02-extract.sh
vendored
|
@ -32,7 +32,22 @@ popd
|
||||||
# opencv sources
|
# opencv sources
|
||||||
tar xzf ../01-download/3.4.4.tar.gz
|
tar xzf ../01-download/3.4.4.tar.gz
|
||||||
mv opencv-3.4.4 opencv
|
mv opencv-3.4.4 opencv
|
||||||
cp ../thirdparty-opencv/arm-pi-gnueabihf.toolchain.cmake .
|
sed -i -e 's/javac sourcepath/javac target="1.8" source="1.8" sourcepath/' opencv/modules/java/jar/build.xml.in
|
||||||
|
|
||||||
|
# toolchain setup for opencv and wpilib
|
||||||
|
cp ../arm-pi-gnueabihf.toolchain.cmake .
|
||||||
cp -R ../thirdparty-opencv/jni .
|
cp -R ../thirdparty-opencv/jni .
|
||||||
|
tar xzf ../01-download/jdk_11*.tar.gz jdk/include
|
||||||
|
mkdir -p cmake-modules
|
||||||
|
cat > cmake-modules/FindJNI.cmake << EOF
|
||||||
|
set(JNI_INCLUDE_DIRS "${PWD}/jdk/include" "${PWD}/jdk/include/linux")
|
||||||
|
set(JNI_LIBRARIES )
|
||||||
|
set(JNI_FOUND YES)
|
||||||
|
set(JAVA_AWT_LIBRARY )
|
||||||
|
set(JAVA_JVM_LIBRARY )
|
||||||
|
set(JAVA_INCLUDE_PATH "${PWD}/jdk/include")
|
||||||
|
set(JAVA_INCLUDE_PATH2 "${PWD}/jdk/include/linux")
|
||||||
|
set(JAVA_AWT_INCLUDE_PATH )
|
||||||
|
EOF
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
160
deps/03-build.sh
vendored
160
deps/03-build.sh
vendored
|
@ -2,53 +2,133 @@
|
||||||
|
|
||||||
export PATH=${PWD}/02-extract/raspbian9/bin:${PATH}
|
export PATH=${PWD}/02-extract/raspbian9/bin:${PATH}
|
||||||
|
|
||||||
|
split_debug () {
|
||||||
|
arm-raspbian9-linux-gnueabihf-objcopy --only-keep-debug $1 $1.debug
|
||||||
|
arm-raspbian9-linux-gnueabihf-strip -g $1
|
||||||
|
arm-raspbian9-linux-gnueabihf-objcopy --add-gnu-debuglink=$1.debug $1
|
||||||
|
}
|
||||||
|
|
||||||
|
split_debug_so () {
|
||||||
|
pushd $1
|
||||||
|
for lib in *.so
|
||||||
|
do
|
||||||
|
split_debug $lib
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
split_debug_exe () {
|
||||||
|
pushd $1
|
||||||
|
for exe in *
|
||||||
|
do
|
||||||
|
split_debug $exe
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
# opencv
|
# opencv
|
||||||
|
build_opencv () {
|
||||||
|
cmake ../../02-extract/opencv \
|
||||||
|
-DWITH_CUDA=OFF \
|
||||||
|
-DWITH_IPP=OFF \
|
||||||
|
-DWITH_ITT=OFF \
|
||||||
|
-DWITH_OPENCL=OFF \
|
||||||
|
-DWITH_FFMPEG=OFF \
|
||||||
|
-DWITH_OPENEXR=OFF \
|
||||||
|
-DWITH_GSTREAMER=OFF \
|
||||||
|
-DWITH_LAPACK=OFF \
|
||||||
|
-DWITH_GTK=ON \
|
||||||
|
-DWITH_1394=OFF \
|
||||||
|
-DWITH_JASPER=OFF \
|
||||||
|
-DWITH_TIFF=OFF \
|
||||||
|
-DBUILD_JPEG=ON \
|
||||||
|
-DBUILD_PNG=ON \
|
||||||
|
-DBUILD_ZLIB=ON \
|
||||||
|
-DBUILD_TESTS=OFF \
|
||||||
|
-DPython_ADDITIONAL_VERSIONS=3.5 \
|
||||||
|
-DWITH_WEBP=OFF \
|
||||||
|
-DBUILD_JAVA=$2 \
|
||||||
|
-DBUILD_WITH_STATIC_CRT=OFF \
|
||||||
|
-DWITH_PROTOBUF=OFF \
|
||||||
|
-DWITH_DIRECTX=OFF \
|
||||||
|
-DENABLE_CXX11=ON \
|
||||||
|
-DBUILD_SHARED_LIBS=$2 \
|
||||||
|
-DCMAKE_BUILD_TYPE=$1 \
|
||||||
|
-DCMAKE_DEBUG_POSTFIX=d \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../../02-extract/arm-pi-gnueabihf.toolchain.cmake \
|
||||||
|
-DCMAKE_MAKE_PROGRAM=make \
|
||||||
|
-DENABLE_NEON=ON \
|
||||||
|
-DENABLE_VFPV3=ON \
|
||||||
|
-DBUILD_opencv_python3=$2 \
|
||||||
|
-DPYTHON3_INCLUDE_PATH=${PWD}/../../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf/usr/include/python3.5m \
|
||||||
|
-DPYTHON3_NUMPY_INCLUDE_DIRS=${PWD}/../../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf/usr/include/python3.5m/numpy \
|
||||||
|
-DOPENCV_EXTRA_FLAGS_DEBUG=-Og \
|
||||||
|
-DCMAKE_MODULE_PATH=${PWD}/../../02-extract/cmake-modules \
|
||||||
|
|| exit 1
|
||||||
|
make -j3 || exit 1
|
||||||
|
make install || exit 1
|
||||||
|
if [ "$1" == "RelWithDebugInfo" ]
|
||||||
|
then
|
||||||
|
cp -p install/share/OpenCV/java/libopencv_java*.so install/lib/
|
||||||
|
fi
|
||||||
|
split_debug_so install/lib
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -p 03-build/opencv-build
|
mkdir -p 03-build/opencv-build
|
||||||
pushd 03-build/opencv-build
|
pushd 03-build/opencv-build
|
||||||
cmake ../../02-extract/opencv \
|
build_opencv RelWithDebugInfo ON || exit 1
|
||||||
-DWITH_CUDA=OFF \
|
popd
|
||||||
-DWITH_IPP=OFF \
|
|
||||||
-DWITH_ITT=OFF \
|
|
||||||
-DWITH_OPENCL=OFF \
|
|
||||||
-DWITH_FFMPEG=OFF \
|
|
||||||
-DWITH_OPENEXR=OFF \
|
|
||||||
-DWITH_GSTREAMER=OFF \
|
|
||||||
-DWITH_LAPACK=OFF \
|
|
||||||
-DWITH_GTK=ON \
|
|
||||||
-DWITH_1394=OFF \
|
|
||||||
-DWITH_JASPER=OFF \
|
|
||||||
-DWITH_TIFF=OFF \
|
|
||||||
-DBUILD_JPEG=ON \
|
|
||||||
-DBUILD_PNG=ON \
|
|
||||||
-DBUILD_ZLIB=ON \
|
|
||||||
-DBUILD_TESTS=OFF \
|
|
||||||
-DPython_ADDITIONAL_VERSIONS=3.5 \
|
|
||||||
-DWITH_WEBP=OFF \
|
|
||||||
-DBUILD_JAVA=ON \
|
|
||||||
-DBUILD_WITH_STATIC_CRT=OFF \
|
|
||||||
-DWITH_PROTOBUF=OFF \
|
|
||||||
-DWITH_DIRECTX=OFF \
|
|
||||||
-DENABLE_CXX11=ON \
|
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../../02-extract/arm-pi-gnueabihf.toolchain.cmake \
|
|
||||||
-DCMAKE_MAKE_PROGRAM=make \
|
|
||||||
-DENABLE_NEON=ON \
|
|
||||||
-DENABLE_VFPV3=ON \
|
|
||||||
-DBUILD_opencv_python3=ON \
|
|
||||||
-DPYTHON3_INCLUDE_PATH=${PWD}/../../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf/usr/include/python3.5m \
|
|
||||||
-DPYTHON3_NUMPY_INCLUDE_DIRS=${PWD}/../../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf/usr/include/python3.5m/numpy \
|
|
||||||
-DOPENCV_EXTRA_FLAGS_DEBUG=-Og \
|
|
||||||
-DCMAKE_MODULE_PATH=${PWD}/../../thirdparty-opencv/arm-frc-modules \
|
|
||||||
|| exit 1
|
|
||||||
make -j3 || exit 1
|
|
||||||
make install || exit 1
|
|
||||||
|
|
||||||
|
mkdir -p 03-build/opencv-build-debug
|
||||||
|
pushd 03-build/opencv-build-debug
|
||||||
|
build_opencv Debug ON || exit 1
|
||||||
|
popd
|
||||||
|
|
||||||
|
mkdir -p 03-build/opencv-static
|
||||||
|
pushd 03-build/opencv-static
|
||||||
|
build_opencv RelWithDebugInfo OFF || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# wpiutil, cscore, ntcore, cameraserver
|
# wpiutil, cscore, ntcore, cameraserver
|
||||||
pushd allwpilib
|
# always use the release version of opencv jar/jni
|
||||||
./gradlew -PonlyRaspbian :wpiutil:build :cscore:build :ntcore:build :cameraserver:build :cameraserver:multiCameraServer:build || exit 1
|
build_wpilib () {
|
||||||
|
cmake ../../allwpilib \
|
||||||
|
-DCMAKE_BUILD_TYPE=$1 \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../../02-extract/arm-pi-gnueabihf.toolchain.cmake \
|
||||||
|
-DCMAKE_MODULE_PATH=${PWD}/../../02-extract/cmake-modules \
|
||||||
|
-DOPENCV_JAR_FILE=`ls ${PWD}/../opencv-build/install/share/OpenCV/java/opencv-*.jar` \
|
||||||
|
-DOPENCV_JNI_FILE=`ls ${PWD}/../opencv-build/install/share/OpenCV/java/libopencv_java*.so` \
|
||||||
|
-DOpenCV_DIR=${PWD}/../$2/install/share/OpenCV \
|
||||||
|
-DTHREADS_PTHREAD_ARG=-pthread \
|
||||||
|
|| exit 1
|
||||||
|
make -j3 || exit 1
|
||||||
|
split_debug_so lib
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p 03-build/allwpilib-build
|
||||||
|
pushd 03-build/allwpilib-build
|
||||||
|
build_wpilib RelWithDebugInfo opencv-build || exit 1
|
||||||
|
popd
|
||||||
|
|
||||||
|
mkdir -p 03-build/allwpilib-build-debug
|
||||||
|
pushd 03-build/allwpilib-build-debug
|
||||||
|
build_wpilib Debug opencv-build-debug || exit 1
|
||||||
|
popd
|
||||||
|
|
||||||
|
# static (for tools)
|
||||||
|
mkdir -p 03-build/allwpilib-static
|
||||||
|
pushd 03-build/allwpilib-static
|
||||||
|
cmake ../../allwpilib \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../../02-extract/arm-pi-gnueabihf.toolchain.cmake \
|
||||||
|
-DCMAKE_MODULE_PATH=${PWD}/../../02-extract/cmake-modules \
|
||||||
|
-DOpenCV_DIR=${PWD}/../opencv-static/install/share/OpenCV \
|
||||||
|
-DWITHOUT_JAVA=ON \
|
||||||
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
|
-DTHREADS_PTHREAD_ARG=-pthread \
|
||||||
|
|| exit 1
|
||||||
|
make -j3 || exit 1
|
||||||
|
split_debug_exe bin
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
|
|
36
deps/04-copy.sh
vendored
36
deps/04-copy.sh
vendored
|
@ -21,7 +21,9 @@ sh -c 'cd examples && zip -r - python-multiCameraServer' > ${DEST}/python-multiC
|
||||||
|
|
||||||
cp tools/setuidgids ${DEST}/
|
cp tools/setuidgids ${DEST}/
|
||||||
cp tools/_cscore.so ${DEST}/_cscore.cpython-35m-arm-linux-gnueabihf.so
|
cp tools/_cscore.so ${DEST}/_cscore.cpython-35m-arm-linux-gnueabihf.so
|
||||||
|
cp tools/_cscore.so.debug ${DEST}/
|
||||||
cp tools/rpiConfigServer ${DEST}/
|
cp tools/rpiConfigServer ${DEST}/
|
||||||
|
cp tools/rpiConfigServer.debug ${DEST}/
|
||||||
|
|
||||||
#
|
#
|
||||||
# openjdk
|
# openjdk
|
||||||
|
@ -30,15 +32,19 @@ cp tools/rpiConfigServer ${DEST}/
|
||||||
cp 01-download/jdk_11.0.1-strip.tar.gz ${DEST}/
|
cp 01-download/jdk_11.0.1-strip.tar.gz ${DEST}/
|
||||||
|
|
||||||
#
|
#
|
||||||
# thirdparty-opencv
|
# opencv
|
||||||
#
|
#
|
||||||
|
|
||||||
sh -c 'cd 03-build/opencv-build/install/lib && tar czf - libopencv*' > ${DEST}/libopencv.tar.gz
|
sh -c 'cd 03-build/opencv-build/install/lib && tar czf - libopencv*' > ${DEST}/libopencv.tar.gz
|
||||||
|
sh -c 'cd 03-build/opencv-build-debug/install/lib && tar czf - libopencv*' > ${DEST}/libopencv-debug.tar.gz
|
||||||
|
|
||||||
sh -c 'cd 03-build/opencv-build/install/include && tar czf - .' > ${DEST}/opencv-include.tar.gz
|
sh -c 'cd 03-build/opencv-build/install/include && tar czf - .' > ${DEST}/opencv-include.tar.gz
|
||||||
|
|
||||||
cp 03-build/opencv-build/install/share/OpenCV/java/opencv-*.jar ${DEST}/
|
cp 03-build/opencv-build/install/share/OpenCV/java/opencv-*.jar ${DEST}/
|
||||||
|
|
||||||
|
sh -c 'cd 03-build/opencv-build/install/share/OpenCV && tar czf - *.cmake' > ${DEST}/opencv-cmake.tar.gz
|
||||||
|
sh -c 'cd 03-build/opencv-build-debug/install/share/OpenCV && tar czf - *.cmake' > ${DEST}/opencv-cmake-debug.tar.gz
|
||||||
|
|
||||||
# the opencv build names the python .so with the build platform name instead
|
# the opencv build names the python .so with the build platform name instead
|
||||||
# of the target platform, so rename it
|
# of the target platform, so rename it
|
||||||
cp 03-build/opencv-build/install/python/cv2/python-*/cv2.*.so ${DEST}/cv2.cpython-35m-arm-linux-gnueabihf.so
|
cp 03-build/opencv-build/install/python/cv2/python-*/cv2.*.so ${DEST}/cv2.cpython-35m-arm-linux-gnueabihf.so
|
||||||
|
@ -59,32 +65,14 @@ sh -c 'cd pynetworktables && tar czf - networktables ntcore' > ${DEST}/pynetwork
|
||||||
# allwpilib
|
# allwpilib
|
||||||
#
|
#
|
||||||
|
|
||||||
cp \
|
sh -c 'cd 03-build/allwpilib-build/lib && tar czf - lib*' > ${DEST}/wpilib.tar.gz
|
||||||
allwpilib/wpiutil/build/libs/wpiutil/shared/release/libwpiutil.so* \
|
sh -c 'cd 03-build/allwpilib-build-debug/lib && tar czf - lib*' > ${DEST}/wpilib-debug.tar.gz
|
||||||
allwpilib/wpiutil/build/libs/wpiutil/shared/debug/libwpiutild.so* \
|
|
||||||
allwpilib/wpiutil/build/libs/wpiutil.jar \
|
cp 03-build/allwpilib-build/jar/*.jar ${DEST}/
|
||||||
allwpilib/cscore/build/libs/cscore/shared/release/libcscore.so* \
|
|
||||||
allwpilib/cscore/build/libs/cscore/shared/debug/libcscored.so* \
|
|
||||||
allwpilib/cscore/build/libs/cscoreJNIShared/shared/release/libcscorejni.so* \
|
|
||||||
allwpilib/cscore/build/libs/cscore.jar \
|
|
||||||
allwpilib/ntcore/build/libs/ntcore/shared/release/libntcore.so* \
|
|
||||||
allwpilib/ntcore/build/libs/ntcore/shared/debug/libntcored.so* \
|
|
||||||
allwpilib/ntcore/build/libs/ntcoreJNIShared/shared/release/libntcorejni.so* \
|
|
||||||
allwpilib/ntcore/build/libs/ntcore.jar \
|
|
||||||
allwpilib/cameraserver/build/libs/cameraserver/shared/release/libcameraserver.so* \
|
|
||||||
allwpilib/cameraserver/build/libs/cameraserver/shared/debug/libcameraserverd.so* \
|
|
||||||
allwpilib/cameraserver/build/libs/cameraserver.jar \
|
|
||||||
${DEST}/
|
|
||||||
|
|
||||||
sh -c 'cd allwpilib/wpiutil/src/main/native/include && tar czf - uv.h uv wpi' > ${DEST}/wpiutil-include.tar.gz
|
sh -c 'cd allwpilib/wpiutil/src/main/native/include && tar czf - uv.h uv wpi' > ${DEST}/wpiutil-include.tar.gz
|
||||||
sh -c 'cd allwpilib/cscore/src/main/native/include && tar czf - .' > ${DEST}/cscore-include.tar.gz
|
sh -c 'cd allwpilib/cscore/src/main/native/include && tar czf - .' > ${DEST}/cscore-include.tar.gz
|
||||||
sh -c 'cd allwpilib/ntcore/src/main/native/include && tar czf - .' > ${DEST}/ntcore-include.tar.gz
|
sh -c 'cd allwpilib/ntcore/src/main/native/include && tar czf - .' > ${DEST}/ntcore-include.tar.gz
|
||||||
sh -c 'cd allwpilib/cameraserver/src/main/native/include && tar czf - cameraserver vision' > ${DEST}/cameraserver-include.tar.gz
|
sh -c 'cd allwpilib/cameraserver/src/main/native/include && tar czf - cameraserver vision' > ${DEST}/cameraserver-include.tar.gz
|
||||||
|
|
||||||
cp \
|
sh -c 'cd 03-build/allwpilib-static/bin && tar czf - cscore_* multiCameraServer* netconsoleTee*' > ${DEST}/wpilib-bin.tar.gz
|
||||||
allwpilib/cameraserver/multiCameraServer/build/exe/multiCameraServerCpp/multiCameraServerCpp \
|
|
||||||
${DEST}/multiCameraServer
|
|
||||||
|
|
||||||
cp \
|
|
||||||
allwpilib/wpiutil/build/exe/netconsoleTee/netconsoleTee \
|
|
||||||
${DEST}/
|
|
||||||
|
|
2
deps/allwpilib
vendored
2
deps/allwpilib
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 7d7af287f6718c0fcb2123aca1b2cebc3177ade5
|
Subproject commit 300eeb330d78e2ef605d30644efbc4dd8bcdad61
|
77
deps/arm-pi-gnueabihf.toolchain.cmake
vendored
Normal file
77
deps/arm-pi-gnueabihf.toolchain.cmake
vendored
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
if(COMMAND toolchain_save_config)
|
||||||
|
return() # prevent recursive call
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(GCC_COMPILER_VERSION "" CACHE STRING "GCC Compiler version")
|
||||||
|
set(GNU_MACHINE "arm-raspbian9-linux-gnueabi" CACHE STRING "GNU compiler triple")
|
||||||
|
set(SOFTFP no)
|
||||||
|
set(FLOAT_ABI_SUFFIX "hf")
|
||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/opencv/platforms/linux/gnu.toolchain.cmake")
|
||||||
|
|
||||||
|
if(NOT DEFINED CMAKE_C_COMPILER)
|
||||||
|
find_program(CMAKE_C_COMPILER NAMES ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-gcc${__GCC_VER_SUFFIX})
|
||||||
|
else()
|
||||||
|
#message(WARNING "CMAKE_C_COMPILER=${CMAKE_C_COMPILER} is defined")
|
||||||
|
endif()
|
||||||
|
if(NOT DEFINED CMAKE_CXX_COMPILER)
|
||||||
|
find_program(CMAKE_CXX_COMPILER NAMES ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-g++${__GCC_VER_SUFFIX})
|
||||||
|
else()
|
||||||
|
#message(WARNING "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} is defined")
|
||||||
|
endif()
|
||||||
|
if(NOT DEFINED CMAKE_LINKER)
|
||||||
|
find_program(CMAKE_LINKER NAMES ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-ld${__GCC_VER_SUFFIX} ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-ld)
|
||||||
|
else()
|
||||||
|
#message(WARNING "CMAKE_LINKER=${CMAKE_LINKER} is defined")
|
||||||
|
endif()
|
||||||
|
if(NOT DEFINED CMAKE_AR)
|
||||||
|
find_program(CMAKE_AR NAMES ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-ar${__GCC_VER_SUFFIX} ${GNU_MACHINE}${FLOAT_ABI_SUFFIX}-ar)
|
||||||
|
else()
|
||||||
|
#message(WARNING "CMAKE_AR=${CMAKE_AR} is defined")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED ARM_LINUX_SYSROOT AND DEFINED GNU_MACHINE)
|
||||||
|
set(ARM_LINUX_SYSROOT /usr/${GNU_MACHINE}${FLOAT_ABI_SUFFIX})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED CMAKE_CXX_FLAGS)
|
||||||
|
set(CMAKE_CXX_FLAGS "" CACHE INTERNAL "")
|
||||||
|
set(CMAKE_C_FLAGS "" CACHE INTERNAL "")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "" CACHE INTERNAL "")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "" CACHE INTERNAL "")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "" CACHE INTERNAL "")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${ARM_LINKER_FLAGS} -rdynamic ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${ARM_LINKER_FLAGS} -rdynamic ${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${ARM_LINKER_FLAGS} -rdynamic ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
else()
|
||||||
|
#message(WARNING "CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}' is defined")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_NEON)
|
||||||
|
message(WARNING "You use obsolete variable USE_NEON to enable NEON instruction set. Use -DENABLE_NEON=ON instead." )
|
||||||
|
set(ENABLE_NEON TRUE)
|
||||||
|
elseif(USE_VFPV3)
|
||||||
|
message(WARNING "You use obsolete variable USE_VFPV3 to enable VFPV3 instruction set. Use -DENABLE_VFPV3=ON instead." )
|
||||||
|
set(ENABLE_VFPV3 TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${ARM_LINUX_SYSROOT})
|
||||||
|
|
||||||
|
if(EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CUDA_TOOLKIT_ROOT_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(TOOLCHAIN_CONFIG_VARS ${TOOLCHAIN_CONFIG_VARS}
|
||||||
|
ARM_LINUX_SYSROOT
|
||||||
|
ENABLE_NEON
|
||||||
|
ENABLE_VFPV3
|
||||||
|
CUDA_TOOLKIT_ROOT_DIR
|
||||||
|
)
|
||||||
|
toolchain_save_config()
|
||||||
|
|
|
@ -11,7 +11,7 @@ apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
flatDir {
|
flatDir {
|
||||||
dirs '/home/pi/javalibs', '.'
|
dirs '/usr/local/frc/java', '.'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
deps/thirdparty-opencv
vendored
1
deps/thirdparty-opencv
vendored
|
@ -1 +0,0 @@
|
||||||
Subproject commit 579bc6b26169c690bdadb52150d4396e696eed31
|
|
25
deps/tools/Makefile
vendored
25
deps/tools/Makefile
vendored
|
@ -1,7 +1,8 @@
|
||||||
SYSROOT?=../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf
|
SYSROOT?=../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf
|
||||||
COMPILER?=../02-extract/raspbian9/bin/arm-raspbian9-linux-gnueabihf-
|
COMPILER?=../02-extract/raspbian9/bin/arm-raspbian9-linux-gnueabihf-
|
||||||
WPILIB?=../allwpilib
|
WPILIB_SRC?=../allwpilib
|
||||||
WPILIB_PLATFORM?=.
|
WPILIB_BUILD?=../03-build/allwpilib-build
|
||||||
|
WPILIB_STATIC_BUILD?=../03-build/allwpilib-static
|
||||||
OPENCV_INSTALL?=../03-build/opencv-build/install
|
OPENCV_INSTALL?=../03-build/opencv-build/install
|
||||||
EXEC_HOME?=/home/pi
|
EXEC_HOME?=/home/pi
|
||||||
FRC_JSON?=/boot/frc.json
|
FRC_JSON?=/boot/frc.json
|
||||||
|
@ -25,19 +26,21 @@ setuidgids: setuidgids.c
|
||||||
${COMPILER}gcc -O -Wall -D_GNU_SOURCE -o $@ $<
|
${COMPILER}gcc -O -Wall -D_GNU_SOURCE -o $@ $<
|
||||||
|
|
||||||
_cscore.so: ../robotpy-cscore/src/_cscore.cpp ../robotpy-cscore/src/ndarray_converter.cpp
|
_cscore.so: ../robotpy-cscore/src/_cscore.cpp ../robotpy-cscore/src/ndarray_converter.cpp
|
||||||
${COMPILER}g++ -O -Wall -fvisibility=hidden -shared -fPIC -o $@ \
|
${COMPILER}g++ -g -O -Wall -fvisibility=hidden -shared -fPIC -o $@ \
|
||||||
-I${OPENCV_INSTALL}/include \
|
-I${OPENCV_INSTALL}/include \
|
||||||
-I${WPILIB}/wpiutil/src/main/native/include \
|
-I${WPILIB_SRC}/wpiutil/src/main/native/include \
|
||||||
-I${WPILIB}/cscore/src/main/native/include \
|
-I${WPILIB_SRC}/cscore/src/main/native/include \
|
||||||
-I${SYSROOT}/usr/include/python3.5 \
|
-I${SYSROOT}/usr/include/python3.5 \
|
||||||
-L${WPILIB}/cscore/build/libs/cscore/shared/${WPILIB_PLATFORM}/release \
|
-L${WPILIB_BUILD}/lib \
|
||||||
-L${WPILIB}/wpiutil/build/libs/wpiutil/shared/${WPILIB_PLATFORM}/release \
|
|
||||||
-L${OPENCV_INSTALL}/lib \
|
-L${OPENCV_INSTALL}/lib \
|
||||||
../robotpy-cscore/src/_cscore.cpp \
|
../robotpy-cscore/src/_cscore.cpp \
|
||||||
../robotpy-cscore/src/ndarray_converter.cpp \
|
../robotpy-cscore/src/ndarray_converter.cpp \
|
||||||
-lcscore \
|
-lcscore \
|
||||||
-lwpiutil \
|
-lwpiutil \
|
||||||
-lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_core
|
-lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_core
|
||||||
|
${COMPILER}objcopy --only-keep-debug $@ $@.debug
|
||||||
|
${COMPILER}strip -g $@
|
||||||
|
${COMPILER}objcopy --add-gnu-debuglink=$@.debug $@
|
||||||
|
|
||||||
RPICONFIGSERVER_OBJS= \
|
RPICONFIGSERVER_OBJS= \
|
||||||
rpiConfigServer_src/main.o \
|
rpiConfigServer_src/main.o \
|
||||||
|
@ -53,17 +56,17 @@ RPICONFIGSERVER_OBJS= \
|
||||||
rpiConfigServer_src/resources/frcvision.js.o
|
rpiConfigServer_src/resources/frcvision.js.o
|
||||||
|
|
||||||
rpiConfigServer: ${RPICONFIGSERVER_OBJS}
|
rpiConfigServer: ${RPICONFIGSERVER_OBJS}
|
||||||
${COMPILER}g++ -pthread -o $@ \
|
${COMPILER}g++ -pthread -g -o $@ \
|
||||||
${RPICONFIGSERVER_OBJS} \
|
${RPICONFIGSERVER_OBJS} \
|
||||||
-L${WPILIB}/wpiutil/build/libs/wpiutil/static/${WPILIB_PLATFORM}/release \
|
-L${WPILIB_STATIC_BUILD}/lib \
|
||||||
-lwpiutil
|
-lwpiutil
|
||||||
${COMPILER}objcopy --only-keep-debug $@ $@.debug
|
${COMPILER}objcopy --only-keep-debug $@ $@.debug
|
||||||
${COMPILER}strip -g $@
|
${COMPILER}strip -g $@
|
||||||
${COMPILER}objcopy --add-gnu-debuglink=$@.debug $@
|
${COMPILER}objcopy --add-gnu-debuglink=$@.debug $@
|
||||||
|
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
${COMPILER}g++ -O -Wall -c -o $@ \
|
${COMPILER}g++ -g -O -Wall -c -o $@ \
|
||||||
-I${WPILIB}/wpiutil/src/main/native/include \
|
-I${WPILIB_SRC}/wpiutil/src/main/native/include \
|
||||||
'-DEXEC_HOME="${EXEC_HOME}"' \
|
'-DEXEC_HOME="${EXEC_HOME}"' \
|
||||||
'-DFRC_JSON="${FRC_JSON}"' \
|
'-DFRC_JSON="${FRC_JSON}"' \
|
||||||
'-DDHCPCD_CONF="${DHCPCD_CONF}"' \
|
'-DDHCPCD_CONF="${DHCPCD_CONF}"' \
|
||||||
|
|
|
@ -30,7 +30,7 @@ void Application::Set(wpi::StringRef appType,
|
||||||
wpi::StringRef appCommand;
|
wpi::StringRef appCommand;
|
||||||
|
|
||||||
if (appType == "builtin") {
|
if (appType == "builtin") {
|
||||||
appCommand = "./multiCameraServer";
|
appCommand = "/usr/local/frc/bin/multiCameraServer";
|
||||||
} else if (appType == "example-java") {
|
} else if (appType == "example-java") {
|
||||||
appDir = "java-multiCameraServer";
|
appDir = "java-multiCameraServer";
|
||||||
appCommand =
|
appCommand =
|
||||||
|
|
|
@ -21,8 +21,6 @@ install -m 644 files/frc.json "${ROOTFS_DIR}/boot/"
|
||||||
|
|
||||||
install -m 755 extfiles/setuidgids "${ROOTFS_DIR}/usr/local/bin/"
|
install -m 755 extfiles/setuidgids "${ROOTFS_DIR}/usr/local/bin/"
|
||||||
|
|
||||||
install -m 755 -o 1000 -g 1000 extfiles/multiCameraServer "${ROOTFS_DIR}/home/pi/"
|
|
||||||
|
|
||||||
cat extfiles/jdk_11.0.1-strip.tar.gz | sh -c "mkdir -p ${ROOTFS_DIR}/usr/lib/jvm && cd ${ROOTFS_DIR}/usr/lib/jvm/ && tar xzf - --exclude=\*.diz --exclude=src.zip --transform=s/^jdk/jdk-11.0.1/"
|
cat extfiles/jdk_11.0.1-strip.tar.gz | sh -c "mkdir -p ${ROOTFS_DIR}/usr/lib/jvm && cd ${ROOTFS_DIR}/usr/lib/jvm/ && tar xzf - --exclude=\*.diz --exclude=src.zip --transform=s/^jdk/jdk-11.0.1/"
|
||||||
cp files/jdk-11.0.1.jinfo "${ROOTFS_DIR}/usr/lib/jvm/.jdk-11.0.1.jinfo"
|
cp files/jdk-11.0.1.jinfo "${ROOTFS_DIR}/usr/lib/jvm/.jdk-11.0.1.jinfo"
|
||||||
|
|
||||||
|
@ -83,8 +81,13 @@ EOF
|
||||||
|
|
||||||
install -m 644 files/ld.so.conf.d/*.conf "${ROOTFS_DIR}/etc/ld.so.conf.d/"
|
install -m 644 files/ld.so.conf.d/*.conf "${ROOTFS_DIR}/etc/ld.so.conf.d/"
|
||||||
|
|
||||||
|
install -v -d "${ROOTFS_DIR}/usr/local/frc/bin"
|
||||||
|
|
||||||
|
cat extfiles/wpilib-bin.tar.gz | sh -c 'cd ${ROOTFS_DIR}/usr/local/frc/bin/ && tar xzf -'
|
||||||
|
|
||||||
install -v -d "${ROOTFS_DIR}/usr/local/frc/lib"
|
install -v -d "${ROOTFS_DIR}/usr/local/frc/lib"
|
||||||
|
|
||||||
|
cat extfiles/libopencv-debug.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && tar xzf -"
|
||||||
cat extfiles/libopencv.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && tar xzf -"
|
cat extfiles/libopencv.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && tar xzf -"
|
||||||
|
|
||||||
install -m 755 extfiles/cv2.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/"
|
install -m 755 extfiles/cv2.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/"
|
||||||
|
@ -93,10 +96,8 @@ cat extfiles/pynetworktables.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/lib/pyth
|
||||||
cat extfiles/robotpy-cscore.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/ && tar xzf -"
|
cat extfiles/robotpy-cscore.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/ && tar xzf -"
|
||||||
install -m 755 extfiles/_cscore.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/cscore/"
|
install -m 755 extfiles/_cscore.*.so "${ROOTFS_DIR}/usr/local/lib/python3.5/dist-packages/cscore/"
|
||||||
|
|
||||||
install -m 755 extfiles/libwpiutil*.so* "${ROOTFS_DIR}/usr/local/frc/lib/"
|
cat extfiles/wpilib-debug.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && tar xzf -"
|
||||||
install -m 755 extfiles/libcscore*.so* "${ROOTFS_DIR}/usr/local/frc/lib/"
|
cat extfiles/wpilib.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/lib/ && tar xzf -"
|
||||||
install -m 755 extfiles/libntcore*.so* "${ROOTFS_DIR}/usr/local/frc/lib/"
|
|
||||||
install -m 755 extfiles/libcameraserver*.so* "${ROOTFS_DIR}/usr/local/frc/lib/"
|
|
||||||
|
|
||||||
install -v -d "${ROOTFS_DIR}/usr/local/frc/include"
|
install -v -d "${ROOTFS_DIR}/usr/local/frc/include"
|
||||||
|
|
||||||
|
@ -105,6 +106,15 @@ cat extfiles/cscore-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/inclu
|
||||||
cat extfiles/ntcore-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -"
|
cat extfiles/ntcore-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -"
|
||||||
cat extfiles/cameraserver-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -"
|
cat extfiles/cameraserver-include.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/include/ && tar xzf -"
|
||||||
|
|
||||||
|
install -v -d "${ROOTFS_DIR}/usr/local/frc/share/OpenCV"
|
||||||
|
|
||||||
|
cat extfiles/opencv-cmake-debug.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/share/OpenCV/ && tar xzf -"
|
||||||
|
cat extfiles/opencv-cmake.tar.gz | sh -c "cd ${ROOTFS_DIR}/usr/local/frc/share/OpenCV/ && tar xzf -"
|
||||||
|
|
||||||
|
install -v -d "${ROOTFS_DIR}/usr/local/frc/java"
|
||||||
|
|
||||||
|
install -m 644 -o 1000 -g 1000 extfiles/*.jar "${ROOTFS_DIR}/usr/local/frc/java/"
|
||||||
|
|
||||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/examples/"
|
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/examples/"
|
||||||
install -v -o 1000 -g 1000 extfiles/*-multiCameraServer.zip "${ROOTFS_DIR}/home/pi/examples/"
|
install -v -o 1000 -g 1000 extfiles/*-multiCameraServer.zip "${ROOTFS_DIR}/home/pi/examples/"
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
|
@ -117,11 +127,10 @@ mv *.zip ../zips/
|
||||||
chown -R 1000:1000 .
|
chown -R 1000:1000 .
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/javalibs/"
|
sh -c "cd ${ROOTFS_DIR}/usr/local/frc/java && zip ${ROOTFS_DIR}/home/pi/zips/java-multiCameraServer.zip *.jar"
|
||||||
install -m 644 -o 1000 -g 1000 extfiles/*.jar "${ROOTFS_DIR}/home/pi/javalibs/"
|
|
||||||
sh -c "cd ${ROOTFS_DIR}/home/pi/javalibs && zip ../zips/java-multiCameraServer.zip *.jar"
|
|
||||||
|
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
|
chown -R 1000:1000 /home/pi/zips
|
||||||
ldconfig
|
ldconfig
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -130,8 +139,7 @@ install -v -d "${ROOTFS_DIR}/service/configServer"
|
||||||
install -m 755 files/configServer_run "${ROOTFS_DIR}/service/configServer/run"
|
install -m 755 files/configServer_run "${ROOTFS_DIR}/service/configServer/run"
|
||||||
|
|
||||||
install -m 755 extfiles/rpiConfigServer "${ROOTFS_DIR}/usr/local/sbin/configServer"
|
install -m 755 extfiles/rpiConfigServer "${ROOTFS_DIR}/usr/local/sbin/configServer"
|
||||||
|
install -m 644 extfiles/rpiConfigServer.debug "${ROOTFS_DIR}/usr/local/sbin/"
|
||||||
install -m 755 extfiles/netconsoleTee "${ROOTFS_DIR}/usr/local/bin/"
|
|
||||||
|
|
||||||
install -v -d "${ROOTFS_DIR}/service/camera"
|
install -v -d "${ROOTFS_DIR}/service/camera"
|
||||||
install -v -d "${ROOTFS_DIR}/service/camera/log"
|
install -v -d "${ROOTFS_DIR}/service/camera/log"
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /usr/local/bin/netconsoleTee -u
|
exec /usr/local/frc/bin/netconsoleTee -u
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
### TYPE: builtin
|
### TYPE: builtin
|
||||||
echo "Waiting 5 seconds..."
|
echo "Waiting 5 seconds..."
|
||||||
sleep 5
|
sleep 5
|
||||||
exec ./multiCameraServer
|
exec /usr/local/frc/bin/multiCameraServer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user