Skip to content

Commit

Permalink
fix .gitignore to allow build*.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
okapies committed Sep 14, 2018
1 parent ddcef8c commit 60f69e2
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build*
build*/
data/*
external/protobuf/
runx/onnx/onnx.pb.cc
Expand Down
66 changes: 66 additions & 0 deletions .travis/build-menoh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# retrieve arguments
while [[ $# != 0 ]]; do
case $1 in
--)
shift
break
;;
--source-dir)
ARG_SOURCE_DIR="$2"
shift 2
;;
--install-dir)
ARG_INSTALL_DIR="$2"
shift 2
;;
--link-static-libgcc)
ARG_LINK_STATIC_LIBGCC="$2"
shift 2
;;
--link-static-libstdcxx)
ARG_LINK_STATIC_LIBSTDCXX="$2"
shift 2
;;
--link-static-libprotobuf)
ARG_LINK_STATIC_LIBPROTOBUF="$2"
shift 2
;;
-*)
err Unknown option \"$1\"
exit
;;
*)
break
;;

esac
done

# validate the arguments
test -n "${ARG_SOURCE_DIR}" || { echo "--source-dir is not specified"; exit 1; }

test -n "${ARG_LINK_STATIC_LIBGCC}" || ARG_LINK_STATIC_LIBGCC='OFF'
test -n "${ARG_LINK_STATIC_LIBSTDCXX}" || ARG_LINK_STATIC_LIBSTDCXX='OFF'
test -n "${ARG_LINK_STATIC_LIBPROTOBUF}" || ARG_LINK_STATIC_LIBPROTOBUF='OFF'

echo -e "\e[33;1mBuilding Menoh\e[0m"

cd ${ARG_SOURCE_DIR}/menoh
[ -d "build" ] || mkdir -p build

cd build
if [ -n "${ARG_INSTALL_DIR}" ]; then
CMAKE_INSTALL_PREFIX="-DCMAKE_INSTALL_PREFIX=${ARG_INSTALL_DIR}"
fi
cmake \
-DCMAKE_BUILD_TYPE=Release \
${CMAKE_INSTALL_PREFIX} \
-DLINK_STATIC_LIBGCC=${ARG_LINK_STATIC_LIBGCC} \
-DLINK_STATIC_LIBSTDCXX=${ARG_LINK_STATIC_LIBSTDCXX} \
-DLINK_STATIC_LIBPROTOBUF=${ARG_LINK_STATIC_LIBPROTOBUF} \
-DENABLE_TEST=ON \
..

make
33 changes: 33 additions & 0 deletions .travis/linux-x86_64/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash -ex

BASE_DIR=$(cd $(dirname $0) && pwd)

# initialize this script
source ${BASE_DIR}/../init-build-linux.sh

# check the environment
docker_exec "ls -l ${WORK_DIR}"
docker_exec "ls -l ${WORK_DIR}/build"
docker_exec "ls -l ${WORK_DIR}/build/${TRAVIS_REPO_SLUG}"

docker_exec "(printenv | grep PATH) && make --version && cmake --version && g++ --version && ldd --version"

# build and install prerequisites
install_protobuf
install_mkldnn

docker_exec "pip3 install --user chainer" # for generating test data

docker_exec "yum list installed"
docker_exec "pip list"

# build and test menoh
prepare_menoh_data
build_menoh
test_menoh

# check the artifact and release
check_menoh_artifact

# release the artifact
# TODO
40 changes: 40 additions & 0 deletions .travis/macosx-x86_64/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

BASE_DIR=$(cd $(dirname $0) && pwd)

# initialize this script
source ${BASE_DIR}/../init-build-osx.sh

# check the environment
ls -l ${WORK_DIR}
ls -l ${WORK_DIR}/build
ls -l ${WORK_DIR}/build/${TRAVIS_REPO_SLUG}

printenv | grep PATH
make --version
cmake --version
g++ --version

# install prerequisites
brew update
brew upgrade python

export PATH=/usr/local/opt/python/libexec/bin:$PATH

brew install numpy || true
brew install opencv mkl-dnn

if [ "$LINK_STATIC" != "true" ]; then brew install protobuf; fi

pip install --user chainer # for generating test data

brew list --versions
pip list

# build and test menoh
prepare_menoh_data
build_menoh
test_menoh

# check the artifact and release
check_menoh_artifact

0 comments on commit 60f69e2

Please sign in to comment.