-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2696 from taketwo/build-tutorials
Build tutorials on Azure Pipelines
- Loading branch information
Showing
15 changed files
with
201 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
resources: | ||
containers: | ||
- container: env1604 | ||
image: pointcloudlibrary/env:16.04 | ||
|
||
jobs: | ||
- job: tutorials | ||
displayName: Tutorials | ||
timeoutInMinutes: 0 | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
container: env1604 | ||
variables: | ||
BUILD_DIR: '$(Agent.BuildDirectory)/build' | ||
INSTALL_DIR: '$(Agent.BuildDirectory)/install' | ||
CMAKE_CXX_FLAGS: '-Wall -Wextra -Wabi -O2' | ||
EXCLUDE_TUTORIALS: 'davidsdk,ensenso_cameras,gpu' | ||
steps: | ||
- script: | | ||
mkdir $BUILD_DIR && cd $BUILD_DIR | ||
cmake $(Build.SourcesDirectory) \ | ||
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ | ||
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ | ||
-DPCL_ONLY_CORE_POINT_TYPES=ON \ | ||
-DPCL_NO_PRECOMPILE=ON \ | ||
-DPCL_QT_VERSION=5 \ | ||
-DBUILD_surface_on_nurbs=ON \ | ||
-DBUILD_global_tests=OFF \ | ||
-DBUILD_tools=OFF \ | ||
-DBUILD_examples=OFF \ | ||
-DBUILD_outofcore=OFF \ | ||
-DBUILD_stereo=OFF \ | ||
-DBUILD_simulation=OFF | ||
displayName: 'CMake Configuration' | ||
- script: | | ||
cd $BUILD_DIR | ||
cmake --build . -- -j2 | ||
displayName: 'Build Library' | ||
- script: | | ||
cd $BUILD_DIR | ||
cmake --build . -- install | ||
displayName: 'Install PCL' | ||
- script: | | ||
$(Build.SourcesDirectory)/.ci/scripts/build_tutorials.sh -k -s -e $EXCLUDE_TUTORIALS $INSTALL_DIR/share/pcl-1.9 $(Build.SourcesDirectory) $BUILD_DIR/tutorials | ||
displayName: 'Build Tutorials' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/usr/bin/env bash | ||
|
||
show_help() { | ||
cat << EOF | ||
Usage: ${0##*/} [OPTIONS] INSTALL_DIR SOURCE_DIR BUILD_DIR | ||
This script builds source code projects of PCL tutorials. | ||
Options: | ||
-h Dispaly this help and exit. | ||
-k Keep going after a configuration/build error. | ||
-s Print summary in the end. | ||
-e NAMES Exclude tutorials from the build. | ||
NAMES is a comma-separated list of tutorial names. | ||
Arguments: | ||
INSTALL_DIR Path to the directory where PCLConfig.cmake in installed. | ||
SOURCE_DIR Path to the root of PCL repository. | ||
BUILD_DIR Path to the directory where the tutorials should be built. | ||
EOF | ||
} | ||
|
||
while getopts "hkse:" option; do | ||
case "${option}" in | ||
h) show_help | ||
exit 0 | ||
;; | ||
k) KEEP_GOING=1 | ||
;; | ||
s) SUMMARY=1 | ||
;; | ||
e) EXCLUDE=${OPTARG} | ||
;; | ||
*) show_help | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND-1)) | ||
|
||
if [[ $# -ne 3 ]]; then | ||
show_help | ||
exit 1 | ||
fi | ||
|
||
INSTALL_DIR=$1 | ||
SOURCE_DIR=$2/doc/tutorials/content/sources | ||
BUILD_DIR=$3 | ||
|
||
if [[ ! -f "$INSTALL_DIR/PCLConfig.cmake" ]]; then | ||
echo "Invalid install directory" | ||
exit 2 | ||
fi | ||
|
||
if [[ ! -d "$SOURCE_DIR" ]]; then | ||
echo "Invalid source directory" | ||
exit 3 | ||
fi | ||
|
||
mkdir -p "$BUILD_DIR" | ||
|
||
TUTORIALS=() | ||
|
||
for DIRECTORY in "$SOURCE_DIR"/*/ ; do | ||
NAME=$(basename "$DIRECTORY") | ||
if [[ "$EXCLUDE" == *$NAME* ]]; then | ||
STATUS="excluded" | ||
elif [[ -z ${SKIP+x} ]]; then | ||
TUTORIAL_SOURCE_DIR=$(realpath "$DIRECTORY") | ||
TUTORIAL_BUILD_DIR="$BUILD_DIR/$NAME" | ||
mkdir -p "$TUTORIAL_BUILD_DIR" && cd "$TUTORIAL_BUILD_DIR" || exit | ||
echo "Configuring tutorial: $NAME" | ||
if ! cmake "$TUTORIAL_SOURCE_DIR" -DPCL_DIR="$INSTALL_DIR" -DCMAKE_CXX_FLAGS="-Werror"; then | ||
STATUS="cmake error" | ||
else | ||
echo "Building tutorial: $NAME" | ||
if ! cmake --build . -- -j2; then | ||
STATUS="build error" | ||
fi | ||
fi | ||
if [[ -n $STATUS ]]; then | ||
FAILED=1 | ||
if [[ $KEEP_GOING -ne 1 ]]; then | ||
SKIP=1 | ||
fi | ||
fi | ||
cd - || exit | ||
else | ||
STATUS="skipped" | ||
fi | ||
TUTORIALS+=("$NAME") | ||
STATUSES+=("$STATUS") | ||
unset STATUS | ||
done | ||
|
||
if [[ $SUMMARY -eq 1 ]]; then | ||
echo "" | ||
echo "Tutorial build summary" | ||
echo "----------------------" | ||
echo "" | ||
SUCCEEDED=0 | ||
EXCLUDED=0 | ||
for i in "${!TUTORIALS[@]}"; do | ||
if [[ "${STATUSES[$i]}" == "" ]]; then | ||
MARK="🗸" | ||
SUCCEEDED=$((SUCCEEDED+1)) | ||
elif [[ "${STATUSES[$i]}" == *error* ]]; then | ||
MARK="𐄂" | ||
else | ||
MARK="-" | ||
EXCLUDED=$((EXCLUDED+1)) | ||
fi | ||
printf "%-46s %s %s\\n" "${TUTORIALS[$i]}" "$MARK" "${STATUSES[$i]}" | ||
done | ||
echo "" | ||
echo "Succeeded building $SUCCEEDED out of ${#TUTORIALS[@]} tutorials" | ||
echo "Excluded or skipped $EXCLUDED tutorials" | ||
fi | ||
|
||
exit $FAILED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.