Skip to content

Commit

Permalink
[OCCA] Add OCCA as git submodule (#72)
Browse files Browse the repository at this point in the history
* [OCCA] Add OCCA as a git submodule

* [OCCA] Revert to slightly older OCCA for now

* [Make] Hook internal OCCA into build system

* Update README

* [CI] Update github CI workflow

* [CI] Need to tell github actions to checkout submodules
  • Loading branch information
noelchalmers authored Sep 7, 2021
1 parent 6f2382d commit d5a931a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 23 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,18 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt install -y libopenmpi-dev openmpi-bin libblas-dev liblapack-dev
git clone https://github.com/libocca/occa
cd occa
make -j `nproc`
cd ..
- name: Build
run: make -j `nproc` verbose=true
env:
OCCA_DIR: /home/runner/work/libparanumal/libparanumal/occa/
LD_LIBRARY_PATH: /home/runner/work/libparanumal/libparanumal/occa/lib
LIBP_COVERAGE: 1
- name: Test
run: |
echo ${LD_LIBRARY_PATH}
ls ${OCCA_DIR}/lib
make test LIBP_COVERAGE=1
make test
bash <(curl --no-buffer -s https://codecov.io/bash) -x gcov
env:
OCCA_DIR: /home/runner/work/libparanumal/libparanumal/occa/
LD_LIBRARY_PATH: /home/runner/work/libparanumal/libparanumal/occa/lib
LIBP_COVERAGE: 1
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "occa"]
path = occa
url = https://github.com/libocca/occa
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,9 @@ G. Dependencies:

---
### 5. OCCA dependency
`git clone https://github.com/libocca/occa`

#### 5-1. Build OCCA
`cd occa`
`export OCCA_DIR=${PWD}`
```make -j `nproc` ```
`cd ../ `
OCCA is held as a git submodule inside libParanumal. If you did not clone with `--recursive` then run the following command before building.
`git submodule init`
`git submodule update`

---
### 6. Required Libraries
Expand Down Expand Up @@ -127,7 +123,7 @@ Each solver resides in its respective sub-directory in `solvers/`. Each solver s
#### 8-1. Build libParanumal elliptic solver

`cd libparanumal/solvers/elliptic`
`make -j `
```make -j `nproc` ```

#### 8-2. Run elliptic example with provided quadrilateral set up file on a single device:

Expand Down
5 changes: 4 additions & 1 deletion libs/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,11 @@ silentUpdate-parAlmond:
silentUpdate-timeStepper:
@true

${OCCA_DIR}/lib/libocca.so:
${MAKE} -C ${OCCA_DIR}

# rule for .cpp files
core/%.o: core/%.cpp $(LIB_DEPS)
core/%.o: core/%.cpp $(LIB_DEPS) ${OCCA_DIR}/lib/libocca.so
ifneq (,${verbose})
$(LIBP_MPICXX) -o $@ -c $< ${LIBCORE_DEFINES} $(LIB_CXXFLAGS)
else
Expand Down
4 changes: 1 addition & 3 deletions make.top
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export LIBP_BLAS_LIB =-L${LIBP_BLAS_DIR} -lblas
export LIBP_LAPACK_LIB=-L${LIBP_LAPACK_DIR} -llapack

#include OCCA
ifndef OCCA_DIR
$(error environment variable [OCCA_DIR] is not set)
endif
export OCCA_DIR=${LIBP_DIR}/occa

#compilers to use for C/C++
export LIBP_MPICC = mpicc
Expand Down
1 change: 1 addition & 0 deletions occa
Submodule occa added at 327582

0 comments on commit d5a931a

Please sign in to comment.