FEniCS / FEniCS/dolfinx

Start a "How to contribute" guide in the docs

Open
#3,365 7 comments 0 reactions 1 assignee Claimed by @mscroggs View on GitHub
documentation
Dominant language
C++
Stars
1.2k
Forks
261
Avg merge
1d 15h
Merged PRs (30d)
65

Description

Currently the only developer resources are [C++ guidelines](https://docs.fenicsproject.org/dolfinx/v0.8.0/python/developer.html).

I recently wanted to test a PR and used this dockerfile to create a container within which I could run some tests.

```dockerfile
FROM ghcr.io/fenics/dolfinx/dolfinx:nightly

ARG CMAKE_NUM_PROCESSES=4
ARG DOLFINX_MODE=real
ARG DOLFINX_PRECISION=64
ARG DOLFINX_CMAKE_CXX_FLAGS="-march=native"
ARG BUILD_TYPE=Developer

ENV DOLFINX_DIR=/usr/local/dolfinx-${DOLFINX_MODE}${DOLFINX_PRECISION}
WORKDIR /src

RUN git clone --branch=dokken/improve-mixed-packing --single-branch https://github.com/fenics/dolfinx.git
RUN CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_NUM_PROCESSES} cmake -G Ninja -B build-dir-${DOLFINX_MODE}${DOLFINX_PRECISION} -DCMAKE_INSTALL_PREFIX=${DOLFINX_DIR} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="${DOLFINX_CMAKE_CXX_FLAGS}" -S ./dolfinx/cpp

RUN CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_NUM_PROCESSES} cmake --build build-dir-${DOLFINX_MODE}${DOLFINX_PRECISION}
RUN cmake --install build-dir-${DOLFINX_MODE}${DOLFINX_PRECISION}
RUN python3 -m pip -v install --check-build-dependencies --config-settings=build-dir="build-${DOLFINX_CMAKE_BUILD_TYPE}-${DOLFINX_MODE}-${DOLFINX_PRECISION}" --config-settings=install.strip=false --config-settings=cmake.build-type="${DOLFINX_CMAKE_BUILD_TYPE}" --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_NUM_PROCESSES} --no-build-isolation -e ./dolfinx/python/
```

We could adapt this Dockerfile to install any branch/commit to easily test PRs.

Would it be worth adding a section to Developer resources with this as an alternative to build everything locally?
What do people think?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.