Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
cpp: Grab notebooks from symengine/symengine
  • Loading branch information
HaoZeke committed Mar 6, 2021
commit d03fe1cb2a5d7b64ce47127f752ec8d91f036628
24 changes: 16 additions & 8 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Build Documentation

on:
push:
branches: [ sources ]
pull_request:
branches: [ sources ]
schedule:
- cron: "0 0 * * */6"
on: [push, pull_request]

jobs:
build_docs:
Expand All @@ -19,6 +13,8 @@ jobs:
with:
submodules: "recursive" # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Get CPP Notebooks
run: scripts/genMyst.sh
- name: Cache conda
uses: actions/cache@v1
env:
Expand All @@ -42,7 +38,19 @@ jobs:
environment-file: symedocs.yml
python-version: 3.9
auto-activate-base: false
- name: Build
- name: Build SymEngine CPP core
run: |
git clone https://github.com/symengine/symengine symengine-cpp
cd symengine-cpp
mkdir build
cd build
export LDFLAGS="-Wl,-rpath,${NB_PYTHON_PREFIX}/lib -L${NB_PYTHON_PREFIX}/lib"
cmake -DWITH_COTIRE=no -DBUILD_SHARED_LIBS=yes -DWITH_MPC=yes -DWITH_ARB=yes -DINTEGER_CLASS=flint -DWITH_LLVM=yes -DCMAKE_PREFIX_PATH=${NB_PYTHON_PREFIX} -DCMAKE_INSTALL_PREFIX=${NB_PYTHON_PREFIX} -DBUILD_TESTS=off -DBUILD_BENCHMARKS=off -DCMAKE_INSTALL_LIBDIR=lib ..
make -j4
sudo make install
cd ..
rm -rf build
- name: Build Docs
run: sphinx-build docs ./public
- name: Deploy Docs
if: ${{ github.ref == 'refs/heads/sources' && github.repository == 'Symengine/symengine.github.io' }}
Expand Down
30 changes: 30 additions & 0 deletions scripts/genMyst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
#####################################################
# Grab the notebooks in .myst.md form
#
# Author: Rohit Goswami
# Licence: MIT
#####################################################

groot=$(git rev-parse --show-toplevel)

# CPP
cppdir="$groot/docs/use/api/cpp"
if [ -d "$cppdir" ]; then
echo "Folder exists!!! Y to overwrite"
read delfol
if [ $delfol == "Y" ]; then
rm -rf $cppdir
else
echo "Exiting"
exit 1
fi
fi
echo "Getting files"
"$groot/scripts/gitfolder.sh" "https://github.com/symengine/symengine/tree/master/docs/mystMD"
echo "Moving to the API directory"
mv mystMD $cppdir
rm -rf $cppdir/readme.org
echo "Done CPP"

echo "Remember to commit changes to symengine/symengine!!!"
26 changes: 26 additions & 0 deletions scripts/gitfolder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#####################################################
# Download Specific folders from Github using SVN
#
# Author: Declan Cook
# Licence: MIT
#####################################################
GHDOMAIN="https://github.com/"
IN=$1
IN=${IN##$GHDOMAIN}
BRANCH="trunk"
FOLDER=""
IFS="/" read -a SECT <<< "$IN"

if [[ "${SECT[3]}" != "master" ]]; then
BRANCH=${SECT[3]}
fi
for index in "${!SECT[@]}"; do
if [ $index -gt 3 ]; then
FOLDER=$FOLDER/${SECT[index]}
fi
done

# DOMAIN/USER/PROJECT/<TRUNK||BRANCH>/FOLDER
echo Exporting $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER
svn export $GHDOMAIN${SECT[0]}/${SECT[1]}/$BRANCH$FOLDER