forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simulator dependency target, fix for Power architecture (#5)
* new dependencies target (make depend) for the qasm-simulator-cpp (cherry picked from commit 3b25390) * changed to executable and bug fix (cherry picked from commit ce8be89) * assume yes for automatic pkg install (cherry picked from commit 2cd7607) * -march not supported on ppc64le. Use -mcpu instead (cherry picked from commit 7cdab8f) * bugfix (cherry picked from commit 831692e)
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 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 |
---|---|---|
|
@@ -5,5 +5,8 @@ all: sim | |
sim: | ||
make -C src | ||
|
||
depend: | ||
./build_dependencies.sh | ||
|
||
clean: | ||
make -C src clean | ||
make -C src clean |
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,46 @@ | ||
#!/bin/bash | ||
|
||
# ------------------------------------------------------------------------------ | ||
# build_dependencies.sh | ||
# | ||
# Dependency installer for qiskit-sdk-py/src/qasm-simulator-cpp | ||
# Running the script: | ||
# 1. Run the script directly | ||
# ./build_dependencies.sh | ||
# 2. Alternatively, build the make depend target (See the Makefile) | ||
# make depend | ||
# | ||
# .. note:: Tested on Ubuntu 16.04 only. | ||
# ------------------------------------------------------------------------------ | ||
set -ex | ||
os_type=`uname -s` | ||
|
||
# Check who is the current user. | ||
USER=$(whoami) | ||
|
||
if [ ${USER} == "root" ] | ||
then | ||
SUDOCMD="" | ||
else | ||
SUDOCMD="sudo" | ||
fi | ||
|
||
# Check the OS Type | ||
echo "OS is $os_type" | ||
|
||
if [[ "$os_type" == "Darwin" ]]; then | ||
${SUDOCMD} xcode-select --install | ||
elif [[ "$os_type" == "Linux" ]]; then | ||
echo "Installing dependencies on Linux" | ||
linux_distro=`cat /etc/*release | grep "ID_LIKE=" | cut -c9- | tr -d '"'` | ||
if [[ "$linux_distro" == "debian" ]]; then | ||
${SUDOCMD} apt-get update | ||
${SUDOCMD} apt-get -y install build-essential libblas-dev liblapack-dev | ||
elif [[ "$linux_distro" == "fedora" ]]; then | ||
${SUDOCMD} yum update | ||
${SUDOCMD} yum -y install devtoolset-6 blas blas-devel lapack lapack-devel | ||
${SUDOCMD} scl enable devtoolset-6 bash | ||
else | ||
echo "Unsupported linux distro: $linux_distro" | ||
fi | ||
fi |
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