Skip to content

Commit c5bc3e0

Browse files
author
Mathieu Taillefumier
committed
[cmake] More work
1 parent 7315eae commit c5bc3e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+274
-502
lines changed

.ci/uenv-recipes/tmlqcd/daint-gh200/repo/packages/lemonio/package.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#
33
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
44

5-
from spack_repo.builtin.build_systems.autotools import AutotoolsPackage
5+
from spack_repo.builtin.build_systems import cmake
6+
from spack_repo.builtin.build_systems.cmake import CMakePackage, generator
67

78

89
from spack.package import *
910

10-
class Lemonio(AutotoolsPackage):
11+
class Lemonio(AutotoolsPackage, CMakePackage):
1112
"""LEMON: Lightweight Parallel I/O library for Lattice QCD."""
1213

1314
homepage = "https://github.com/etmc/lemon"
@@ -16,13 +17,18 @@ class Lemonio(AutotoolsPackage):
1617

1718
version('master', branch='master')
1819

19-
depends_on("autoconf", type="build", when="@master build_system=autotools")
20-
depends_on("automake", type="build", when="@master build_system=autotools")
21-
depends_on("libtool", type="build", when="@master build_system=autotools")
20+
depends_on("libtool", type="build", when="@master build_system=cmake")
21+
depends_on("cmake", type="build", when="master build_system=cmake")
2222

2323
depends_on('mpi')
2424

25-
def configure_args(self):
26-
args = []
27-
args.append('CC={0}'.format(self.spec['mpi'].mpicc))
25+
generator("ninja")
26+
27+
class CMakeBuilder(cmake.CMakeBuilder):
28+
def cmake_args(self):
29+
spec = self.spec
30+
args = [
31+
self.define_from_variant("DBUILD_SHARED_LIBS" "shared"),
32+
]
2833
return args
34+

.github/workflows/basic-build.yaml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
repository: usqcd-software/c-lime
3636
path: lime
3737

38-
- name: autogen_lime
38+
- name: create_builddir_lime
3939
working-directory: ${{github.workspace}}/lime
40-
run: ./autogen.sh && mkdir build
40+
run: mkdir build
4141

4242
- name: build_lime
4343
working-directory: ${{github.workspace}}/lime/build
4444
run: |
4545
CC=gcc \
4646
CFLAGS="-march=haswell -mtune=haswell -O2" \
47-
../configure --prefix=$(pwd)/install_dir
47+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir .. >> config.log
4848
make -j
4949
make install
5050
@@ -61,20 +61,19 @@ jobs:
6161
repository: etmc/lemon
6262
path: lemon
6363

64-
- name: autogen_lemon
64+
- name: create_builddir_lemon
6565
working-directory: ${{github.workspace}}/lemon
6666
run: |
67-
autoreconf -i -f
6867
mkdir build
6968
7069
- name: build_lemon
7170
working-directory: ${{github.workspace}}/lemon/build
7271
run: |
7372
CC=mpicc \
7473
CFLAGS="-march=haswell -mtune=haswell -O2" \
75-
../configure --prefix=$(pwd)/install_dir
74+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir ..
7675
make -j
77-
make install
76+
make install > config.log
7877
7978
- name: Archive lemon config.log
8079
if: ${{ always() }}
@@ -92,28 +91,19 @@ jobs:
9291
shell: bash
9392
run: mkdir ${{github.workspace}}/main/build
9493

95-
- name: autogen_tmlqcd
96-
working-directory: ${{github.workspace}}/main
97-
run: autoconf
98-
9994
- name: configure_and_build
10095
shell: bash
10196
working-directory: ${{github.workspace}}/main/build
10297
run: |
103-
CC=mpicc CXX=mpicxx \
104-
LDFLAGS="-fopenmp" \
10598
CFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
10699
CXXFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
107-
../configure \
108-
--enable-mpi \
109-
--with-mpidimension=4 \
110-
--enable-omp \
111-
--disable-sse2 \
112-
--disable-sse3 \
113-
--with-limedir=${{github.workspace}}/lime/build/install_dir \
114-
--with-lemondir=${{github.workspace}}/lemon/build/install_dir \
115-
--with-lapack="-lblas -llapack" || cat config.log
116-
make -j
100+
cmake -DCMAKE_PREFIX_PATH="${{github.workspace}}/lime/build/install_dir;${{github.workspace}}/lemon/build/install_dir" \
101+
-DTM_USE_MPI=ON \
102+
-DTM_USE_OMP=ON \
103+
-DTM_USE_LEMON=ON \
104+
.. > config.log
105+
cat config.log
106+
make -j
117107
118108
- name: Archive tmLQCD config.log
119109
if: ${{ always() }}
@@ -125,7 +115,7 @@ jobs:
125115
- name: nf2_rgmixedcg_hmc_tmcloverdetratio
126116
working-directory: ${{github.workspace}}/main/build
127117
run: |
128-
mpirun -np 2 ./hmc_tm \
118+
mpirun -np 2 src/bin/hmc_tm \
129119
-f ../doc/sample-input/sample-hmc-rgmixedcg-tmcloverdetratio.input
130120
131121
- name: Archive nf2_rgmixedcg_hmc_tmcloverdetratio output

.github/workflows/ddalphaamg-build.yaml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,16 @@ jobs:
4040
repository: usqcd-software/c-lime
4141
path: lime
4242

43-
- name: autogen_lime
43+
- name: create_builddir_lime
4444
working-directory: ${{github.workspace}}/lime
45-
run: ./autogen.sh
46-
47-
- name: create_lime_builddir
48-
run: mkdir ${{github.workspace}}/lime/build
45+
run: mkdir build
4946

5047
- name: build_lime
5148
working-directory: ${{github.workspace}}/lime/build
5249
run: |
5350
CC=gcc \
5451
CFLAGS="-march=haswell -mtune=haswell -O2" \
55-
../configure --prefix=$(pwd)/install_dir
52+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir .. >> config.log
5653
make -j
5754
make install
5855
@@ -69,23 +66,20 @@ jobs:
6966
repository: etmc/lemon
7067
path: lemon
7168

72-
- name: create_lemon_builddir
73-
run: mkdir ${{github.workspace}}/lemon/build
74-
75-
- name: autogen_lemon
69+
- name: create_builddir_lemon
7670
working-directory: ${{github.workspace}}/lemon
77-
run: autoreconf -i -f
71+
run: |
72+
mkdir build
7873
7974
- name: build_lemon
8075
working-directory: ${{github.workspace}}/lemon/build
8176
run: |
8277
CC=mpicc \
8378
CFLAGS="-march=haswell -mtune=haswell -O2" \
84-
../configure \
85-
--prefix=$(pwd)/install_dir
79+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir ..
8680
make -j
87-
make install
88-
81+
make install > config.log
82+
8983
- name: Archive lemon config.log
9084
if: ${{ always() }}
9185
uses: actions/upload-artifact@v4
@@ -111,10 +105,6 @@ jobs:
111105
shell: bash
112106
run: mkdir ${{github.workspace}}/main/build
113107

114-
- name: autogen_tmlqcd
115-
working-directory: ${{github.workspace}}/main
116-
run: autoconf
117-
118108
- name: configure_and_build
119109
shell: bash
120110
working-directory: ${{github.workspace}}/main/build
@@ -123,22 +113,19 @@ jobs:
123113
LDFLAGS="-fopenmp" \
124114
CFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
125115
CXXFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
126-
../configure \
127-
--enable-mpi \
128-
--with-mpidimension=4 \
129-
--enable-omp \
130-
--disable-sse2 \
131-
--disable-sse3 \
132-
--with-limedir=${{github.workspace}}/lime/build/install_dir \
133-
--with-lemondir=${{github.workspace}}/lemon/build/install_dir \
134-
--with-DDalphaAMG=${{github.workspace}}/ddalphaamg \
135-
--with-lapack="-lblas -llapack" || cat config.log
116+
cmake -DCMAKE_PREFIX_PATH="${{github.workspace}}/lime/build/install_dir;${{github.workspace}}/lemon/build/install_dir;${{github.workspace}}/ddalphaamg" \
117+
-DTM_USE_MPI=ON \
118+
-DTM_USE_OMP=ON \
119+
-DTM_USE_LEMON=ON \
120+
-DTM_USE_DDalphaAMG=ON \
121+
.. > config.log
122+
cat config.log
136123
make -j
137124
138125
- name: nf2_ddalphaamg_hmc_tmcloverdetratio
139126
working-directory: ${{github.workspace}}/main/build
140127
run: |
141-
mpirun -np 2 ./hmc_tm \
128+
mpirun -np 2 src/bin/hmc_tm \
142129
-f ../doc/sample-input/sample-hmc-ddalphaamg-tmcloverdetratio.input
143130
144131
- name: Archive nf2_ddalphaamg_hmc_tmcloverdetratio output

.github/workflows/qphix-build.yaml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
repository: usqcd-software/c-lime
3636
path: lime
3737

38-
- name: autogen_lime
38+
- name: create_builddir_lime
3939
working-directory: ${{github.workspace}}/lime
40-
run: ./autogen.sh && mkdir build
40+
run: mkdir build
4141

4242
- name: build_lime
4343
working-directory: ${{github.workspace}}/lime/build
4444
run: |
4545
CC=gcc \
4646
CFLAGS="-march=haswell -mtune=haswell -O2" \
47-
../configure --prefix=$(pwd)/install_dir
47+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir .. >> config.log
4848
make -j
4949
make install
5050
@@ -61,30 +61,27 @@ jobs:
6161
repository: etmc/lemon
6262
path: lemon
6363

64-
- name: autogen_lemon
64+
- name: create_builddir_lemon
6565
working-directory: ${{github.workspace}}/lemon
6666
run: |
67-
autoreconf -i -f
6867
mkdir build
6968
7069
- name: build_lemon
7170
working-directory: ${{github.workspace}}/lemon/build
7271
run: |
7372
CC=mpicc \
7473
CFLAGS="-march=haswell -mtune=haswell -O2" \
75-
../configure \
76-
--prefix=$(pwd)/install_dir
74+
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir ..
7775
make -j
78-
make install
79-
76+
make install > config.log
77+
8078
- name: Archive lemon config.log
8179
if: ${{ always() }}
8280
uses: actions/upload-artifact@v4
8381
with:
8482
name: lemon_config_output
8583
path: ${{github.workspace}}/lemon/build/config.log
8684

87-
8885
- name: get_qmp
8986
uses: actions/checkout@v4
9087
with:
@@ -151,9 +148,10 @@ jobs:
151148
-DCMAKE_C_COMPILER=mpicc \
152149
-DCMAKE_C_FLAGS="-std=c99 -O2 -mavx2 -mfma -mtune=haswell -march=haswell -fopenmp" \
153150
-DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir \
154-
..
151+
.. >> config.log
155152
VERBOSE=1 make -j $(( ${nb_cores} + 3 ))
156-
make install
153+
make install > config.log
154+
cat config.log
157155
158156
- name: get_tmlqcd
159157
uses: actions/checkout@v4
@@ -164,10 +162,6 @@ jobs:
164162
shell: bash
165163
run: mkdir ${{github.workspace}}/main/build
166164

167-
- name: autogen_tmlqcd
168-
working-directory: ${{github.workspace}}/main
169-
run: autoconf
170-
171165
- name: configure_and_build
172166
shell: bash
173167
working-directory: ${{github.workspace}}/main/build
@@ -176,19 +170,13 @@ jobs:
176170
LDFLAGS="-fopenmp" \
177171
CFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
178172
CXXFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
179-
../configure \
180-
--enable-mpi \
181-
--with-mpidimension=4 \
182-
--enable-omp \
183-
--disable-sse2 \
184-
--disable-sse3 \
185-
--with-limedir=${{github.workspace}}/lime/build/install_dir \
186-
--with-lemondir=${{github.workspace}}/lemon/build/install_dir \
187-
--with-lapack="-lblas -llapack" \
188-
--with-qmpdir=${{github.workspace}}/qmp/build/install_dir \
189-
--with-qphixdir=${{github.workspace}}/qphix/build/install_dir \
190-
--enable-qphix-soalen=4 || cat config.log
191-
make -j
173+
cmake -DCMAKE_PREFIX_PATH="${{github.workspace}}/lime/build/install_dir;${{github.workspace}}/lemon/build/install_dir;${{github.workspace}}/qphix/build" \
174+
-DTM_USE_MPI=ON \
175+
-DTM_USE_OMP=ON \
176+
-DTM_USE_LEMON=ON \
177+
-DTM_USE_QPHIX=ON \
178+
.. >> config.log
179+
make -j > config.log
192180
193181
- name: Archive tmLQCD config.log
194182
if: ${{ always() }}
@@ -200,7 +188,7 @@ jobs:
200188
- name: nf2_qphix_hmc_tmcloverdetratio
201189
working-directory: ${{github.workspace}}/main/build
202190
run: |
203-
mpirun -np 2 ./hmc_tm \
191+
mpirun -np 2 src/bin/hmc_tm \
204192
-f ../doc/sample-input/sample-hmc-qphix-tmcloverdetratio.input
205193
206194
- name: Archive nf2_qphix_hmc_tmcloverdetratio output

0 commit comments

Comments
 (0)