Skip to content

Commit

Permalink
python3Packages.qiskit-aer: 0.5.2 -> 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
drewrisinger authored and Jon committed Aug 25, 2020
1 parent 886a9bc commit d0c96f2
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 21 deletions.
34 changes: 13 additions & 21 deletions pkgs/development/python-modules/qiskit-aer/default.nix
Expand Up @@ -6,6 +6,9 @@
, cmake
, cvxpy
, cython
, muparserx
, ninja
, nlohmann_json
, numpy
, openblas
, pybind11
Expand All @@ -19,26 +22,28 @@

buildPythonPackage rec {
pname = "qiskit-aer";
version = "0.5.2";
version = "0.6.1";

disabled = pythonOlder "3.5";

src = fetchFromGitHub {
owner = "Qiskit";
repo = "qiskit-aer";
rev = version;
fetchSubmodules = true; # fetch muparserx and other required libraries
sha256 = "0vw6b69h8pvzxhaz3k8sg9ac792gz3kklfv0izs6ra83y1dfwhjz";
sha256 = "1fnv11diis0as8zcc57mamz0gbjd6vj7nw3arxzvwa77ja803sr4";
};

nativeBuildInputs = [
cmake
ninja
scikit-build
];

buildInputs = [
openblas
spdlog
nlohmann_json
muparserx
];

propagatedBuildInputs = [
Expand All @@ -48,10 +53,10 @@ buildPythonPackage rec {
pybind11
];

postPatch = ''
# remove dependency on PyPi cmake package, which isn't in Nixpkgs
substituteInPlace setup.py --replace "'cmake!=3.17,!=3.17.0'" ""
'';
patches = [
# TODO: remove in favor of qiskit-aer PR #877 patch once accepted/stable
./remove-conan-install.patch
];

dontUseCmakeConfigure = true;

Expand All @@ -60,11 +65,6 @@ buildPythonPackage rec {
"-DAER_THRUST_BACKEND=OMP"
];

# Needed to find qiskit.providers.aer modules in cython. This exists in GitHub, don't know why it isn't copied by default
postFixup = ''
touch $out/${python.sitePackages}/qiskit/__init__.pxd
'';

# *** Testing ***

pythonImportsCheck = [
Expand All @@ -77,11 +77,6 @@ buildPythonPackage rec {
pytestCheckHook
];
dontUseSetuptoolsCheck = true; # Otherwise runs tests twice
disabledTests = [
# broken with cvxpy >= 1.1.0, see https://github.com/Qiskit/qiskit-aer/issues/779.
# TODO: Remove once resolved, probably next qiskit-aer version
"test_clifford"
];

preCheck = ''
# Tests include a compiled "circuit" which is auto-built in $HOME
Expand All @@ -100,11 +95,8 @@ buildPythonPackage rec {
description = "High performance simulators for Qiskit";
homepage = "https://qiskit.org/aer";
downloadPage = "https://github.com/QISKit/qiskit-aer/releases";
changelog = "https://qiskit.org/documentation/release_notes.html";
license = licenses.asl20;
maintainers = with maintainers; [ drewrisinger ];
# Doesn't build on aarch64 (libmuparserx issue).
# Can fix by building muparserx from source (https://github.com/beltoforion/muparserx)
# or in future updates (e.g. Raspberry Pi enabled via https://github.com/Qiskit/qiskit-aer/pull/651 & https://github.com/Qiskit/qiskit-aer/pull/660)
platforms = platforms.x86_64;
};
}
@@ -0,0 +1,63 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index efeacfc..77bd6bd 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,11 @@ endif()
# Looking for external libraries
#

-setup_conan()
+find_package(muparserx REQUIRED)
+find_package(nlohmann_json REQUIRED)
+find_package(spdlog REQUIRED)
+# for tests only
+find_package(catch2)

# If we do not set them with a space CMake fails afterwards if nothing is set for this vars!
set(AER_LINKER_FLAGS " ")
@@ -269,16 +273,16 @@ endif()
set(AER_LIBRARIES
${AER_LIBRARIES}
${BLAS_LIBRARIES}
- CONAN_PKG::nlohmann_json
+ nlohmann_json
Threads::Threads
- CONAN_PKG::spdlog
+ spdlog
${DL_LIB}
${THRUST_DEPENDANT_LIBS})

set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} ${CONAN_DEFINES})
# Cython build is only enabled if building through scikit-build.
if(SKBUILD) # Terra Addon build
- set(AER_LIBRARIES ${AER_LIBRARIES} CONAN_PKG::muparserx)
+ set(AER_LIBRARIES ${AER_LIBRARIES} muparserx)
add_subdirectory(qiskit/providers/aer/pulse/qutip_extra_lite/cy)
add_subdirectory(qiskit/providers/aer/backends/wrappers)
add_subdirectory(src/open_pulse)
diff --git a/setup.py b/setup.py
index fd71e9f..1561cc4 100644
--- a/setup.py
+++ b/setup.py
@@ -11,12 +11,6 @@ import inspect

PACKAGE_NAME = os.getenv('QISKIT_AER_PACKAGE_NAME', 'qiskit-aer')

-try:
- from conans import client
-except ImportError:
- subprocess.call([sys.executable, '-m', 'pip', 'install', 'conan'])
- from conans import client
-
try:
from skbuild import setup
except ImportError:
@@ -46,8 +40,6 @@ common_requirements = [

setup_requirements = common_requirements + [
'scikit-build',
- 'cmake!=3.17,!=3.17.0',
- 'conan>=1.22.2'
]

requirements = common_requirements + ['qiskit-terra>=0.12.0']

0 comments on commit d0c96f2

Please sign in to comment.