python bindings #664
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
name: MacOS | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-macos: | |
name: MacOS CPU-only | |
runs-on: macos-12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: brew install boost openblas openssl protobuf | |
- name: Configure CMake | |
run: | | |
export LDFLAGS="-L/usr/local/opt/openblas/lib" | |
export CPPFLAGS="-I/usr/local/opt/openblas/include" | |
mkdir -p build | |
cd build | |
cmake .. \ | |
-DCOMPILE_CPU=on \ | |
-DCOMPILE_CUDA=off \ | |
-DCOMPILE_EXAMPLES=on \ | |
-DCOMPILE_SERVER=off \ | |
-DCOMPILE_TESTS=on \ | |
-DUSE_FBGEMM=on \ | |
-DUSE_SENTENCEPIECE=on | |
- name: Compile | |
working-directory: build | |
run: make -j2 | |
- name: Run unit tests | |
working-directory: build | |
run: make test | |
- name: Print versions | |
working-directory: build | |
run: | | |
./marian --version | |
./marian-decoder --version | |
./marian-scorer --version | |
ls -hlv $(find . -maxdepth 1 -type f -perm +ugo+x \( -name "marian*" -o -name "spm*" \)) | |
cd .. | |
rm -rf build/ | |
- name: Install PyMarian | |
working-directory: src/python | |
run: | | |
python3 -m venv .venv && source .venv/bin/activate | |
python3 -m pip install -U setuptools wheel | |
python3 -m pip install pybind11 sentencepiece scikit-build | |
python3 setup.py install -j2 -- -G"Unix Makefiles" | |
cd ../../ | |
python3 -c "from pymarian import Translator" |