-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe5054f
commit 13d02ca
Showing
2 changed files
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#! /usr/bin/env bash | ||
|
||
# (C) Copyright 2013 ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation nor | ||
# does it submit to any jurisdiction. | ||
|
||
set +x | ||
set -e -o pipefail | ||
|
||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
export PATH=$SCRIPTDIR:$PATH | ||
|
||
# Some defaults for the arguments | ||
PREFIX=$(pwd)/install | ||
openblas_version=0.3.29 | ||
fftw_configure="--enable-shared" | ||
|
||
while [ $# != 0 ]; do | ||
case "$1" in | ||
"--prefix") | ||
PREFIX="$2"; shift | ||
;; | ||
"--version") | ||
openblas_version="$2"; shift | ||
;; | ||
*) | ||
echo "Unrecognized argument '$1'" | ||
exit 1 | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
echo "Installing OpenBLAS version ${openblas_version}" | ||
|
||
openblas_installed=${PREFIX}/openblas-${openblas_version}-installed | ||
if [[ -f "${openblas_installed}" ]]; then | ||
echo "OpenBLAS ${openblas_version} is already installed at ${PREFIX}" | ||
exit | ||
fi | ||
|
||
os=$(uname) | ||
case "$os" in | ||
Darwin) | ||
brew ls --versions openblas || brew install openblas | ||
exit | ||
;; | ||
*Ubuntu*) | ||
sudo apt-get install libopenblas-dev | ||
exit | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
|
||
# if [ -z "${TMPDIR+x}" ]; then | ||
# TMPDIR=${HOME}/tmp | ||
# fi | ||
# mkdir -p ${TMPDIR}/downloads | ||
|
||
# openblas_gh=https://github.com/OpenMathLib/OpenBLAS | ||
# openblas_tarball_url=$openblas_gh/releases/download/v${openblas_version}/OpenBLAS-${openblas_version}.tar.gz | ||
# openblas_tarball=$TMPDIR/downloads/openblas-${openblas_version}.tar.gz | ||
# openblas_dir=$TMPDIR/downloads/openblas-${openblas_version} | ||
|
||
# echo "+ curl -L ${openblas_tarball_url} > ${openblas_tarball}" | ||
# curl -L ${openblas_tarball_url} > ${openblas_tarball} | ||
# echo "+ tar xzf ${openblas_tarball} -C ${TMPDIR}/downloads" | ||
# tar xzf ${openblas_tarball} -C ${TMPDIR}/downloads | ||
# echo "+ cd ${openblas_dir}" | ||
# cd ${openblas_dir} | ||
# echo "+ ./configure --prefix=${PREFIX} ${fftw_configure}" | ||
# ./configure --prefix=${PREFIX} ${fftw_configure} | ||
# echo "+ make -j8" | ||
# make -j8 | ||
# echo "+ make install" | ||
# make install | ||
|
||
# echo "+ rm -rf \${fftw_tarball} \${fftw_dir}" | ||
# rm -rf ${fftw_tarball} ${fftw_dir} | ||
|
||
# echo "+ touch ${fftw_installed}" | ||
# touch ${fftw_installed} |
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