Skip to content

Commit 8e0cf77

Browse files
Remove the makefile (2decomp-fft#155)
* The grand purging of Makefiles * Remove Makefile from README * Move Build test to CMake * Replace tabs in github action * Build library/examples separately on github * Begin porting full CI suite to cmake * Update CI steps using cmake to reflect README instructions * Restore clean build when CI builds IFORT/MKL * Add instructions for building decomp2d from external project * Ignore Vim swp files * Use full build for GNU checks with verbose output * Add Dev flags for Nvidia compilers * Build with nvidia * Update Intel cmake build * Add support to build F2003 FFTW3 with CMake * Test build FFTW with cmake * Build test caliper using cmake * Update building FFTW3 instructions * Add caliper build instructions for Cmake
1 parent ec908b7 commit 8e0cf77

File tree

16 files changed

+112
-646
lines changed

16 files changed

+112
-646
lines changed

.github/workflows/Build.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ jobs:
2424
- name: Install requirements
2525
run: |
2626
sudo apt-get update
27-
sudo apt-get install -y gfortran openmpi-bin libopenmpi-dev
27+
sudo apt-get install -y gfortran openmpi-bin libopenmpi-dev cmake
2828
2929
# Runs a set of commands using the runners shell
3030
- name: Compile
31-
run: make BUILD=dev
31+
run: |
32+
export FC=mpif90
33+
cmake -S . -B build -DCMAKE_BUILD_TYPE=dev
34+
cmake --build build --target decomp2d
3235
3336
- name: Examples
34-
run: make examples
37+
run: |
38+
export FC=mpif90
39+
cmake -S . -B build -DCMAKE_BUILD_TYPE=dev
40+
cmake --build build

.github/workflows/Build_all.yml

+34-17
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ jobs:
2424
- name: Install requirements
2525
run: |
2626
sudo apt-get update
27-
sudo apt-get install -y gfortran openmpi-bin libopenmpi-dev
27+
sudo apt-get install -y gfortran openmpi-bin libopenmpi-dev cmake
2828
2929
# Runs a set of commands using the runners shell
3030
- name: Compile
31-
run: make BUILD=dev && make examples
31+
run: |
32+
export FC=mpif90
33+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev
34+
cmake --build build --verbose
3235
3336
bld_gnu_mpich:
3437
# The type of runner that the job will run on
@@ -43,11 +46,14 @@ jobs:
4346
- name: Install requirements
4447
run: |
4548
sudo apt-get update
46-
sudo apt-get install -y gfortran mpich libmpich-dev
49+
sudo apt-get install -y gfortran mpich libmpich-dev cmake
4750
4851
# Runs a set of commands using the runners shell
4952
- name: Compile
50-
run: make BUILD=debug && make examples
53+
run: |
54+
export FC=mpif90
55+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev
56+
cmake --build build --verbose
5157
5258
bld_nvidia:
5359
# The type of runner that the job will run on
@@ -74,8 +80,8 @@ jobs:
7480
# Runs a set of commands using the runners shell
7581
- name: CPU version
7682
run: |
77-
PATH=$TMP:$PATH make CMP=nvhpc BUILD=debug
78-
PATH=$TMP:$PATH make examples
83+
PATH=$TMP:$PATH FC=mpif90 cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev
84+
PATH=$TMP:$PATH cmake --build build --verbose
7985
8086
### - name: GPU version
8187
### run: |
@@ -99,15 +105,25 @@ jobs:
99105
- name: install
100106
run: |
101107
sudo apt-get update
102-
sudo apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-fortran intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-mpi intel-oneapi-mpi-devel
108+
sudo apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-fortran intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-mpi intel-oneapi-mpi-devel cmake
103109
104110
# Runs a set of commands using the runners shell
105111
- name: Compile
106-
run: source /opt/intel/oneapi/setvars.sh && make CMP=intel BUILD=debug && make examples
112+
run: |
113+
source /opt/intel/oneapi/setvars.sh
114+
export FC=mpiifort
115+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev
116+
cmake --build build
107117
108118
# Runs a set of commands using the runners shell
109119
- name: Compile
110-
run: source /opt/intel/oneapi/setvars.sh && make clean && make CMP=intel FFT=mkl BUILD=debug && make examples
120+
run: |
121+
source /opt/intel/oneapi/setvars.sh
122+
export FC=mpiifort
123+
export MKL_DIR=${MKLROOT}/lib/cmake/mkl
124+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev -DFFT_Choice=mkl
125+
cmake --build build --target clean
126+
cmake --build build
111127
112128
bld_fftw3:
113129
# The type of runner that the job will run on
@@ -127,15 +143,15 @@ jobs:
127143
# Runs a set of commands using the runners shell
128144
- name: Regular FFTW3
129145
run: |
130-
make clean
131-
make BUILD=dev FFT=fftw3 FFTW3_PATH_INCLUDE=/usr/include FFTW3_PATH_LIB=/usr/lib/x86_64-linux-gnu
132-
make examples
146+
export FC=mpif90
147+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFFT_Choice=fftw
148+
cmake --build build --verbose
133149
134150
- name: New FFTW3
135151
run: |
136-
make clean
137-
make BUILD=dev FFT=fftw3_f03 FFTW3_PATH_INCLUDE=/usr/include FFTW3_PATH_LIB=/usr/lib/x86_64-linux-gnu
138-
make examples
152+
export FC=mpif90
153+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Dev -DFFT_Choice=fftw_f03
154+
cmake --build build --verbose
139155
140156
bld_caliper:
141157
# The type of runner that the job will run on
@@ -164,5 +180,6 @@ jobs:
164180
165181
- name: Compile
166182
run: |
167-
make clean
168-
make BUILD=dev PROFILER=caliper CALIPER_PATH=./Caliper-2.8.0_bld
183+
export caliper_DIR=./Caliper-2.8.0_bld/share/cmake/caliper
184+
FC=mpif90 cmake -S . -B build -DENABLE_PROFILER=caliper
185+
cmake --build build --verbose

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ Makefile.settings
4646
# emacs
4747
.dir-locals.el
4848
TAGS
49+
50+
# vim
51+
*.swp

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if (BUILD_TARGET MATCHES "gpu")
7070
else ()
7171
set(FFT_Choice "generic" CACHE STRING "FFT for XCompact3d project (generic is the default)")
7272
endif (BUILD_TARGET MATCHES "gpu")
73-
set_property(CACHE FFT_Choice PROPERTY STRINGS generic fftw mkl cufft)
73+
set_property(CACHE FFT_Choice PROPERTY STRINGS generic fftw fftw_f03 mkl cufft)
7474
include(fft)
7575

7676
# Create a static library for the fft

Makefile

-168
This file was deleted.

0 commit comments

Comments
 (0)