Skip to content

Commit

Permalink
trying clang compiler for MacOS Arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumgizmos committed Nov 20, 2023
1 parent f87ce77 commit e5172e9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
35 changes: 18 additions & 17 deletions docs/source/classical_coding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -32,6 +32,7 @@
"source": [
"import numpy as np\n",
"import ldpc.codes\n",
"import ldpc.code_util\n",
"n=5 #specifies the lenght of the repetition code\n",
"H=ldpc.codes.rep_code(n) #returns the repetition code parity check matrix\n",
"print(H)"
Expand All @@ -46,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -74,7 +75,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -103,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -130,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -157,14 +158,14 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Code distance estimate, d <= 3 (no. codewords sampled: 394837)\n"
"Code distance estimate, d <= 3 (no. codewords sampled: 390178)\n"
]
}
],
Expand All @@ -182,7 +183,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -209,7 +210,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -248,7 +249,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand All @@ -260,7 +261,7 @@
" [0, 0, 1, 1, 0, 0, 1]], dtype=uint8)"
]
},
"execution_count": 39,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -284,7 +285,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -295,7 +296,7 @@
" [0, 0, 0, 0]], dtype=uint8)"
]
},
"execution_count": 40,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -324,7 +325,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -333,7 +334,7 @@
"array([1, 0, 0, 0, 0, 1, 1])"
]
},
"execution_count": 41,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -354,7 +355,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand All @@ -363,7 +364,7 @@
"array([0, 0, 0])"
]
},
"execution_count": 42,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ def generate_cython_stub_file(pyx_filepath: str, output_filepath: str) -> None:
## BUILD


# if sys.platform == "darwin":
# os.environ["CC"] = "gcc-11"
# os.environ["CXX"] = "g++-11"

if sys.platform == "darwin":
os.environ["CC"] = "gcc-11"
os.environ["CXX"] = "g++-11"
os.environ["CC"] = "clang"
os.environ["CXX"] = "clang++"


if sys.platform == "win32":
compile_flags = ["/Ox", "/std:c++20"]
Expand Down

0 comments on commit e5172e9

Please sign in to comment.