diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2021-06-04 11:54:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 11:54:45 -0500 |
commit | 3c1d638ea9bef4c7e09475dfcc6a94907bad5796 (patch) | |
tree | 0bdf3e9b46311dbfc9920e7ce5edff96a96591fd /src/fpm_compiler.f90 | |
parent | 7a8f33721974cb66d44834229aff6dd4e2031eda (diff) | |
parent | 6d9004d93460dc15b99051c90d1b58d724b010e6 (diff) | |
download | fpm-3c1d638ea9bef4c7e09475dfcc6a94907bad5796.tar.gz fpm-3c1d638ea9bef4c7e09475dfcc6a94907bad5796.zip |
Merge branch 'master' into response-files
Diffstat (limited to 'src/fpm_compiler.f90')
-rw-r--r-- | src/fpm_compiler.f90 | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/fpm_compiler.f90 b/src/fpm_compiler.f90 index a499bb9..389ba94 100644 --- a/src/fpm_compiler.f90 +++ b/src/fpm_compiler.f90 @@ -35,7 +35,8 @@ use fpm_environment, only: & OS_WINDOWS, & OS_CYGWIN, & OS_SOLARIS, & - OS_FREEBSD + OS_FREEBSD, & + OS_OPENBSD implicit none public :: is_unknown_compiler public :: get_module_flags @@ -239,7 +240,6 @@ subroutine get_debug_compile_flags(id, flags) & -g& & -assume byterecl& & -traceback& - & -coarray=single& &' case(id_intel_classic_mac) flags = '& @@ -260,7 +260,6 @@ subroutine get_debug_compile_flags(id, flags) & /Z7& & /assume:byterecl& & /traceback& - & /Qcoarray:single& &' case(id_intel_llvm_nix, id_intel_llvm_unknown) flags = '& @@ -271,7 +270,6 @@ subroutine get_debug_compile_flags(id, flags) & -g& & -assume byterecl& & -traceback& - & -coarray=single& &' case(id_intel_llvm_windows) flags = '& @@ -281,7 +279,6 @@ subroutine get_debug_compile_flags(id, flags) & /Od& & /Z7& & /assume:byterecl& - & /Qcoarray:single& &' case(id_nag) flags = '& @@ -332,6 +329,34 @@ subroutine get_module_flags(compiler, modpath, flags) end subroutine get_module_flags +subroutine get_default_c_compiler(f_compiler, c_compiler) + character(len=*), intent(in) :: f_compiler + character(len=:), allocatable, intent(out) :: c_compiler + integer(compiler_enum) :: id + + id = get_compiler_id(f_compiler) + + select case(id) + + case(id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows, id_intel_classic_unknown) + c_compiler = 'icc' + + case(id_intel_llvm_nix,id_intel_llvm_windows, id_intel_llvm_unknown) + c_compiler = 'icx' + + case(id_flang) + c_compiler='clang' + + case(id_ibmxl) + c_compiler='xlc' + + case default + ! Fall-back to using Fortran compiler + c_compiler = f_compiler + end select + +end subroutine get_default_c_compiler + function get_compiler_id(compiler) result(id) character(len=*), intent(in) :: compiler integer(kind=compiler_enum) :: id |