forked from ucla-vision/xivo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gperftools for performance profiling
- Loading branch information
Showing
5 changed files
with
62 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
#!/bin/bash | ||
# Build script of XIVO software. | ||
# Author: Xiaohan Fei ([email protected]) | ||
# Basic usage: execute the script in terminal | ||
# ./build.sh | ||
# Options: | ||
# 1) ros: build with ROS support | ||
# 2) g2o: build with pose graph optimization from g2o library | ||
# 3) gperf: use google performance profiling tools | ||
# Example: | ||
# ./build.sh ros g2o gperf | ||
|
||
# parsing options | ||
BUILD_ROSNODE=false | ||
BUILD_G2O=false | ||
USE_GPERFTOOLS=false | ||
|
||
for arg in "$@" | ||
do | ||
if [ "$arg" == "ros" ]; then | ||
if [ $arg == "ros" ]; then | ||
BUILD_ROSNODE=true | ||
fi | ||
|
||
if [ "$arg" == "g2o" ]; then | ||
if [ $arg == "g2o" ]; then | ||
BUILD_G2O=true | ||
fi | ||
|
||
if [ $arg == "gperf" ]; then | ||
USE_GPERFTOOLS=true | ||
fi | ||
done | ||
|
||
if [ "$BUILD_ROSNODE" = true ]; then | ||
if [ $BUILD_ROSNODE = true ]; then | ||
echo "BUILD WITH ROS SUPPORT" | ||
fi | ||
|
||
if [ "$BUILD_G2O" = true ]; then | ||
if [ $BUILD_G2O = true ]; then | ||
echo "BUILD WITH G2O SUPPORT" | ||
fi | ||
|
||
if [ $USE_GPERFTOOLS = true ]; then | ||
echo "USE GOOGLE PERFORMANCE TOOLS (GPERFTOOLS) FOR PROFILING" | ||
fi | ||
|
||
|
||
# build dependencies | ||
PROJECT_DIR=$(pwd) | ||
|
@@ -65,13 +84,15 @@ cmake .. -DCMAKE_INSTALL_PREFIX=.. -DBUILD_SHARED_LIBS=TRUE | |
make install -j | ||
|
||
# to build gperftools, need to install autoconf and libtool first | ||
# sudo apt-get install autoconf libtool | ||
# cd $PROJECT_DIR/thirdparty/gperftools | ||
# ./autogen.sh | ||
# ./configure --prefix=$PROJECT_DIR/thirdparty/gperftools | ||
# make install | ||
if [ $USE_GPERFTOOLS = true ]; then | ||
sudo apt-get install autoconf libtool | ||
cd $PROJECT_DIR/thirdparty/gperftools | ||
./autogen.sh | ||
./configure --prefix=$PROJECT_DIR/thirdparty/gperftools | ||
make install | ||
fi | ||
|
||
if [ "$BUILD_G2O" = true ]; then | ||
if [ $BUILD_G2O = true ]; then | ||
cd $PROJECT_DIR/thirdparty/g2o | ||
mkdir build | ||
cd build | ||
|
@@ -84,13 +105,6 @@ fi | |
mkdir ${PROJECT_DIR}/build | ||
cd ${PROJECT_DIR}/build | ||
|
||
if [ "$BUILD_G2O" = true ] && [ "$BUILD_ROSNODE" = true ]; then | ||
cmake .. -DBUILD_G2O=TRUE -DBUILD_ROSNODE=TRUE | ||
elif [ "$BUILD_G2O" = true ]; then | ||
cmake .. -DBUILD_G2O=TRUE | ||
elif [ "$BUILD_ROSNODE" = true ]; then | ||
cmake .. -DBUILD_ROSNODE=TRUE | ||
else | ||
cmake .. | ||
fi | ||
cmake .. -DBUILD_G2O=$BUILD_G2O -DBUILD_ROSNODE=$BUILD_ROSNODE -DUSE_GPERFTOOLS=$USE_GPERFTOOLS | ||
|
||
make -j |
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
Empty file.
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