当前位置: 首页 > wzjs >正文

珠海网站建设的公司长春百度推广电话

珠海网站建设的公司,长春百度推广电话,清河网站建设费用,外综服务平台哪里做网站文章目录 #!/bin/bash #!/bin/bash 是一个 shebang(也称为 hashbang),它是一个特殊的注释行,用于告诉操作系统使用哪个解释器来运行脚本。在这种情况下,/bin/bash 指定了使用 Bash(Bourne Again SHell&…

文章目录

  1. #!/bin/bash
    #!/bin/bash 是一个 shebang(也称为 hashbang),它是一个特殊的注释行,用于告诉操作系统使用哪个解释器来运行脚本。在这种情况下,/bin/bash 指定了使用 Bash(Bourne Again SHell)作为脚本的解释器。
  2. $PWD指当前的工作目录,${HOME} 的值通常是用户登录时的默认目录路径。例如:
  • 对于用户 user,${HOME} 的值通常是 /home/user。
  • 对于 root 用户,${HOME} 的值通常是 /root。
  1. function usage ():通常用于定义一个帮助函数,用于显示脚本的使用方法和参数说明
  2. 在这里插入图片描述
  3. 错误处理逻辑,用于检查 getopt 解析命令行参数时是否成功。如果 getopt 返回的退出状态码不是 0,说明参数解析失败,此时脚本会调用 usage 函数来显示帮助信息,并退出。
  4. 在这里插入图片描述
#!/bin/bash
# Builds the Intel Realsense library librealsense on a Jetson Nano Development Kit
# Copyright (c) 2016-21 Jetsonhacks 
# MIT LicenseLIBREALSENSE_DIRECTORY=${HOME}/librealsense
INSTALL_DIR=$PWD
NVCC_PATH=/usr/local/cuda/bin/nvccUSE_CUDA=truefunction usage ()
{echo "Usage: ./buildLibrealsense.sh [-n | -no_cuda] [-v | -version <version>] [-j | --jobs <number of jobs>] [-h | --help] "echo "-n  | --no_cuda   Build with no CUDA (Defaults to with CUDA)"echo "-v  | --version   Version of librealsense to build (defaults to latest release)"echo "-j  | --jobs      Number of concurrent jobs (Default 1 on <= 4GB RAM#of cores-1 otherwise)"echo "-h  | --help      This message"exit 2
}PARSED_ARGUMENTS=$(getopt -a -n buildLibrealsense.sh -o nv:j:h --longoptions version:,no_cuda,jobs:,help -- "$@" )
VALID_ARGUMENTS=$?if [ "$VALID_ARGUMENTS" != "0" ]; thenecho ""usage
fieval set -- "$PARSED_ARGUMENTS"LIBREALSENSE_VERSION=""
USE_CUDA=true
NUM_PROCS=""while :
docase "$1" in-n | --build_no_cuda) USE_CUDA=false   ; shift ;;-v | --version )      LIBREALSENSE_VERSION="$2" ; shift 2 ;;-j | --jobs)          NUM_PROCS="$2" ; shift 2 ;re_isanum='^[0-9]+$'if ! [[ $NUM_PROCS =~ $re_isanum ]] ; thenecho "Number of jobs must be a positive, whole number"usageelseif [ $NUM_PROCS -eq "0" ]; thenecho "Number of jobs must be a positive, whole number" fifi ;;;-h | --help )         usage ; shift ;;# -- means the end of arguments--)  shift; break ;;esac
done# From lukechilds gist discussion: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c 
# We use wget instead of curl here
# Sample usage:
#   VERSION_STRINGS=$(get_latest_release IntelRealSense/librealsense)function get_latest_release () {# redirect wget to standard out and grep out the tag_namewget -qO- https://api.github.com/repos/$1/releases/latest |grep -Po '"tag_name": "\K.*?(?=")' 
}if [[ $LIBREALSENSE_VERSION == "" ]] ; thenecho "Getting latest librealsense version number"LIBREALSENSE_VERSION=$(get_latest_release IntelRealSense/librealsense)
fiecho "Build with CUDA: "$USE_CUDA
echo "Librealsense Version: $LIBREALSENSE_VERSION"red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# e.g. echo "${red}The red tail hawk ${green}loves the green grass${reset}"echo ""
echo "Please make sure that no RealSense cameras are currently attached"
echo ""
read -n 1 -s -r -p "Press any key to continue"
echo ""# 用于检查变量 $LIBREALSENSE_DIRECTORY 指定的路径是否不存在,如果该路径不存在,脚本会进入 then 分支
if [ ! -d "$LIBREALSENSE_DIRECTORY" ] ; then# clone librealsensecd ${HOME}echo "${green}Cloning librealsense${reset}"git clone https://github.com/IntelRealSense/librealsense.git
fi# Is the version of librealsense current enough?
cd $LIBREALSENSE_DIRECTORY
VERSION_TAG=$(git tag -l $LIBREALSENSE_VERSION)
if [ ! $VERSION_TAG  ] ; thenecho ""tput setaf 1echo "==== librealsense Version Mismatch! ============="tput sgr0echo ""echo "The installed version of librealsense is not current enough for these scripts."echo "This script needs librealsense tag version: "$LIBREALSENSE_VERSION "but it is not available."echo "Please upgrade librealsense or remove the librealsense folder before attempting to install again."echo ""exit 1
fi# Checkout version the last tested version of librealsense
git checkout $LIBREALSENSE_VERSION# Install the dependencies
cd $INSTALL_DIR
sudo ./scripts/installDependencies.shcd $LIBREALSENSE_DIRECTORY
git checkout $LIBREALSENSE_VERSION# Now compile librealsense and install
mkdir build 
cd build
# Build examples, including graphical ones
echo "${green}Configuring Make system${reset}"
# Build with CUDA (default), the CUDA flag is USE_CUDA, ie -DUSE_CUDA=true
# 配置环境变量。通常用于配置 CUDA 的开发环境。这些环境变量确保系统能够找到 CUDA 的编译器、工具链和库文件
export CUDACXX=$NVCC_PATH
export PATH=${PATH}:/usr/local/cuda/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64/usr/bin/cmake ../ -DBUILD_EXAMPLES=true -DFORCE_LIBUVC=ON -DBUILD_WITH_CUDA="$USE_CUDA" -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS=bool:true# The library will be installed in /usr/local/lib, header files in /usr/local/include
# The demos, tutorials and tests will located in /usr/local/bin.
echo "${green}Building librealsense, headers, tools and demos${reset}"# If user didn't set # of jobs and we have > 4GB memory then
# set # of jobs to # of cores-1, otherwise 1
if [[ $NUM_PROCS == "" ]] ; thenTOTAL_MEMORY=$(free | awk '/Mem\:/ { print $2 }')if [ $TOTAL_MEMORY -gt 4051048 ] ; thenNUM_CPU=$(nproc)NUM_PROCS=$(($NUM_CPU - 1))elseNUM_PROCS=1fi
fitime make -j$NUM_PROCS
if [ $? -eq 0 ] ; thenecho "librealsense make successful"
else# Try to make again; Sometimes there are issues with the build# because of lack of resources or concurrency issuesecho "librealsense did not build " >&2echo "Retrying ... "# Single thread this timetime make if [ $? -eq 0 ] ; thenecho "librealsense make successful"else# Try to make againecho "librealsense did not successfully build" >&2echo "Please fix issues and retry build"exit 1fi
fi
echo "${green}Installing librealsense, headers, tools and demos${reset}"
sudo make installif  grep -Fxq 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib' ~/.bashrc ; thenecho "PYTHONPATH already exists in .bashrc file"
elseecho 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib' >> ~/.bashrc echo "PYTHONPATH added to ~/.bashrc. Pyhon wrapper is now available for importing pyrealsense2"
ficd $LIBREALSENSE_DIRECTORY
echo "${green}Applying udev rules${reset}"
# Copy over the udev rules so that camera can be run from user space
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm triggerecho "${green}Library Installed${reset}"
echo " "
echo " -----------------------------------------"
echo "The library is installed in /usr/local/lib"
echo "The header files are in /usr/local/include"
echo "The demos and tools are located in /usr/local/bin"
echo " "
echo " -----------------------------------------"
echo " "
http://www.dtcms.com/wzjs/186850.html

相关文章:

  • py可以做网站吗长沙网红打卡地
  • 学做陶艺作品的网站免费的舆情网站app
  • 网站一个页面多少钱恩城seo的网站
  • 网站建设 gei l fb站推广网站2022
  • 网站的建设与维护需要资质吗搜狗站长平台验证不了
  • 沈阳公司网站建设爱站网长尾关键词挖掘查询工具
  • 网站建设是属于虚拟产品吗性价比高seo的排名优化
  • 网站建设及 维护百度竞价网站
  • 找外国男人做老公网站网址收录平台
  • wordpress主题ent破解版廊坊网络推广优化公司
  • 那个网站有免费的模板河南郑州最近的热搜事件
  • 南昌网站建设培训学校惠州网站seo排名优化
  • 南通企业建站程序seo搜索引擎优化原理
  • java php做网站的区别今日刚刚发生的军事新闻
  • 网站模版免费下载seo经典案例分析
  • 武汉哪家网站建设公司好网站建设优化的技巧
  • 找室内设计师上哪个网站知乎推广渠道
  • 北京网站推广seo优化泰安网站建设
  • 建筑设计怎么学成都网站seo收费标准
  • 网站建设要用H5吗企业网络营销方案设计
  • 网站能找到做网站的人广东seo外包服务
  • 设计个人网站的步骤seo外链在线提交工具
  • 琼海做网站优化20条措施
  • 网站规划可以分成哪几步视频app推广
  • 网站域名更改后怎么做映射自创网站
  • 第一网站ppt模板免费下载武汉seo推广优化
  • 网页美工实例教程江门网站优化公司
  • 邯郸58同城网如何优化seo
  • 做网站累吗广州seo招聘信息
  • 济南建设集团有限公司seo网页优化公司