Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with recent GHC #17

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5a1c700
Update .cabal file to work with recent Cabal and GHC versions
twesterhout Jan 5, 2023
5b7b485
First experiment with GitHub Actions
twesterhout Jan 5, 2023
af704c6
--depth=0 is invalid for git clone; increase to 1
twesterhout Jan 5, 2023
e170454
Install boost in CI
twesterhout Jan 5, 2023
e0293c4
ninja-build -> ninja on MacOS
twesterhout Jan 5, 2023
1c1ef2f
Fix extra-lib-dirs
twesterhout Jan 5, 2023
8fa17f4
Only link libstdc++ on Linux; test C++ code on Mac
twesterhout Jan 5, 2023
e878c5f
Link libc++ on OS X
twesterhout Jan 6, 2023
0d76293
Remove all tests except ascii art
twesterhout Jan 6, 2023
5a2fecf
Safer wrappers
twesterhout Jan 6, 2023
c11b3f5
Build shared instead of static libraries
twesterhout Jan 6, 2023
d990fd7
Set LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
twesterhout Jan 6, 2023
7a607de
Use CApiFFI for safety; Finish Num, Fractional, and Floating for Basic
twesterhout Jan 7, 2023
f8f50f0
Remove old files
twesterhout Jan 10, 2023
d64927e
Add more tests
twesterhout Jan 10, 2023
eb4120f
Proper conversions for Integer and Rational
twesterhout Apr 22, 2023
42e6d71
Update the flake to use packageOverrides to support multiple GHC vers…
twesterhout Jun 19, 2023
1253ca9
Restructure the flake; implement fromAST for SymengineFunction
twesterhout Jun 19, 2023
6fe50f9
constructBasicFrom can throw; flake update; export DenseMatrix
twesterhout Aug 17, 2023
2ddfe46
Implement subs
twesterhout Aug 17, 2023
b25a51d
Add BasicKey newtype that is usable as a key with containers from the…
twesterhout Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]

jobs:
build:
name: Building on ${{ matrix.os }} with ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cabal: latest
ghc: "8.10.7"
- os: macos-latest
cabal: latest
ghc: "8.10.7"
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal

- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build g++ libboost-all-dev
- name: Install system dependencies (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install cmake ninja boost

- uses: actions/cache@v3
name: Cache /opt/symengine
id: cache-symengine
with:
path: /opt/symengine
key: ${{ runner.os }}-symengine

- name: Build C++ code
if: steps.cache-symengine.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE
git clone --depth=1 https://github.com/symengine/symengine
cd symengine
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/opt/symengine \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DWITH_SYMENGINE_THREAD_SAFE=ON \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF \
-DINTEGER_CLASS=boostmp
cmake --build build
cmake --build build --target test
sudo cmake --build build --target install

- name: Build Haskell code
run: |
echo "package symengine" >> cabal.project.local
echo " extra-lib-dirs: /opt/symengine/lib" >> cabal.project.local
echo " extra-include-dirs: /opt/symengine/include" >> cabal.project.local
cabal build

- name: Test
run: |
export LD_LIBRARY_PATH=/opt/symengine/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/opt/symengine/lib:$DYLD_LIBRARY_PATH
cabal test --test-show-details=direct
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ tags
/*.iml
/src/highlight.js
/src/style.css
/_site/
/_site/.ghc.environment.*
result
result-1
280 changes: 0 additions & 280 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

5 changes: 5 additions & 0 deletions cabal.project.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ignore-project: False
write-ghc-environment-files: always
tests: True
test-options: "--color"
test-show-details: streaming
Loading