Skip to content

Commit 8f27d57

Browse files
authored
Merge pull request #372 from urbanjost/nounderscore
close #371
2 parents 317a09a + 0d23180 commit 8f27d57

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

fpm/src/fpm.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ subroutine build_model(model, settings, package, error)
6969
model%output_directory = join_path('build',basename(model%fortran_compiler)//'_'//settings%build_name)
7070

7171
call add_compile_flag_defaults(settings%build_name, basename(model%fortran_compiler), model)
72+
if(settings%verbose)then
73+
write(*,*)'<INFO>COMPILER OPTIONS: ', model%fortran_compile_flags
74+
endif
7275

7376
model%link_flags = ''
7477

fpm/src/fpm_compiler.f90

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ subroutine add_compile_flag_defaults(build_name,compiler,model)
1212
! could just be a function to return a string instead of passing model
1313
! but likely to change other components like matching C compiler
1414

15-
character(len=:),allocatable :: fflags ! optional flags that might be overridden by user
15+
character(len=:),allocatable :: fflags ! optional flags that might be overridden by user
1616
character(len=:),allocatable :: modpath
1717
character(len=:),allocatable :: mandatory ! flags required for fpm to function properly;
1818
! ie. add module path and module include directory as appropriate
@@ -42,6 +42,24 @@ subroutine add_compile_flag_defaults(build_name,compiler,model)
4242
! G95 ? ? -fmod= -I -fopenmp discontinued
4343
! Open64 ? ? -module -I -mp discontinued
4444
! Unisys ? ? ? ? ? discontinued
45+
character(len=*),parameter :: names(*)=[ character(len=10) :: &
46+
& 'caf', &
47+
& 'gfortran', &
48+
& 'f95', &
49+
& 'nvfortran', &
50+
& 'ifort', &
51+
& 'ifx', &
52+
& 'pgfortran', &
53+
& 'pgf90', &
54+
& 'pgf95', &
55+
& 'flang', &
56+
& 'lfc', &
57+
& 'nagfor', &
58+
& 'crayftn', &
59+
& 'xlf90', &
60+
& 'unknown']
61+
integer :: i
62+
4563
modpath=join_path(model%output_directory,model%package_name)
4664
fflags=''
4765
mandatory=''
@@ -143,7 +161,6 @@ subroutine add_compile_flag_defaults(build_name,compiler,model)
143161
& -reentrancy threaded&
144162
& -nogen-interfaces&
145163
& -assume byterecl&
146-
& -assume nounderscore&
147164
&'
148165
mandatory=' -module '//modpath//' -I '//modpath
149166
case('debug_ifort')
@@ -219,10 +236,8 @@ subroutine add_compile_flag_defaults(build_name,compiler,model)
219236
case default
220237
fflags = ' '
221238
mandatory=' -module '//modpath//' -I '//modpath
222-
write(*,*)'<WARNING> unknown compiler (',compiler,')'
223-
write(*,*)' and build name (',build_name,')'
224-
write(*,*)' combination.'
225-
write(*,*)' known compilers are gfortran, nvfortran, ifort'
239+
write(*,'(*(a))')'<WARNING> unknown compiler (',compiler,') and build name (',build_name,') combination.'
240+
write(*,'(a,*(T31,6(a:,", "),/))')' known compilers are ',(trim(names(i)),i=1,size(names)-1)
226241
end select
227242

228243
model%fortran_compile_flags = fflags//' '//mandatory

0 commit comments

Comments
 (0)