Skip to content

Commit

Permalink
macOs build II
Browse files Browse the repository at this point in the history
  • Loading branch information
ibarrond committed Sep 15, 2023
1 parent 2311d79 commit ed32bf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/pytest-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,25 @@ jobs:
matrix:
python-version: ["3.9"]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
# brew install --with-toolchain llvm libomp ?
- name: (MAcOs only) Install GNU GCC
- name: (MacOs only) Install Clang
if: matrix.os == 'macos-latest'
run: |
brew install gcc libomp
- name: (MacOs only) Set gcc/gxx environment variables
if: matrix.os == 'macos-latest'
run: |
echo "gcc=/usr/local/bin/$(ls /usr/local/bin | grep ^gcc-[0-9] | sort -V -r | head -n 1)" >> $GITHUB_ENV
echo "gxx=/usr/local/bin/$(ls /usr/local/bin | grep ^g++-[0-9] | sort -V -r | head -n 1)" >> $GITHUB_ENV
brew install llvm libomp
# - name: (MacOs only) Set gcc/gxx environment variables
# if: matrix.os == 'macos-latest'
# run: |
# echo "gcc=/usr/local/bin/$(ls /usr/local/bin | grep ^gcc-[0-9] | sort -V -r | head -n 1)" >> $GITHUB_ENV
# echo "gxx=/usr/local/bin/$(ls /usr/local/bin | grep ^g++-[0-9] | sort -V -r | head -n 1)" >> $GITHUB_ENV
# echo "gcc = $env.gcc"
# echo "gxx = $env.gxx"a
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Pyfhel/test/test_PyCtxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def test_PyCtxt_rotate(self, HE):
assert np.round(HE.decrypt(c1)[0])==1
# flip
if c1._pyfhel.scheme == Scheme_t.bfv:
c1 |= 1
c1 |= 1
c1 ^= 1
c1 ^= 1
assert np.round(HE.decrypt(c1)[0])==1

def test_PyCtxt_io(self, HE):
Expand Down
4 changes: 2 additions & 2 deletions examples/Demo_2_Integer_BFV.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
# to each of the rows!
cRotL = ctxt1 << 2 # Calls HE.rotate(ctxt1, k=-2, in_new_ctxt=True)
# `ctxt1 <<= 2` for inplace operation
cFlip = ctxt1 | 1 # Calls HE.flip(ctxt1, k=1, in_new_ctxt=True)
cFlip = ctxt1 ^ 1 # Calls HE.flip(ctxt1, k=1, in_new_ctxt=True)
# `ctxt1 |= 1` for inplace operation
cCuAdd = (+ctxt1) # Calls HE.cumul_add(ctxt1, in_new_ctxt=True)
cCuAdd = (+ctxt1) # Calls HE.cumul_add(ctxt1, in_new_ctxt=True)
# There is no equivalent for in-place operator, use
# the above call with `in_new_ctxt=False` if required.

Expand Down

0 comments on commit ed32bf0

Please sign in to comment.