bartjuw is building libantimonyjs #39
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: build-libantimoyjs-github-actions | |
run-name: ${{ github.actor }} is building libantimonyjs | |
on: [push] | |
jobs: | |
build-new-version-antimonyjs: | |
runs-on: ubuntu-latest | |
env: | |
EMSDK: emsdk | |
EMSDK_NODE: emsdk/node/16.20.0_64bit/bin/node | |
SBML_VERS: "5.20.0" | |
ANT_VERS: "2.13.4" | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ls | |
- name: get emscripten | |
run: git clone https://github.com/emscripten-core/emsdk.git | |
- name: change emsdk script permissions | |
run: chmod +x emsdk | |
working-directory: emsdk | |
- name: install emscripten sdk | |
run: ./emsdk install 3.1.20 | |
working-directory: emsdk | |
- name: activate emscripten | |
run: ./emsdk activate 3.1.20 | |
working-directory: emsdk | |
- run: echo "$GITHUB_WORKSPACE/emsdk/upstream/emscripten" >> $GITHUB_PATH | |
- run: echo "$GITHUB_WORKSPACE/emsdk" >> $GITHUB_PATH | |
- run: echo $GITHUB_PATH | |
- name: confirm emscripten works | |
run: emcc -v | |
- run: echo $PATH | |
- run: echo $EMSDK | |
- run: echo $EMSDK_NODE | |
- run: echo $LIBANTIMONY_JS | |
- run: mkdir install | |
- run: wget https://github.com/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.bz2 | |
- run: tar -xf expat-2.2.10.tar.bz2 | |
- run: mv expat-2.2.10 expat | |
- name: make expat build dir | |
run: mkdir build | |
working-directory: expat | |
- name: build expat lib | |
run: emcmake cmake .. -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install/expat | |
working-directory: expat/build | |
- name: Compile expat lib | |
run: emmake make | |
working-directory: expat/build | |
- name: install expat lib | |
run: emmake make install | |
working-directory: expat/build | |
- name: Get libSBML | |
run: wget https://github.com/sbmlteam/libsbml/archive/refs/tags/v$SBML_VERS.zip | |
- run: unzip v$SBML_VERS.zip | |
- run: mv libsbml-$SBML_VERS libsbml | |
- name: make libsbml build dir | |
run: mkdir build | |
working-directory: libsbml | |
- name: build libsbml library | |
run: emcmake cmake .. -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install/sbml -DCMAKE_BUILD_TYPE=Release -DWITH_CPP_NAMESPACE=ON -DWITH_EXPAT=ON -DWITH_LIBXML=OFF -DLIBSBML_SKIP_SHARED_LIBRARY=ON -DENABLE_ARRAYS=ON -DENABLE_COMP=ON -DENABLE_DISTRIB=ON -DENABLE_FBC=ON -DENABLE_GROUPS=ON -DENABLE_MULTI=ON -DENABLE_QUAL=ON -DWITH_STABLE_PACKAGES=ON -DWITH_SWIG=OFF -DEXPAT_INCLUDE_DIR=$GITHUB_WORKSPACE/install/expat/include -DEXPAT_LIBRARY=$GITHUB_WORKSPACE/install/expat/lib/libexpat.a | |
working-directory: libsbml/build | |
- name: compile libsbml lib | |
run: emmake make | |
working-directory: libsbml/build | |
- name: install libsbml | |
run: emmake make install | |
working-directory: libsbml/build | |
- name: Get antimony | |
run: wget https://github.com/sys-bio/antimony/archive/refs/tags/v$ANT_VERS.zip | |
- run: unzip v$ANT_VERS.zip | |
- run: mv antimony-$ANT_VERS/ antimony | |
- name: make antimony build dir | |
run: mkdir build | |
working-directory: antimony | |
- name: Build antimony library | |
run: emcmake cmake .. -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install/antimony -DEXPAT_LIBRARY=$GITHUB_WORKSPACE/install/expat/lib/libexpat.a -DLIBSBML_INCLUDE_DIR=$GITHUB_WORKSPACE/install/sbml/include -DLIBSBML_INSTALL_DIR=$GITHUB_WORKSPACE/install/sbml -DLIBSBML_LIBRARY=$GITHUB_WORKSPACE/install/sbml/lib/libsbml-static.a -DWITH_CELLML=OFF -DWITH_CHECK=OFF -DWITH_COMP_SBML=ON -DWITH_LIBSBML_COMPRESSION=OFF -DWITH_LIBSBML_EXPAT=ON -DWITH_LIBSBML_LIBXML=OFF -DWITH_LIBSBML_XERCES=OFF -DWITH_PYTHON=OFF -DWITH_QTANTIMONY=OFF -DWITH_SBML=ON -DWITH_STATIC_SBML=ON -DWITH_SWIG=OFF | |
working-directory: antimony/build | |
- name: Compile antimony lib | |
run: emmake make | |
working-directory: antimony/build | |
- name: Install antimony lib | |
run: emmake make install | |
working-directory: antimony/build | |
- name: Generate antimony javascript and wasm files | |
run: emcc -Oz -sDISABLE_EXCEPTION_CATCHING=0 -sMODULARIZE=1 -sEXPORT_NAME=libantimony -sALLOW_MEMORY_GROWTH=1 -I$GITHUB_WORKSPACE/install/antimony/include -I$GITHUB_WORKSPACE/install/sbml/include -I$GITHUB_WORKSPACE/install/expat/include $GITHUB_WORKSPACE/install/antimony/lib/libantimony.a $GITHUB_WORKSPACE/install/sbml/lib/libsbml-static.a $GITHUB_WORKSPACE/install/expat/lib/libexpat.a -o libantimony.js -sEXPORTED_FUNCTIONS=_loadString,_loadAntimonyString,_loadSBMLString,_clearPreviousLoads,_getAntimonyString,_getSBMLString,_getCompSBMLString,_getLastError,_getWarnings,_getSBMLInfoMessages,_getSBMLWarnings,_freeAll,_malloc,_free -sEXPORTED_RUNTIME_METHODS=ccall,cwrap,allocateUTF8,UTF8ToString | |
working-directory: install | |
- name: List build libantimonyjs files | |
run: ls | |
working-directory: install | |