Added first pass of script to automatically generate self-contained precompiled matlab toolbox

release/4.3a0
Richard Roberts 2012-09-03 18:32:49 +00:00
parent c662cdca11
commit f16a981a27
2 changed files with 44 additions and 0 deletions

View File

@ -175,6 +175,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSIO
#set(CPACK_INSTALLED_DIRECTORIES ".") # FIXME: throws error
set(CPACK_SOURCE_IGNORE_FILES "/build*;/\\\\.;/makestats.sh$")
set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}" "/gtsam_unstable/")
set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}" "/package_scripts/")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "gtsam-${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}")
#set(CPACK_SOURCE_PACKAGE_FILE_NAME "gtsam-aspn${GTSAM_VERSION_PATCH}") # Used for creating ASPN tarballs

View File

@ -0,0 +1,43 @@
#!/bin/sh
# Detect platform
os=`uname -s`
arch=`uname -p`
if [ "$os" = "Linux" -a "$arch" = "x86_64" ]; then
platform=lin64
elif [ "$os" = "Linux" -a "$arch" = "i686" ]; then
platform=lin32
else
echo "Unrecognized platform"
exit 1
fi
echo "Platform is ${platform}"
# Check for empty directory
if [ ! -z "`ls`" ]; then
echo "Please run this script from an empty build directory"
exit 1
fi
# Check for boost
if [ -z "$1" -o -z "$2" ]; then
echo "Usage: $0 BOOSTTREE MEX"
echo "BOOSTTREE should be a boost source tree compiled with toolbox_build_boost."
echo "MEX should be the full path of the mex compiler"
exit 1
fi
# Run cmake
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/stage" -DBoost_NO_SYSTEM_PATHS:bool=true -DBoost_USE_STATIC_LIBS:bool=true -DBOOST_ROOT="$1" -DGTSAM_BUILD_UNSTABLE:bool=false -DGTSAM_DISABLE_EXAMPLES_ON_INSTALL:bool=true -DGTSAM_DISABLE_TESTS_ON_INSTALL:bool=true -DGTSAM_MEX_BUILD_STATIC_MODULE:bool=true -DMEX_COMMAND="$2" ..
if [ ! $? ]; then
echo "CMake failed"
exit 1
fi
# Compile
make -j4 install
# Create package
tar czf gtsam-toolbox-2.1.0-$platform.tgz -C stage/borg toolbox