port install cmake in mac osx

192:share hostname$ sudo port install cmake

Password:

--->  Computing dependencies for cmake

The following dependencies will be installed:

libarchive

libuv

lzo2

Continue? [Y/n]: y

--->  Fetching archive for lzo2

--->  Attempting to fetch lzo2-2.10_0.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/lzo2

--->  Attempting to fetch lzo2-2.10_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/lzo2

--->  Attempting to fetch lzo2-2.10_0.darwin_18.x86_64.tbz2 from https://kmq.jp.packages.macports.org/lzo2

--->  Fetching distfiles for lzo2

--->  Attempting to fetch lzo-2.10.tar.gz from https://pek.cn.distfiles.macports.org/macports/distfiles/lzo2

--->  Attempting to fetch lzo-2.10.tar.gz from http://cjj.kr.distfiles.macports.org/lzo2

--->  Verifying checksums for lzo2

--->  Extracting lzo2

--->  Configuring lzo2

--->  Building lzo2                                      

--->  Staging lzo2 into destroot                         

--->  Installing lzo2 @2.10_0                            

--->  Activating lzo2 @2.10_0

Error: Failed to activate lzo2: Image error: /opt/local/include/lzo/lzo1.h already exists and does not belong to a registered port.  Unable to activate port lzo2. Use 'port -f activate lzo2' to force the activation.

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_lzo2/lzo2/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Error: Processing of port cmake failed

192:share hostname$ port -f activate lzo2

Error: Insufficient privileges to write to MacPorts install prefix.

192:share hostname$ sudo port -f activate lzo2

Password:

--->  Activating lzo2 @2.10_0

Warning: File /opt/local/include/lzo/lzo1.h already exists.  Moving to: /opt/local/include/lzo/lzo1.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1a.h already exists.  Moving to: /opt/local/include/lzo/lzo1a.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1b.h already exists.  Moving to: /opt/local/include/lzo/lzo1b.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1c.h already exists.  Moving to: /opt/local/include/lzo/lzo1c.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1f.h already exists.  Moving to: /opt/local/include/lzo/lzo1f.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1x.h already exists.  Moving to: /opt/local/include/lzo/lzo1x.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1y.h already exists.  Moving to: /opt/local/include/lzo/lzo1y.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo1z.h already exists.  Moving to: /opt/local/include/lzo/lzo1z.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo2a.h already exists.  Moving to: /opt/local/include/lzo/lzo2a.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzo_asm.h already exists.  Moving to: /opt/local/include/lzo/lzo_asm.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzoconf.h already exists.  Moving to: /opt/local/include/lzo/lzoconf.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzodefs.h already exists.  Moving to: /opt/local/include/lzo/lzodefs.h.mp_1633183939.

Warning: File /opt/local/include/lzo/lzoutil.h already exists.  Moving to: /opt/local/include/lzo/lzoutil.h.mp_1633183939.

Warning: File /opt/local/lib/liblzo2.2.dylib already exists.  Moving to: /opt/local/lib/liblzo2.2.dylib.mp_1633183939.

Warning: File /opt/local/lib/liblzo2.a already exists.  Moving to: /opt/local/lib/liblzo2.a.mp_1633183939.

Warning: File /opt/local/lib/liblzo2.dylib already exists.  Moving to: /opt/local/lib/liblzo2.dylib.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/AUTHORS already exists.  Moving to: /opt/local/share/doc/lzo2/AUTHORS.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/BUGS already exists.  Moving to: /opt/local/share/doc/lzo2/BUGS.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/COPYING already exists.  Moving to: /opt/local/share/doc/lzo2/COPYING.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/ChangeLog already exists.  Moving to: /opt/local/share/doc/lzo2/ChangeLog.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/LZO.FAQ already exists.  Moving to: /opt/local/share/doc/lzo2/LZO.FAQ.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/LZO.TXT already exists.  Moving to: /opt/local/share/doc/lzo2/LZO.TXT.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/LZOAPI.TXT already exists.  Moving to: /opt/local/share/doc/lzo2/LZOAPI.TXT.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/LZOTEST.TXT already exists.  Moving to: /opt/local/share/doc/lzo2/LZOTEST.TXT.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/NEWS already exists.  Moving to: /opt/local/share/doc/lzo2/NEWS.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/README already exists.  Moving to: /opt/local/share/doc/lzo2/README.mp_1633183939.

Warning: File /opt/local/share/doc/lzo2/THANKS already exists.  Moving to: /opt/local/share/doc/lzo2/THANKS.mp_1633183939.

--->  Cleaning lzo2

192:share hostname$ ls /opt/local/include/lzo/lzo1.h.mp_1633183939

ls: /opt/local/include/lzo/lzo1.h.mp_1633183939: No such file or directory

192:share hostname$ ls /opt/local/include/lzo/lzo1.h

/opt/local/include/lzo/lzo1.h

192:share hostname$ sudo port install cmake

Password:

--->  Computing dependencies for cmake

The following dependencies will be installed:

libarchive

libuv

Continue? [Y/n]: y

--->  Fetching archive for libarchive

--->  Attempting to fetch libarchive-3.5.2_0.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/libarchive

--->  Attempting to fetch libarchive-3.5.2_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/libarchive

--->  Attempting to fetch libarchive-3.5.2_0.darwin_18.x86_64.tbz2 from https://kmq.jp.packages.macports.org/libarchive

--->  Fetching distfiles for libarchive

--->  Attempting to fetch libarchive-3.5.2.tar.gz from https://pek.cn.distfiles.macports.org/macports/distfiles/libarchive

--->  Attempting to fetch libarchive-3.5.2.tar.gz from http://cjj.kr.distfiles.macports.org/libarchive

--->  Verifying checksums for libarchive                                             

--->  Extracting libarchive

--->  Applying patches to libarchive

--->  Configuring libarchive

--->  Building libarchive                                

--->  Staging libarchive into destroot                   

--->  Installing libarchive @3.5.2_0                     

--->  Activating libarchive @3.5.2_0

Error: Failed to activate libarchive: Image error: /opt/local/bin/bsdcpio already exists and does not belong to a registered port.  Unable to activate port libarchive. Use 'port -f activate libarchive' to force the activation.

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_libarchive/libarchive/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Error: Processing of port cmake failed

192:share hostname$ sudo port -f activate libarchive

--->  Computing dependencies for libarchive

--->  Activating libarchive @3.5.2_0

Warning: File /opt/local/bin/bsdcpio already exists.  Moving to: /opt/local/bin/bsdcpio.mp_1633184820.

Warning: File /opt/local/bin/bsdtar already exists.  Moving to: /opt/local/bin/bsdtar.mp_1633184820.

Warning: File /opt/local/include/archive.h already exists.  Moving to: /opt/local/include/archive.h.mp_1633184820.

Warning: File /opt/local/include/archive_entry.h already exists.  Moving to: /opt/local/include/archive_entry.h.mp_1633184820.

Warning: File /opt/local/lib/libarchive.13.dylib already exists.  Moving to: /opt/local/lib/libarchive.13.dylib.mp_1633184820.

Warning: File /opt/local/lib/libarchive.a already exists.  Moving to: /opt/local/lib/libarchive.a.mp_1633184820.

Warning: File /opt/local/lib/libarchive.dylib already exists.  Moving to: /opt/local/lib/libarchive.dylib.mp_1633184820.

Warning: File /opt/local/lib/pkgconfig/libarchive.pc already exists.  Moving to: /opt/local/lib/pkgconfig/libarchive.pc.mp_1633184820.

Warning: File /opt/local/share/man/man1/bsdcpio.1.gz already exists.  Moving to: /opt/local/share/man/man1/bsdcpio.1.gz.mp_1633184820.

Warning: File /opt/local/share/man/man1/bsdtar.1.gz already exists.  Moving to: /opt/local/share/man/man1/bsdtar.1.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_acl.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_acl.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_linkify.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_linkify.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_paths.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_paths.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_perms.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_perms.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_stat.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_stat.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_entry_time.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_entry_time.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_data.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_data.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_disk.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_disk.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_extract.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_extract.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_filter.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_filter.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_format.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_format.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_free.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_free.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_header.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_header.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_new.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_new.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_open.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_open.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_read_set_options.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_read_set_options.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_util.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_util.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_blocksize.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_blocksize.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_data.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_data.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_disk.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_disk.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_filter.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_filter.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_finish_entry.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_finish_entry.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_format.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_format.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_free.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_free.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_header.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_header.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_new.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_new.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_open.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_open.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/archive_write_set_options.3.gz already exists.  Moving to: /opt/local/share/man/man3/archive_write_set_options.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/libarchive.3.gz already exists.  Moving to: /opt/local/share/man/man3/libarchive.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/libarchive_changes.3.gz already exists.  Moving to: /opt/local/share/man/man3/libarchive_changes.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man3/libarchive_internals.3.gz already exists.  Moving to: /opt/local/share/man/man3/libarchive_internals.3.gz.mp_1633184820.

Warning: File /opt/local/share/man/man5/cpio.5.gz already exists.  Moving to: /opt/local/share/man/man5/cpio.5.gz.mp_1633184820.

Warning: File /opt/local/share/man/man5/libarchive-formats.5.gz already exists.  Moving to: /opt/local/share/man/man5/libarchive-formats.5.gz.mp_1633184820.

Warning: File /opt/local/share/man/man5/mtree.5.gz already exists.  Moving to: /opt/local/share/man/man5/mtree.5.gz.mp_1633184820.

Warning: File /opt/local/share/man/man5/tar.5.gz already exists.  Moving to: /opt/local/share/man/man5/tar.5.gz.mp_1633184820.

--->  Cleaning libarchive

192:share hostname$ sudo port install cmake

Password:

--->  Computing dependencies for cmake

The following dependencies will be installed:  libuv

Continue? [Y/n]: y

--->  Fetching archive for libuv

--->  Attempting to fetch libuv-1.42.0_0.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/libuv

--->  Attempting to fetch libuv-1.42.0_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/libuv

--->  Attempting to fetch libuv-1.42.0_0.darwin_18.x86_64.tbz2 from https://kmq.jp.packages.macports.org/libuv

--->  Fetching distfiles for libuv

--->  Attempting to fetch libuv-1.42.0.tar.gz from https://pek.cn.distfiles.macports.org/macports/distfiles/libuv

--->  Attempting to fetch libuv-1.42.0.tar.gz from http://cjj.kr.distfiles.macports.org/libuv

--->  Verifying checksums for libuv                                                  

--->  Extracting libuv

--->  Applying patches to libuv

--->  Configuring libuv

--->  Building libuv                                     

--->  Staging libuv into destroot                        

--->  Installing libuv @1.42.0_0                         

--->  Activating libuv @1.42.0_0

--->  Cleaning libuv

--->  Fetching archive for cmake

--->  Attempting to fetch cmake-3.21.3_0.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/cmake

--->  Attempting to fetch cmake-3.21.3_0.darwin_18.x86_64.tbz2 from https://packages.macports.org/cmake

--->  Attempting to fetch cmake-3.21.3_0.darwin_18.x86_64.tbz2 from https://kmq.jp.packages.macports.org/cmake

--->  Fetching distfiles for cmake

--->  Attempting to fetch cmake-3.21.3.tar.bz2 from https://pek.cn.distfiles.macports.org/macports/distfiles/cmake

--->  Attempting to fetch cmake-3.21.3.tar.bz2 from http://cjj.kr.distfiles.macports.org/cmake

--->  Verifying checksums for cmake                                                  

--->  Extracting cmake

--->  Applying patches to cmake

--->  Configuring cmake

--->  Building cmake                                     

      [                                        ]  94.0 %    

      [                                        ]  95.0 %

      [                                        ]  96.0 %

--->  Staging cmake into destroot                        

--->  Installing cmake @3.21.3_0                         

--->  Activating cmake @3.21.3_0

Error: Failed to activate cmake: Image error: /opt/local/bin/ccmake already exists and does not belong to a registered port.  Unable to activate port cmake. Use 'port -f activate cmake' to force the activation.

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Error: Processing of port cmake failed

192:share hostname$ sudo port -f activate cmake

Password:

--->  Computing dependencies for cmake

--->  Activating cmake @3.21.3_0

Warning: File /opt/local/bin/ccmake already exists.  Moving to: /opt/local/bin/ccmake.mp_1633186119.

Warning: File /opt/local/bin/cmake already exists.  Moving to: /opt/local/bin/cmake.mp_1633186119.

Warning: File /opt/local/bin/cpack already exists.  Moving to: /opt/local/bin/cpack.mp_1633186119.

Warning: File /opt/local/bin/ctest already exists.  Moving to: /opt/local/bin/ctest.mp_1633186119.

Warning: File /opt/local/share/aclocal/cmake.m4 already exists.  Moving to: /opt/local/share/aclocal/cmake.m4.mp_1633186119.

Warning: File /opt/local/share/doc/cmake/Copyright.txt already exists.  Moving to: /opt/local/share/doc/cmake/Copyright.txt.mp_1633186119.

Warning: File /opt/local/share/doc/cmake/cmsys/Copyright.txt already exists.  Moving to: /opt/local/share/doc/cmake/cmsys/Copyright.txt.mp_1633186119.

Warning: File /opt/local/share/emacs/site-lisp/cmake-mode.el already exists.  Moving to: /opt/local/share/emacs/site-lisp/cmake-mode.el.mp_1633186119.

--->  Cleaning cmake

#!/usr/bin/env bash set -x set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd "$SCRIPT_DIR" >/dev/null downloadHighPolySuv=true MIN_CMAKE_VERSION=3.10.0 # On macOS, make sure we have a CMake that will support CMAKE_APPLE_SILICON_PROCESSOR. if [ "$(uname)" == "Darwin" ]; then MIN_CMAKE_VERSION=3.19.2 fi DEBUG="${DEBUG:-false}" function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } # brew gives error if package is already installed function brew_install() { brew list "$1" &>/dev/null || brew install "$1"; } # Parse command line arguments while [[ $# -gt 0 ]] do key="$1" case $key in --debug) DEBUG=true ;; --no-full-poly-car) downloadHighPolySuv=false shift # past value ;; esac done # llvm tools if [ "$(uname)" == "Darwin" ]; then # osx brew update # Update below line for newer versions #brew install llvm@8 brew install llvm else #linux sudo apt-get update sudo apt-get -y install --no-install-recommends \ lsb-release \ rsync \ software-properties-common \ wget \ libvulkan1 \ vulkan-utils #install clang and build tools VERSION=$(lsb_release -rs | cut -d. -f1) # Since Ubuntu 17 clang is part of the core repository # See https://packages.ubuntu.com/search?keywords=clang-8 if [ "$VERSION" -lt "17" ]; then wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update fi sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev fi if ! which cmake; then # CMake not installed cmake_ver=0 else cmake_ver=$(cmake --version 2>&1 | head -n1 | cut -d ' ' -f3 | awk '{print $NF}') fi #give user perms to access USB port - this is not needed if not using PX4 HIL #TODO: figure out how to do below in travis # Install additional tools, CMake if required if [ "$(uname)" == "Darwin" ]; then # osx if [[ -n "${whoami}" ]]; then #this happens when running in travis sudo dseditgroup -o edit -a "$(whoami)" -t user dialout fi brew_install wget brew_install coreutils if version_less_than_equal_to "$cmake_ver" "$MIN_CMAKE_VERSION"; then brew install cmake # should get cmake 3.8 else echo "Already have good version of cmake: $cmake_ver" fi else #linux if [[ -n "${whoami}" ]]; then #this happens when running in travis sudo /usr/sbin/useradd -G dialout "$USER" sudo usermod -a -G dialout "$USER" fi # install additional tools sudo apt-get install -y build-essential unzip if version_less_than_equal_to "$cmake_ver" "$MIN_CMAKE_VERSION"; then # in ubuntu 18 docker CI, avoid building cmake from scratch to save time # ref: https://apt.kitware.com/ if [ "$(lsb_release -rs)" == "18.04" ]; then sudo apt-get -y install \ apt-transport-https \ ca-certificates \ gnupg wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' sudo apt-get -y install --no-install-recommends \ make \ cmake else # For Ubuntu 16.04, or anything else, build CMake 3.10.2 from source if [[ ! -d "cmake_build/bin" ]]; then echo "Downloading cmake..." wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz \ -O cmake.tar.gz tar -xzf cmake.tar.gz rm cmake.tar.gz rm -rf ./cmake_build mv ./cmake-3.10.2 ./cmake_build pushd cmake_build ./bootstrap make popd fi fi else echo "Already have good version of cmake: $cmake_ver" fi fi # End USB setup, CMake install # Download rpclib if [ ! -d "external/rpclib/rpclib-2.3.0" ]; then echo "*********************************************************************************************" echo "Downloading rpclib..." echo "*********************************************************************************************" wget https://github.com/rpclib/rpclib/archive/v2.3.0.zip # remove previous versions rm -rf "external/rpclib" mkdir -p "external/rpclib" unzip -q v2.3.0.zip -d external/rpclib rm v2.3.0.zip fi # Download high-polycount SUV model if $downloadHighPolySuv; then if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv" ]; then mkdir -p "Unreal/Plugins/AirSim/Content/VehicleAdv" fi if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.2.0" ]; then echo "*********************************************************************************************" echo "Downloading high-poly car assets.... The download is ~37MB and can take some time." echo "To install without this assets, re-run setup.sh with the argument --no-full-poly-car" echo "*********************************************************************************************" if [ -d "suv_download_tmp" ]; then rm -rf "suv_download_tmp" fi mkdir -p "suv_download_tmp" cd suv_download_tmp wget https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip if [ -d "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV" ]; then rm -rf "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV" fi unzip -q car_assets.zip -d ../Unreal/Plugins/AirSim/Content/VehicleAdv cd .. rm -rf "suv_download_tmp" fi else echo "### Not downloading high-poly car asset (--no-full-poly-car). The default unreal vehicle will be used." fi echo "Installing Eigen library..." if [ ! -d "AirLib/deps/eigen3" ]; then echo "Downloading Eigen..." wget -O eigen3.zip https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip unzip -q eigen3.zip -d temp_eigen mkdir -p AirLib/deps/eigen3 mv temp_eigen/eigen*/Eigen AirLib/deps/eigen3 rm -rf temp_eigen rm eigen3.zip else echo "Eigen is already installed." fi popd >/dev/null set +x echo "" echo "************************************" echo "AirSim setup completed successfully!" echo "************************************"
11-07
解读 cmake配置文件并给出说明? cmake_minimum_required (VERSION 2.8.7) project (nanomsg C) include (CheckFunctionExists) include (CheckSymbolExists) include (CheckStructHasMember) include (CheckLibraryExists) include (CheckCSourceCompiles) include (GNUInstallDirs) if (POLICY CMP0042) # Newer cmake on MacOS should use @rpath cmake_policy (SET CMP0042 NEW) endif () set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) if ("${isSystemDir}" STREQUAL "-1") set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif ("${isSystemDir}" STREQUAL "-1") set (NN_DESCRIPTION "High-Performance Scalability Protocols") set (ISSUE_REPORT_MSG "Please consider opening an issue at https://github.com/nanomsg/nanomsg") # Determine library versions. file (READ src/nn.h NN_HDR_STR) string (REGEX REPLACE ".*#define +NN_VERSION_CURRENT +([0-9]+).*" "\\1" NN_VERSION_CURRENT "${NN_HDR_STR}") string (REGEX REPLACE ".*#define +NN_VERSION_REVISION +([0-9]+).*" "\\1" NN_VERSION_REVISION "${NN_HDR_STR}") string (REGEX REPLACE ".*#define +NN_VERSION_AGE +([0-9]+).*" "\\1" NN_VERSION_AGE "${NN_HDR_STR}") if ((NN_VERSION_CURRENT STREQUAL "") OR (NN_VERSION_REVISION STREQUAL "") OR (NN_VERSION_AGE STREQUAL "")) message (FATAL_ERROR "Could not read ABI version from nn.h") else () set (NN_ABI_VERSION "${NN_VERSION_CURRENT}.${NN_VERSION_REVISION}.${NN_VERSION_AGE}") message (STATUS "Detected nanomsg ABI v${NN_ABI_VERSION}") endif () # Determine package version. find_package (Git QUIET) if (DEFINED ENV{TRAVIS_TAG}) set (NN_PACKAGE_VERSION "$ENV{TRAVIS_TAG}") elseif (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") # Working off a git repo, using git versioning # Get version from last tag execute_process ( COMMAND "${GIT_EXECUTABLE}" describe --always# | sed -e "s:v::" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE NN_PACKAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) # If the sources have been changed locally, add -dirty to the version. execute_process ( COMMAND "${GIT_EXECUTABLE}" diff --quiet WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res) if (res EQUAL 1) set (NN_PACKAGE_VERSION "${NN_PACKAGE_VERSION}-dirty") endif() elseif (EXISTS ${PROJECT_SOURCE_DIR}/.version) # If git is not available (e.g. when building from source package) # we can extract the package version from .version file. file (STRINGS .version NN_PACKAGE_VERSION) else () set (NN_PACKAGE_VERSION "Unknown") endif() # User-defined options. option (NN_STATIC_LIB "Build static library instead of shared library." OFF) option (NN_ENABLE_DOC "Enable building documentation." ON) option (NN_ENABLE_GETADDRINFO_A "Enable/disable use of getaddrinfo_a in place of getaddrinfo." ON) option (NN_TESTS "Build and run nanomsg tests" ON) option (NN_TOOLS "Build nanomsg tools" ON) option (NN_ENABLE_NANOCAT "Enable building nanocat utility." ${NN_TOOLS}) # Platform checks. find_package (Threads REQUIRED) if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_definitions (-DNN_HAVE_LINUX) elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") add_definitions (-DNN_HAVE_OSX) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") set (NN_HAVE_WINSOCK 1) add_definitions (-DNN_HAVE_WINDOWS) add_definitions (-D_CRT_SECURE_NO_WARNINGS) # Target Windows Vista and later add_definitions (-D_WIN32_WINNT=0x0600) list (APPEND CMAKE_REQUIRED_DEFINITIONS -D_WIN32_WINNT=0x0600) elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_definitions (-DNN_HAVE_FREEBSD) elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") add_definitions (-DNN_HAVE_NETBSD) elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") add_definitions (-DNN_HAVE_OPENBSD) elseif (CMAKE_SYSTEM_NAME MATCHES "Solaris|SunOS") add_definitions (-DNN_HAVE_SOLARIS) elseif (CMAKE_SYSTEM_NAME MATCHES "HP-UX") add_definitions (-DNN_HAVE_HPUX) elseif (CMAKE_SYSTEM_NAME MATCHES "QNX") add_definitions (-DNN_HAVE_QNX) else () message (AUTHOR_WARNING "WARNING: This platform may or may not be supported: ${CMAKE_SYSTEM_NAME}") message (AUTHOR_WARNING "${ISSUE_REPORT_MSG}") endif () if (NN_STATIC_LIB) add_definitions (-DNN_STATIC_LIB) endif () macro (nn_check_func SYM DEF) check_function_exists (${SYM} ${DEF}) if (${DEF}) add_definitions (-D${DEF}=1) endif () endmacro (nn_check_func) macro (nn_check_sym SYM HDR DEF) check_symbol_exists (${SYM} ${HDR} ${DEF}) if (${DEF}) add_definitions (-D${DEF}=1) endif () endmacro (nn_check_sym) macro (nn_check_lib LIB SYM DEF) check_library_exists (${LIB} ${SYM} "" ${DEF}) if (${DEF}) add_definitions (-D${DEF}=1) set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} ${LIB}) endif () endmacro (nn_check_lib) macro (nn_check_struct_member STR MEM HDR DEF) check_struct_has_member ("struct ${STR}" ${MEM} ${HDR} ${DEF}) if (${DEF}) add_definitions (-D${DEF}=1) endif () endmacro (nn_check_struct_member) if (WIN32) # Windows is a special snowflake. set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} ws2_32) set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} mswsock) set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} advapi32) nn_check_sym (InitializeConditionVariable windows.h NN_HAVE_CONDVAR) if (NOT NN_HAVE_CONDVAR) message (FATAL_ERROR "Modern Windows API support is missing. " "Versions of Windows prior to Vista are not supported. " "Further, the 32-bit MinGW environment is not supported. " "Ensure you have at least Windows Vista or newer, and are " "using either Visual Studio 2010 or newer or MinGW-W64.") endif() else () # Unconditionally declare the following feature test macros. These are # needed for some platforms (glibc and SunOS/illumos) and should be harmless # on the others. add_definitions (-D_GNU_SOURCE) add_definitions (-D_REENTRANT) add_definitions (-D_THREAD_SAFE) add_definitions (-D_POSIX_PTHREAD_SEMANTICS) nn_check_func (gethrtime NN_HAVE_GETHRTIME) nn_check_func (socketpair NN_HAVE_SOCKETPAIR) nn_check_func (eventfd NN_HAVE_EVENTFD) nn_check_func (pipe NN_HAVE_PIPE) nn_check_func (pipe2 NN_HAVE_PIPE2) nn_check_func (accept4 NN_HAVE_ACCEPT4) nn_check_func (epoll_create NN_HAVE_EPOLL) nn_check_func (kqueue NN_HAVE_KQUEUE) nn_check_func (poll NN_HAVE_POLL) nn_check_lib (anl getaddrinfo_a NN_HAVE_GETADDRINFO_A) nn_check_lib (rt clock_gettime NN_HAVE_CLOCK_GETTIME) nn_check_lib (rt sem_wait NN_HAVE_SEMAPHORE_RT) nn_check_lib (pthread sem_wait NN_HAVE_SEMAPHORE_PTHREAD) nn_check_lib (nsl gethostbyname NN_HAVE_LIBNSL) nn_check_lib (socket socket NN_HAVE_LIBSOCKET) nn_check_sym (CLOCK_MONOTONIC time.h NN_HAVE_CLOCK_MONOTONIC) nn_check_sym (atomic_cas_32 atomic.h NN_HAVE_ATOMIC_SOLARIS) nn_check_sym (AF_UNIX sys/socket.h NN_HAVE_UNIX_SOCKETS) nn_check_sym (backtrace_symbols_fd execinfo.h NN_HAVE_BACKTRACE) nn_check_struct_member(msghdr msg_control sys/socket.h NN_HAVE_MSG_CONTROL) if (NN_HAVE_SEMAPHORE_RT OR NN_HAVE_SEMAPHORE_PTHREAD) add_definitions (-DNN_HAVE_SEMAPHORE) endif () endif () if (NOT NN_ENABLE_GETADDRINFO_A) add_definitions (-DNN_DISABLE_GETADDRINFO_A) endif () check_c_source_compiles (" #include <stdint.h> int main() { volatile uint32_t n = 0; __sync_fetch_and_add (&n, 1); __sync_fetch_and_sub (&n, 1); return 0; } " NN_HAVE_GCC_ATOMIC_BUILTINS) if (NN_HAVE_GCC_ATOMIC_BUILTINS) add_definitions (-DNN_HAVE_GCC_ATOMIC_BUILTINS) endif () add_subdirectory (src) # Build the tools if (NN_ENABLE_NANOCAT) add_executable (nanocat tools/nanocat.c tools/options.c) target_link_libraries (nanocat ${PROJECT_NAME}) endif () if (NN_ENABLE_DOC) find_program (ASCIIDOCTOR_EXE asciidoctor) if (NOT ASCIIDOCTOR_EXE) message (WARNING "Could not find asciidoctor: skipping docs") set (NN_ENABLE_DOC OFF) else () message (STATUS "Using asciidoctor at ${ASCIIDOCTOR_EXE}") endif () endif () # Build the documenation if (NN_ENABLE_DOC) set (NN_DOCDIR ${CMAKE_CURRENT_SOURCE_DIR}/doc) set (NN_STYLESHEET ${NN_DOCDIR}/stylesheet.css) set (NN_TITLE ${PROJECT_NAME} ${NN_PACKAGE_VERSION}) set (NN_A2M ${ASCIIDOCTOR_EXE} -b manpage -amanmanual='${NN_TITLE}') set (NN_A2H ${ASCIIDOCTOR_EXE} -d manpage -b html5 -a stylesheeet=${NN_STYLESHEET} -aversion-label=${PROJECT_NAME} -arevnumber=${NN_PACKAGE_VERSION}) macro (add_libnanomsg_man NAME SECT) add_custom_command ( OUTPUT ${NAME}.${SECT} COMMAND ${NN_A2M} -o ${NAME}.${SECT} ${NN_DOCDIR}/${NAME}.adoc MAIN_DEPENDENCY ${NN_DOCDIR}/${NAME}.adoc ) add_custom_command ( OUTPUT ${NAME}.html COMMAND ${NN_A2H} -o ${NAME}.html ${NN_DOCDIR}/${NAME}.adoc DEPENDS ${NN_STYLESHEET} MAIN_DEPENDENCY ${NN_DOCDIR}/${NAME}.adoc ) set(NN_MANS ${NN_MANS} ${NAME}.${SECT}) set(NN_HTMLS ${NN_HTMLS} ${NAME}.html) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.html DESTINATION ${CMAKE_INSTALL_DOCDIR} ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.${SECT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${SECT} ) endmacro (add_libnanomsg_man) if (NN_ENABLE_NANOCAT) add_libnanomsg_man (nanocat 1) endif () add_libnanomsg_man (nn_errno 3) add_libnanomsg_man (nn_strerror 3) add_libnanomsg_man (nn_symbol 3) add_libnanomsg_man (nn_symbol_info 3) add_libnanomsg_man (nn_allocmsg 3) add_libnanomsg_man (nn_reallocmsg 3) add_libnanomsg_man (nn_freemsg 3) add_libnanomsg_man (nn_socket 3) add_libnanomsg_man (nn_close 3) add_libnanomsg_man (nn_get_statistic 3) add_libnanomsg_man (nn_getsockopt 3) add_libnanomsg_man (nn_setsockopt 3) add_libnanomsg_man (nn_bind 3) add_libnanomsg_man (nn_connect 3) add_libnanomsg_man (nn_shutdown 3) add_libnanomsg_man (nn_send 3) add_libnanomsg_man (nn_recv 3) add_libnanomsg_man (nn_sendmsg 3) add_libnanomsg_man (nn_recvmsg 3) add_libnanomsg_man (nn_device 3) add_libnanomsg_man (nn_cmsg 3) add_libnanomsg_man (nn_poll 3) add_libnanomsg_man (nn_term 3) add_libnanomsg_man (nanomsg 7) add_libnanomsg_man (nn_pair 7) add_libnanomsg_man (nn_reqrep 7) add_libnanomsg_man (nn_pubsub 7) add_libnanomsg_man (nn_survey 7) add_libnanomsg_man (nn_pipeline 7) add_libnanomsg_man (nn_bus 7) add_libnanomsg_man (nn_inproc 7) add_libnanomsg_man (nn_ipc 7) add_libnanomsg_man (nn_tcp 7) add_libnanomsg_man (nn_ws 7) add_libnanomsg_man (nn_env 7) add_custom_target (man ALL DEPENDS ${NN_MANS}) add_custom_target (html ALL DEPENDS ${NN_HTMLS}) endif () # Build unit tests. if (NN_TESTS) enable_testing () set (all_tests "") set (TEST_PORT 12100) macro (add_libnanomsg_test NAME TIMEOUT) list (APPEND all_tests ${NAME}) add_executable (${NAME} tests/${NAME}.c) target_link_libraries (${NAME} ${PROJECT_NAME}) add_test (NAME ${NAME} COMMAND ${NAME} ${TEST_PORT}) set_tests_properties (${NAME} PROPERTIES TIMEOUT ${TIMEOUT}) math (EXPR TEST_PORT "${TEST_PORT}+10") endmacro (add_libnanomsg_test) # Transport tests. add_libnanomsg_test (inproc 5) add_libnanomsg_test (inproc_shutdown 5) add_libnanomsg_test (ipc 5) add_libnanomsg_test (ipc_shutdown 30) add_libnanomsg_test (ipc_stress 5) add_libnanomsg_test (tcp 5) add_libnanomsg_test (tcp_shutdown 120) add_libnanomsg_test (ws 5) # Protocol tests. add_libnanomsg_test (pair 5) add_libnanomsg_test (pubsub 5) add_libnanomsg_test (reqrep 5) add_libnanomsg_test (pipeline 5) add_libnanomsg_test (survey 5) add_libnanomsg_test (bus 5) # Feature tests. add_libnanomsg_test (async_shutdown 30) add_libnanomsg_test (block 5) add_libnanomsg_test (term 5) add_libnanomsg_test (timeo 5) add_libnanomsg_test (iovec 5) add_libnanomsg_test (msg 5) add_libnanomsg_test (prio 5) add_libnanomsg_test (poll 5) add_libnanomsg_test (device 5) add_libnanomsg_test (device4 5) add_libnanomsg_test (device5 5) add_libnanomsg_test (device6 5) add_libnanomsg_test (device7 30) add_libnanomsg_test (emfile 5) add_libnanomsg_test (domain 5) add_libnanomsg_test (trie 5) add_libnanomsg_test (list 5) add_libnanomsg_test (hash 5) add_libnanomsg_test (stats 5) add_libnanomsg_test (symbol 5) add_libnanomsg_test (separation 5) add_libnanomsg_test (zerocopy 5) add_libnanomsg_test (shutdown 5) add_libnanomsg_test (cmsg 5) add_libnanomsg_test (bug328 5) add_libnanomsg_test (bug777 5) add_libnanomsg_test (ws_async_shutdown 5) add_libnanomsg_test (reqttl 10) add_libnanomsg_test (surveyttl 10) # Platform-specific tests if (WIN32) add_libnanomsg_test (win_sec_attr 5) endif() # Build the performance tests. macro (add_libnanomsg_perf NAME) add_executable (${NAME} perf/${NAME}.c) target_link_libraries (${NAME} ${PROJECT_NAME}) endmacro (add_libnanomsg_perf) add_libnanomsg_perf (inproc_lat) add_libnanomsg_perf (inproc_thr) add_libnanomsg_perf (local_lat) add_libnanomsg_perf (remote_lat) add_libnanomsg_perf (local_thr) add_libnanomsg_perf (remote_thr) endif () install (TARGETS LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install (TARGETS ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install (FILES src/nn.h DESTINATION include/nanomsg) install (FILES src/inproc.h DESTINATION include/nanomsg) install (FILES src/ipc.h DESTINATION include/nanomsg) install (FILES src/tcp.h DESTINATION include/nanomsg) install (FILES src/ws.h DESTINATION include/nanomsg) install (FILES src/pair.h DESTINATION include/nanomsg) install (FILES src/pubsub.h DESTINATION include/nanomsg) install (FILES src/reqrep.h DESTINATION include/nanomsg) install (FILES src/pipeline.h DESTINATION include/nanomsg) install (FILES src/survey.h DESTINATION include/nanomsg) install (FILES src/bus.h DESTINATION include/nanomsg) if (NN_ENABLE_NANOCAT) install (TARGETS nanocat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() set (CPACK_PACKAGE_NAME ${PROJECT_NAME}) set (CPACK_PACKAGE_VERSION ${NN_PACKAGE_VERSION}) set (CPACK_SOURCE_GENERATOR "TBZ2;TGZ;ZIP") set (CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}") set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${NN_PACKAGE_VERSION}") add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) include (CPack)
09-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值