提交 473fa573 编写于 作者: S storypku 提交者: Liu Jiaming

Docker: updated pcl installer for cpu|gpu build

上级 14aa0108
...@@ -14,10 +14,14 @@ ...@@ -14,10 +14,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
############################################################################### ###############################################################################
# Fail on first error. # Fail on first error.
set -e set -e
WORKHORSE="$1"
if [ -z "${WORKHORSE}" ]; then
WORKHORSE="cpu"
fi
cd "$(dirname "${BASH_SOURCE[0]}")" cd "$(dirname "${BASH_SOURCE[0]}")"
. /tmp/installers/installer_base.sh . /tmp/installers/installer_base.sh
...@@ -31,7 +35,15 @@ if ldconfig -p | grep -q libpcl_common ; then ...@@ -31,7 +35,15 @@ if ldconfig -p | grep -q libpcl_common ; then
exit 0 exit 0
fi fi
GPU_OPTIONS="-DCUDA_ARCH_BIN=\"${SUPPORTED_NVIDIA_SMS}\""
if [ "${WORKHORSE}" = "cpu" ]; then
GPU_OPTIONS="-DWITH_CUDA=OFF"
fi
info "GPU Options for PCL:\"${GPU_OPTIONS}\""
# libpcap-dev # libpcap-dev
# libopenmpi-dev
# libboost-all-dev # libboost-all-dev
apt-get -y update && \ apt-get -y update && \
apt-get -y install \ apt-get -y install \
...@@ -41,9 +53,8 @@ apt-get -y update && \ ...@@ -41,9 +53,8 @@ apt-get -y update && \
libglfw3-dev \ libglfw3-dev \
freeglut3-dev \ freeglut3-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
libopenmpi-dev \ libjpeg-dev \
libpng-dev \ libpng-dev
libjpeg-dev
# NOTE(storypku) # NOTE(storypku)
# libglfw3-dev depends on libglfw3, # libglfw3-dev depends on libglfw3,
...@@ -60,48 +71,29 @@ PKG_NAME="pcl-${VERSION}.tar.gz" ...@@ -60,48 +71,29 @@ PKG_NAME="pcl-${VERSION}.tar.gz"
DOWNLOAD_LINK="https://github.com/PointCloudLibrary/pcl/archive/${PKG_NAME}" DOWNLOAD_LINK="https://github.com/PointCloudLibrary/pcl/archive/${PKG_NAME}"
ARCH=$(uname -m) download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}"
tar xzf ${PKG_NAME}
if [[ "$ARCH" == "x86_64" ]]; then
download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}" # Ref: https://src.fedoraproject.org/rpms/pcl.git
tar xzf ${PKG_NAME} pushd pcl-pcl-${VERSION}/
patch -p1 < /tmp/installers/pcl-sse-fix-${VERSION}.patch
# Ref: https://src.fedoraproject.org/rpms/pcl.git mkdir build && cd build
pushd pcl-pcl-${VERSION}/ cmake .. \
patch -p1 < /tmp/installers/pcl-sse-fix-${VERSION}.patch "${GPU_OPTIONS}" \
mkdir build && cd build -DPCL_ENABLE_SSE=ON \
-DBoost_NO_SYSTEM_PATHS=TRUE \
# -DCUDA_ARCH_BIN="${SUPPORTED_NVIDIA_SMS}" -DBOOST_ROOT:PATHNAME="${SYSROOT_DIR}" \
cmake .. \ -DBUILD_SHARED_LIBS=ON \
-DWITH_CUDA=OFF \ -DCMAKE_INSTALL_PREFIX="${SYSROOT_DIR}" \
-DPCL_ENABLE_SSE=ON \ -DCMAKE_BUILD_TYPE=Release
-DBoost_NO_SYSTEM_PATHS=TRUE \ make -j${THREAD_NUM}
-DBOOST_ROOT:PATHNAME="${SYSROOT_DIR}" \ make install
-DBUILD_SHARED_LIBS=ON \ popd
-DCMAKE_INSTALL_PREFIX="${SYSROOT_DIR}" \
-DCMAKE_BUILD_TYPE=Release ldconfig
make -j${THREAD_NUM}
make install #clean up
popd rm -fr ${PKG_NAME} pcl-pcl-${VERSION}
ldconfig
#clean up
rm -fr ${PKG_NAME} pcl-pcl-${VERSION}
else
# aarch64 prebuilt package
wget https://apollocache.blob.core.windows.net/apollo-cache/pcl.zip
unzip pcl.zip
pushd pcl/
mkdir -p /usr/local/include/pcl-1.7/
cd include
cp -r pcl /usr/local/include/pcl-1.7/
cd ../
cp -r lib /usr/local/
popd
#clean up
rm -fr pcl.zip pcl
fi
# Clean up cache to reduce layer size. # Clean up cache to reduce layer size.
apt-get clean && \ apt-get clean && \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册