Skip to content

Commit

Permalink
Configure meson.build (#34)
Browse files Browse the repository at this point in the history
* Configure meson.build

* Make OpenMP dependency explicit, so that symbols can be found
  during build.
* Define Fortran compiler. `fc_id` was previously used, but never set.

Signed-off-by: Ty Balduf <[email protected]>

* Recognize ifx (intel-llvm)

---------

Signed-off-by: Ty Balduf <[email protected]>
  • Loading branch information
TyBalduf authored Jun 21, 2024
1 parent 7de0d7b commit fbf42b9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,33 @@ project(
],
)

fc = meson.get_compiler('fortran')
fc_id = fc.get_id()

lib_deps = []

if get_option('openmp')
omp_dep = dependency('openmp', required: fc_id != 'intel' and fc_id != 'intel-llvm' and fc_id != 'nvidia_hpc')
if not omp_dep.found()
if fc_id == 'intel' or fc_id != 'intel-llvm'
message('Using -qopenmp to use OpenMP with Intel compilers')
omp_dep = declare_dependency(
compile_args: '-qopenmp',
link_args: '-qopenmp',
)
else
message('Using -mp to use OpenMP with NVHPC compilers')
omp_dep = declare_dependency(
compile_args: '-mp',
link_args: '-mp',
)
endif
endif
lib_deps += omp_dep
endif

lib_deps += dependency('threads')

subdir('config')

srcs = []
Expand Down

0 comments on commit fbf42b9

Please sign in to comment.