Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ninja when available to build CMake targets #578

Merged
merged 4 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 2 additions & 6 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-07-20
key: Linux-x86_64-containers-build-2023-09-05

- name: Checkout OpenMM (for Lepton library)
uses: actions/checkout@v3
Expand Down Expand Up @@ -137,15 +137,11 @@ jobs:
apptainer pull CentOS7-devel.sif library://giacomofiorin/default/colvars_development:centos7
apptainer pull CentOS9-devel.sif library://giacomofiorin/default/colvars_development:centos9

- name : Get spiff
shell: bash
working-directory: devel-tools
run: sudo cp -f $(apptainer exec ${{ inputs.container_name }}.sif ./get_spiff) /usr/local/bin

- name: Update and build ${{ inputs.backend_name }}
shell: bash
env:
OPENMM_SOURCE: ${{ github.workspace }}/openmm-source
CMAKE_GENERATOR: Ninja
run: |
apptainer exec devel-tools/${{ inputs.container_name }}.sif ./update-colvars-code.sh -f ${{ inputs.backend_name }}-source
CCACHE_DIR=~/ccache_${{ inputs.container_name }} \
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
CCACHE: ccache
CMAKE_GENERATOR: Ninja

steps:
- uses: actions/checkout@v3
Expand All @@ -182,7 +183,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-07-20
key: Linux-x86_64-containers-build-2023-09-05

- name: Get small downloadable packages
uses: actions/checkout@v3
Expand Down Expand Up @@ -387,7 +388,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-07-20
key: Linux-x86_64-containers-build-2023-09-05

- name: Checkout Sun compiler (Oracle Developer Studio)
uses: actions/checkout@v3
Expand Down
20 changes: 14 additions & 6 deletions devel-tools/containers/CentOS7-devel.def
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ From: centos:7
ncurses which bc man-db vim emacs screen tmux \
gcc gcc-c++ gcc-gfortran glibc-static libstdc++-static clang cppcheck \
autoconf automake cvs git git-cvs cvsps subversion mercurial \
rh-git227 devtoolset-{7..11} llvm-toolset-7 cmake3 ccache ninja \
rh-git227 devtoolset-{7..11} llvm-toolset-7 cmake3 ccache ninja-build \
doxygen \
openmpi-devel fftw-devel tcl-devel \
python-{devel,virtualenv} numpy scipy tkinter \
Expand All @@ -34,11 +34,14 @@ From: centos:7

# Build Charm++
umask 022
git clone --single-branch --depth=1 -b v7.0.0 https://github.com/UIUC-PPL/charm.git /opt/charm && \
cd /opt/charm && \
./build charm++ mpi-linux-x86_64 -j\$(nproc) --with-production && \
./build charm++ multicore-linux-x86_64 -j\$(nproc) --with-production && \
./build charm++ netlrts-linux-x86_64 -j\$(nproc) --with-production
source /etc/profile
module load mpi
git clone --single-branch --depth=1 -b v7.0.0 https://github.com/UIUC-PPL/charm.git /opt/charm
cd /opt/charm
export CCACHE_DIR=/tmp
./build charm++ mpi-linux-x86_64 -j16 --with-production && \
./build charm++ multicore-linux-x86_64 -j16 --with-production && \
./build charm++ netlrts-linux-x86_64 -j16 --with-production

# Load Git 2.27
cat > /etc/profile.d/git.sh <<EOF
Expand All @@ -47,3 +50,8 @@ if [ \$(id -u) != 0 ] && [ -d /opt/rh/rh-git227 ] ; then
fi
EOF

# Build and install spiff
rm -fr /tmp/spiff
git clone https://github.com/jhenin/spiff /tmp/spiff && \
make -C /tmp/spiff && \
install /tmp/spiff/spiff /usr/local/bin/
16 changes: 12 additions & 4 deletions devel-tools/containers/CentOS9-devel.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ From: quay.io/centos/centos:stream9
gcc gcc-c++ gcc-gfortran cppcheck \
gcc-toolset-{12,13} \
autoconf automake cvs git subversion mercurial \
cmake ccache \
cmake ccache ninja-build \
openmpi-devel tbb-devel fftw-devel tcl-devel \
python3-{devel,tkinter,virtualenv,numpy,scipy} \
ncurses-devel \
Expand All @@ -40,9 +40,17 @@ From: quay.io/centos/centos:stream9

# Build Charm++
umask 022
source /etc/profile
module load mpi
git clone --single-branch --depth=1 -b v7.0.0 https://github.com/UIUC-PPL/charm.git /opt/charm
cd /opt/charm
export CCACHE_DIR=/tmp
./build charm++ mpi-linux-x86_64 -j\$(nproc) --with-production
./build charm++ netlrts-linux-x86_64 -j\$(nproc) --with-production
./build charm++ multicore-linux-x86_64 -j\$(nproc) --with-production
./build charm++ mpi-linux-x86_64 -j16 --with-production && \
./build charm++ multicore-linux-x86_64 -j16 --with-production && \
./build charm++ netlrts-linux-x86_64 -j16 --with-production

# Build and install spiff
rm -fr /tmp/spiff
git clone https://github.com/jhenin/spiff /tmp/spiff && \
make -C /tmp/spiff && \
install /tmp/spiff/spiff /usr/local/bin/