Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Gheorghiu <vsoftco@gmail.com>
  • Loading branch information
vsoftco committed May 1, 2024
1 parent 61b93cc commit 8f0bbff
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 75 deletions.
138 changes: 68 additions & 70 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,39 @@ jobs:
build:
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

# - name: Install vcpkg (Windows)
# if: runner.os == 'Windows'
# run: |
# git clone https://github.com/microsoft/vcpkg
# .\vcpkg\bootstrap-vcpkg.bat
# .\vcpkg\vcpkg install pkgconf:x64-windows
#
# - name: Install gmp
# shell: bash
# run: |
# if [ "$RUNNER_OS" == "Windows" ]; then
# ./vcpkg/vcpkg install gmp:x64-windows
# elif [ "$RUNNER_OS" == "Linux" ]; then
# sudo apt-get install -y libgmp-dev
# elif [ "$RUNNER_OS" == "macOS" ]; then
# brew install gmp
# else
# echo "$RUNNER_OS not supported"
# exit 1
# fi

# -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake \
- name: Install vcpkg (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install pkgconf:x64-windows
- name: Install gmp
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./vcpkg/vcpkg install gmp:x64-windows
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y libgmp-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install gmp
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Configure staq
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake \
-DINSTALL_SOURCES=ON
else
cmake -B build -DINSTALL_SOURCES=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
Expand All @@ -71,54 +70,53 @@ jobs:
sudo cmake --install build
fi
# - name: Configure standalone example
# run: |
# cmake -S examples/standalone -B examples/standalone/build
#
# - name: Build standalone example
# run: |
# cmake --build examples/standalone/build --target standalone
#
# - name: Run standalone example
# shell: bash
# run: |
# if [ "$RUNNER_OS" == "Windows" ]; then
# ./examples/standalone/build/${{env.BUILD_TYPE}}/standalone.exe --version
# else
# ./examples/standalone/build/standalone --version
# fi
#
# - name: Build unit tests
# shell: bash
# run: |
# if [ "$RUNNER_OS" == "macOS" ]; then
# # Required for libgmp headers
# export CPATH=$LIBRARY_PATH:/opt/homebrew/include
# export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
# fi
# cmake --build build/unit_tests --target unit_tests
#
# - name: Run unit tests
# run: ctest --test-dir build
- name: Configure standalone example
run: |
cmake -S examples/standalone -B examples/standalone/build
- name: Build standalone example
run: |
cmake --build examples/standalone/build --target standalone
- name: Run standalone example
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./examples/standalone/build/${{env.BUILD_TYPE}}/standalone.exe --version
else
./examples/standalone/build/standalone --version
fi
- name: Build unit tests
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
# Required for libgmp headers
export CPATH=$LIBRARY_PATH:/opt/homebrew/include
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
fi
cmake --build build/unit_tests --target unit_tests
- name: Run unit tests
run: ctest --test-dir build

- name: Uninstall
run: |
cmake --build build --target uninstall
dir 'C:/Program Files (x86)/staq/bin/'
dir 'C:/Program Files (x86)/staq/bin/staq_circ.exe'
# - name: Install pystaq
# shell: bash
# run: |
# if [ "$RUNNER_OS" == "macOS" ]; then
# # Required for libgmp headers
# export CPATH=$LIBRARY_PATH:/opt/homebrew/include
# export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
# fi
# python3 -m venv venv
# if [ "$RUNNER_OS" == "Windows" ]; then
# .\venv\Scripts\activate
# else
# . venv/bin/activate
# fi
# pip install .
- name: Install pystaq
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
# Required for libgmp headers
export CPATH=$LIBRARY_PATH:/opt/homebrew/include
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
fi
python3 -m venv venv
if [ "$RUNNER_OS" == "Windows" ]; then
.\venv\Scripts\activate
else
. venv/bin/activate
fi
pip install .
6 changes: 1 addition & 5 deletions cmake/staq_uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ foreach(file ${files})
message(STATUS "Uninstalling ${file}")
if(IS_SYMLINK "${file}" OR EXISTS "${file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E rm -f "${file}"
COMMAND @CMAKE_COMMAND@ -E rm -f "${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval)
message(STATUS "ENVDESTDIR: $ENV{DESTDIR}")
message(STATUS "file: ${file}")
message(STATUS "rm_out: ${rm_out}")
message(STATUS "rm_retval: ${rm_retval}")
if(${rm_retval})
message(FATAL_ERROR "Problem when removing ${file}")
endif()
Expand Down

0 comments on commit 8f0bbff

Please sign in to comment.