Skip to content

Commit 501cc61

Browse files
authored
Interpret "flang" as LLVM flang (#1176)
2 parents e01591b + 87e2781 commit 501cc61

File tree

3 files changed

+30
-35
lines changed

3 files changed

+30
-35
lines changed

src/fpm/manifest/profiles.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ subroutine new_profiles(profiles, table, error)
655655
end do
656656
end subroutine new_profiles
657657

658-
659658
!> Write information on instance
660659
subroutine info(self, unit, verbosity)
661660

src/fpm_compiler.F90

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ module fpm_compiler
275275
flag_cray_free_form = " -ffree"
276276

277277
character(*), parameter :: &
278-
flag_flang_new_openmp = " -fopenmp", &
279-
flag_flang_new_debug = " -g", &
280-
flag_flang_new_opt = " -O3", &
281-
flag_flang_new_pic = " -fPIC", &
282-
flag_flang_new_free_form = " -ffree-form", &
283-
flag_flang_new_fixed_form = " -ffixed-form", &
284-
flag_flang_new_no_implicit_typing = " -fimplicit-none"
278+
flag_flang_openmp = " -fopenmp", &
279+
flag_flang_debug = " -g", &
280+
flag_flang_opt = " -O3", &
281+
flag_flang_pic = " -fPIC", &
282+
flag_flang_free_form = " -ffree-form", &
283+
flag_flang_fixed_form = " -ffixed-form", &
284+
flag_flang_no_implicit_typing = " -fimplicit-none"
285285

286286
contains
287287

@@ -307,7 +307,7 @@ function get_default_flags(self, release) result(flags)
307307
id_pgi, id_nvhpc, id_nag, id_cray, id_ibmxl)
308308
pic_flag = " -fPIC"
309309
case (id_flang)
310-
! flang-new doesn't support -fPIC on Windows MSVC target
310+
! LLVM Flang doesn't support -fPIC on Windows MSVC target
311311
if (get_os_type() == OS_WINDOWS) then
312312
pic_flag = ""
313313
else
@@ -422,8 +422,8 @@ subroutine get_release_compile_flags(id, flags)
422422

423423
case(id_flang)
424424
flags = &
425-
flag_flang_new_opt//&
426-
flag_flang_new_pic
425+
flag_flang_opt//&
426+
flag_flang_pic
427427

428428
end select
429429
end subroutine get_release_compile_flags
@@ -523,8 +523,8 @@ subroutine get_debug_compile_flags(id, flags)
523523

524524
case(id_flang)
525525
flags = &
526-
flag_flang_new_debug//&
527-
flag_flang_new_pic
526+
flag_flang_debug//&
527+
flag_flang_pic
528528

529529
end select
530530
end subroutine get_debug_compile_flags
@@ -691,7 +691,7 @@ function get_shared_flag(self) result(shared_flag)
691691
select case (self%id)
692692
case default
693693
shared_flag = "-shared"
694-
case (id_gcc, id_f95, id_flang_classic, id_flang, id_lfortran)
694+
case (id_gcc, id_f95, id_flang, id_flang_classic, id_lfortran)
695695
shared_flag = "-shared"
696696
case (id_intel_classic_nix, id_intel_llvm_nix, id_pgi, id_nvhpc)
697697
shared_flag = "-shared"
@@ -727,7 +727,7 @@ function get_feature_flag(self, feature) result(flags)
727727
flags = flag_cray_no_implicit_typing
728728

729729
case(id_flang)
730-
flags = flag_flang_new_no_implicit_typing
730+
flags = flag_flang_no_implicit_typing
731731

732732
end select
733733

@@ -756,6 +756,7 @@ function get_feature_flag(self, feature) result(flags)
756756
end select
757757

758758
case("free-form")
759+
759760
select case(self%id)
760761
case(id_caf, id_gcc, id_f95)
761762
flags = flag_gnu_free_form
@@ -777,7 +778,7 @@ function get_feature_flag(self, feature) result(flags)
777778
flags = flag_cray_free_form
778779

779780
case(id_flang)
780-
flags = flag_flang_new_free_form
781+
flags = flag_flang_free_form
781782

782783
end select
783784

@@ -806,7 +807,7 @@ function get_feature_flag(self, feature) result(flags)
806807
flags = flag_lfortran_fixed_form
807808

808809
case(id_flang)
809-
flags = flag_flang_new_fixed_form
810+
flags = flag_flang_fixed_form
810811

811812
end select
812813

@@ -1025,26 +1026,21 @@ function match_compiler_type(compiler) result(id)
10251026
return
10261027
end if
10271028

1028-
if (check_compiler(compiler, "flang-new")) then
1029-
id = id_flang
1030-
return
1031-
end if
1032-
1033-
if (check_compiler(compiler, "f18")) then
1034-
id = id_f18
1035-
return
1036-
end if
1037-
10381029
if (check_compiler(compiler, "flang-classic")) then
10391030
id = id_flang_classic
10401031
return
10411032
end if
10421033

1043-
if (check_compiler(compiler, "flang")) then
1034+
if (check_compiler(compiler, "flang-new") .or. check_compiler(compiler, "flang")) then
10441035
id = id_flang
10451036
return
10461037
end if
10471038

1039+
if (check_compiler(compiler, "f18")) then
1040+
id = id_f18
1041+
return
1042+
end if
1043+
10481044
if (check_compiler(compiler, "xlf90")) then
10491045
id = id_ibmxl
10501046
return
@@ -1824,8 +1820,8 @@ pure function compiler_id_name(id) result(name)
18241820
case(id_pgi); name = "pgfortran"
18251821
case(id_nvhpc); name = "nvfortran"
18261822
case(id_nag); name = "nagfor"
1827-
case(id_flang_classic); name = "flang"
1828-
case(id_flang); name = "flang-new"
1823+
case(id_flang_classic); name = "flang-classic"
1824+
case(id_flang); name = "flang"
18291825
case(id_f18); name = "f18"
18301826
case(id_ibmxl); name = "xlf90"
18311827
case(id_cray); name = "crayftn"

src/metapackage/fpm_meta_openmp.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module fpm_meta_openmp
22
use fpm_compiler, only: compiler_t, id_gcc, id_f95, id_intel_classic_windows, &
33
id_intel_llvm_windows, id_intel_classic_nix, id_intel_llvm_nix, &
44
id_intel_classic_mac, id_pgi, id_nvhpc, id_ibmxl, id_nag, id_lfortran, &
5-
id_flang_classic, id_flang, flag_gnu_openmp, flag_intel_openmp_win, &
5+
id_flang, id_flang_classic, flag_gnu_openmp, flag_intel_openmp_win, &
66
flag_intel_openmp, flag_pgi_openmp, flag_nag_openmp, &
7-
flag_lfortran_openmp, flag_flang_new_openmp
7+
flag_lfortran_openmp, flag_flang_openmp
88
use fpm_strings, only: string_t
99
use fpm_meta_base, only: metapackage_t, destroy
1010
use fpm_error, only: error_t, fatal_error
@@ -73,9 +73,9 @@ subroutine init_openmp(this,compiler,all_meta,error)
7373
openmp_flag = flag_lfortran_openmp
7474
link_flag = flag_lfortran_openmp
7575

76-
case (id_flang_classic, id_flang)
77-
openmp_flag = flag_flang_new_openmp
78-
link_flag = flag_flang_new_openmp
76+
case (id_flang, id_flang_classic)
77+
openmp_flag = flag_flang_openmp
78+
link_flag = flag_flang_openmp
7979

8080
case default
8181
call fatal_error(error,'openmp not supported on compiler '//compiler%name()//' yet')

0 commit comments

Comments
 (0)