Skip to content

Commit 4b3fb3c

Browse files
authored
Add OMP critical for make_archive (#708)
1 parent 45b1498 commit 4b3fb3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/fpm_compiler.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,9 @@ end subroutine link
774774

775775

776776
!> Create an archive
777+
!> @todo An OMP critical section is added for Windows OS,
778+
!> which may be related to a bug in Mingw64-openmp and is expected to be resolved in the future,
779+
!> see issue #707 and #708.
777780
subroutine make_archive(self, output, args, log_file, stat)
778781
!> Instance of the archiver object
779782
class(archiver_t), intent(in) :: self
@@ -787,10 +790,12 @@ subroutine make_archive(self, output, args, log_file, stat)
787790
integer, intent(out) :: stat
788791

789792
if (self%use_response_file) then
793+
!$omp critical
790794
call write_response_file(output//".resp" , args)
791795
call run(self%ar // output // " @" // output//".resp", echo=self%echo, &
792796
& verbose=self%verbose, redirect=log_file, exitstat=stat)
793797
call delete_file(output//".resp")
798+
!$omp end critical
794799
else
795800
call run(self%ar // output // " " // string_cat(args, " "), &
796801
& echo=self%echo, verbose=self%verbose, redirect=log_file, exitstat=stat)

0 commit comments

Comments
 (0)