Skip to content

Commit d6b3216

Browse files
committed
fixed compilation issues on CPU-only mode
1 parent 5509406 commit d6b3216

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Common/src/linear_algebra/meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ common_src += files(['CSysSolve_b.cpp',
22
'CSysSolve.cpp',
33
'CSysVector.cpp',
44
'CSysMatrix.cpp',
5-
'CSysMatrixGPU.cu',
6-
'CSysVectorGPU.cu',
75
'CPastixWrapper.cpp',
86
'blas_structure.cpp'])
7+
8+
if get_option('enable-cuda')
9+
common_src += files(['CSysMatrixGPU.cu', 'CSysVectorGPU.cu',])
10+
endif

meson.build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
project('SU2', 'c', 'cpp', 'cuda',
2+
project('SU2', 'c', 'cpp',
33
version: '8.2.0 "Harrier"',
44
meson_version: '>=0.61.1',
55
license: 'LGPL2',
@@ -16,8 +16,10 @@ endif
1616
pymod = import('python')
1717
python = pymod.find_installation()
1818

19-
add_global_arguments(['-arch=sm_86'], language : 'cuda')
20-
19+
if get_option('enable-cuda')
20+
add_languages('cuda')
21+
add_global_arguments('-arch=sm_86', language : 'cuda')
22+
endif
2123

2224
su2_cpp_args = []
2325
su2_deps = [declare_dependency(include_directories: 'externals/CLI11')]
@@ -200,6 +202,7 @@ if get_option('enable-pastix')
200202
su2_deps += pastix_dep
201203
endif
202204

205+
# CUDA dependencies
203206
if get_option('enable-cuda')
204207
su2_cpp_args += '-DHAVE_CUDA'
205208
gpu_dep = dependency('cuda', version : '>=10', modules : ['cudart'])

0 commit comments

Comments
 (0)