Skip to content

Commit

Permalink
Try Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Dec 3, 2024
1 parent 6e40467 commit 911a6d4
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: |
./make.sh --xc-host='sbcl --dynamic-space-size 700MB --lose-on-corruption --disable-ldb --disable-debugger'
./make-shared-library.sh
echo "SBCL_SRC=${{ github.workspace }}/../sbcl" >> "$GITHUB_ENV"
echo "LIBSBCL_PATH=${{ github.workspace }}/../sbcl/src/runtime" >> "$GITHUB_ENV"
- name: install quicklisp
working-directory: ../sbcl
run: |
Expand All @@ -36,20 +38,42 @@ jobs:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
- name: install conda-build
run: |
source ~/.bash_profile
conda config --add channels conda-forge
conda install -y conda-build
- name: build and install conda package
env:
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime
DYLD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime
run: |
source ~/.bash_profile
conda build recipe --output-folder conda-bld
conda install -c ${{ github.workspace }}/conda-bld/ sbcl-librarian
- name: set environment variables
run: |
source ~/.bash_profile
echo "LIBRARY_PATH=$LIBSBCL_PATH:$CONDA_PREFIX/lib" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=$LIBSBCL_PATH:$CONDA_PREFIX/lib" >> "$GITHUB_ENV"
echo "C_INCLUDE_PATH=$CONDA_PREFIX/include" >> "$GITHUB_ENV"
- name: build and run example
working-directory: examples/libcalc
env:
SBCL_SRC: ${{ github.workspace }}/../sbcl
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:${{ github.workspace }}/examples/libcalc
LD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:/usr/local/lib
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
run: |
conda install --offline ${{ github.workspace }}/conda-bld/osx-64/
source ~/.bash_profile
$SBCL_SRC/run-sbcl.sh --load script.lisp --quit
gcc -Wall -fPIC -shared -o libcalc.so libcalc.c -lsbcl -I../../lib
gcc -Wall -o example example.c -lcalc -lsbcl -I../../lib
sudo mv libcalc.so /usr/local/lib
sudo cp libcalc.core /usr/local/lib
pushd libcalc
mkdir build
pushd build
cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
cmake --build .
cmake --install .
popd
popd
gcc -Wall -o example example.c -lcalc -lsbcl_librarian
echo "(+ 1 2)" | ./example | tr -d '\n' | grep "> 3> "
echo "(+ 1 2)" | python ./example.py | tr -d '\n' | grep "> 3> "
python ./exhaust_heap.py | grep "returned to Python with error code 2 after heap exhaustion"
python ./exhaust_heap.py | grep "returned to Python after heap exhaustion (attempt 1)"

0 comments on commit 911a6d4

Please sign in to comment.