This repository has been archived by the owner on Oct 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeta.yaml
132 lines (114 loc) · 4.47 KB
/
meta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{% set name = "qulacs" %}
{% set version = "0.1.10.1" %}
{% set sha256 = "7c3909ae63d352ed4b1481d63093cb5971c120c7577353e591a323b7a3d41ada" %}
{% set build = 3 %}
# ensure the variants are defined (needed for conda-smithy)
{% set use_simd = use_simd or "True" %}
{% set cuda_compiler_version = cuda_compiler_version or "undefined" %}
{% if use_simd == "True" %}
{% set build = build + 100 %} # preferred version
{% set simd_suffix = "" %}
{% else %}
{% set simd_suffix = "_no_simd" %}
{% endif %}
{% if cuda_compiler_version != "undefined" %}
{% if cuda_compiler_version != "None" %}
{% set arch = "gpu" %}
{% set pkg_name = "-gpu" %}
{% else %}
{% set arch = "cpu" %}
{% set pkg_name = "" %}
{% endif %}
{% endif %}
package:
name: {{ name|lower }}-conda
version: {{ version }}
source:
- url: https://github.com/qulacs/qulacs/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- setup.patch
- CMakeList.patch
build:
skip: true # [python_impl == "pypy" or not linux]
# avoid building qulacs-conda when there is no output
{% if (arch == "gpu" and use_simd == "False") %}
skip: true
{% endif %}
# HACK 20200805: Only build no_simd version
{% if not (arch == "cpu" and use_simd == "False") %}
skip: true
{% endif %}
outputs:
{% if not (cuda_compiler_version != "None" and use_simd == "False") %}
# this is a metapackage to ensure mutual exclusiveness
- name: qulacs-mutex
# we only bump this when the infrastructure is changed.
version: 1.0
build:
# don't touch this
number: 0
string: {{ arch }}
run_exports:
- {{ pin_subpackage('qulacs-mutex', exact=True) }}
requirements: {}
test:
commands:
- echo "qulacs-mutex metapackage is built"
- name: "{{ name|lower }}{{ pkg_name }}"
version: {{ version }}
build:
number: {{ build }}
string: "py{{ py }}h{{ PKG_HASH }}_{{ build }}{{ simd_suffix }}"
script:
# GCC and GXX are defined by conda-build
- export C_COMPILER="${GCC}"
- export CXX_COMPILER="${GXX}"
- export CONDA_QULACS_USE_SIMD={{ use_simd }} # [cuda_compiler_version == "None"]
{% if use_simd == "False" %}
- export CONDA_QULACS_OPT_FLAGS="-mtune=sandybridge -march=sandybridge -mfpmath=both" # [cuda_compiler_version == "None"]
{% endif %}
- $PREFIX/bin/python setup.py install -vv # [cuda_compiler_version == "None"] # "PYTHON" is undefined at this point
- export CUDA_BIN_PATH=/usr/local/cuda/ # [cuda_compiler_version != "None"] # bad interaction between cmake and cuda on CF?
- $PREFIX/bin/python setup_gpu.py install -vv # [cuda_compiler_version != "None"] # "PYTHON" is undefined at this point
missing_dso_whitelist: # [cuda_compiler_version != "None"]
- '*/libcuda.*' # [cuda_compiler_version != "None"]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- {{ compiler("cuda") }} # [cuda_compiler_version != "None"]
- pybind11
- eigen 3.3.5
- cmake
host:
- python
- setuptools
run:
- python
- numpy
- qulacs-mutex 1.0 {{ arch }}
test:
imports:
- qulacs
requires: # [cuda_compiler_version == "None"]
- scipy # [cuda_compiler_version == "None"]
source_files: # [cuda_compiler_version == "None"]
- python/test/test_qulacs.py # [cuda_compiler_version == "None"]
files: # [cuda_compiler_version != "None"]
- test_gpu.py # [cuda_compiler_version != "None"]
commands:
- python python/test/test_qulacs.py # [cuda_compiler_version == "None"]
- nvidia-smi # [cuda_compiler_version != "None"]
- python test_gpu.py # [cuda_compiler_version != "None"]
{% else %}
{% endif %}
about:
home: https://github.com/qulacs/qulacs
license: MIT
license_family: MIT
license_file: LICENSE
summary: Qulacs is a Variational Quantum Circuit Simulator for Quantum Computation Research.
extra:
recipe-maintainers:
- leofang