-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TravisCI] Cache local OpenBLAS build
This fixes a Torch bug we've been having on Travis for a while now. We had only been building OpenBLAS from source when there was no cached torch build present on the build machine. That meant you could get a cached build of Torch which was built against one version of OpenBLAS, but the system actually installed an older version. This led to memory corruption and segmentation faults.
- Loading branch information
1 parent
a1461cc
commit e6be9fe
Showing
3 changed files
with
33 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
set -e | ||
|
||
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
|
||
if [ "$#" -ne 1 ]; | ||
then | ||
echo "Usage: $0 INSTALL_DIR" | ||
exit 1 | ||
fi | ||
|
||
INSTALL_DIR=`readlink -f $1` | ||
if [ -d "$INSTALL_DIR" ] && ls $INSTALL_DIR/*.so >/dev/null 2>&1; then | ||
echo "Using cached build at $INSTALL_DIR ..." | ||
else | ||
rm -rf $INSTALL_DIR | ||
git clone https://github.com/xianyi/OpenBLAS.git ${INSTALL_DIR} -b v0.2.18 --depth 1 | ||
cd $INSTALL_DIR | ||
|
||
# Redirect build output to a log and only show it if an error occurs | ||
# Otherwise there is too much output for TravisCI to display properly | ||
LOG_FILE=$LOCAL_DIR/openblas-build.log | ||
make NO_AFFINITY=1 USE_OPENMP=1 >$LOG_FILE 2>&1 || (cat $LOG_FILE && false) | ||
fi | ||
|
||
cd $INSTALL_DIR | ||
sudo make install PREFIX=/usr/local |
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