build_and_test.sh 707 字节
Newer Older
Y
Yu Yang 已提交
1
#!/bin/bash
Y
Yu Yang 已提交
2
source ./common.sh
L
liaogang 已提交
3

Y
Yu Yang 已提交
4 5
NPROC=1
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
6 7 8 9
  export PYTHONPATH=/opt/python/2.7.12/lib/python2.7/site-packages
  export PYTHONHOME=/opt/python/2.7.12
  export PATH=/opt/python/2.7.12/bin:${PATH}
  cmake .. -DON_TRAVIS=ON -DON_COVERALLS=ON -DCOVERALLS_UPLOAD=ON
Y
Yu Yang 已提交
10
  NRPOC=`nproc`
G
gangliao 已提交
11 12
  make -j $NPROC
  make coveralls
L
liaogang 已提交
13
  sudo make install
Y
Yu Yang 已提交
14
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
15 16
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages
  cmake .. -DON_TRAVIS=ON -DON_COVERALLS=ON -DCOVERALLS_UPLOAD=ON -DWITH_SWIG_PY=ON
Y
Yu Yang 已提交
17
  NPROC=`sysctl -n hw.ncpu`
G
gangliao 已提交
18 19
  make -j $NPROC
  env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="-j $NPROC"
L
liaogang 已提交
20 21
  sudo make install
  sudo paddle version
Y
Yu Yang 已提交
22
fi