phist: add patch to resolve build issue #32111 with +fortran %oneapi (#32965)

* phist: add patch to resolve build issue #32111 with +fortran %oneapi

* phist: some lines of code were patched twice, make these patches orthogonal.
This commit is contained in:
Jonas Thies 2022-10-07 01:16:48 +02:00 committed by GitHub
parent 1a12ddbd2d
commit f56ff16564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 96 additions and 1 deletions

View File

@ -0,0 +1,94 @@
diff --git a/fortran_bindings/test/core.F90 b/fortran_bindings/test/core.F90
index cc413a0c..eeee8f5a 100644
--- a/fortran_bindings/test/core.F90
+++ b/fortran_bindings/test/core.F90
@@ -21,7 +21,7 @@ implicit none
integer(c_int) :: iflag
! dummy args to phist_kernels_init
integer(c_int) :: argc
-type(c_ptr), target :: argv
+type(c_ptr), target, dimension(1) :: argv
! communicator and map handles
TYPE(comm_ptr) :: comm
@@ -43,7 +43,7 @@ integer :: rank
logical :: verbose
argc=0
-argv=C_NULL_PTR
+argv(1)=C_NULL_PTR
#ifdef PHIST_HAVE_MPI
call MPI_Init(iflag)
#endif
@@ -54,7 +54,7 @@ call tests_init('core')
! *as long as we already initialized MPI!*
! Otherwise, the kernel lib may call the C variant
! of mpi_init and pass in these pointers
-call phist_kernels_init(argc,c_loc(argv), iflag)
+call phist_kernels_init(argc, argv, iflag)
ASSERT_EQ(0,iflag)
! create a communicator object, note that this may be different from an MPI_Comm in Fortran
diff --git a/fortran_bindings/test/jada.F90 b/fortran_bindings/test/jada.F90
index 22e5d080..c08f57a3 100644
--- a/fortran_bindings/test/jada.F90
+++ b/fortran_bindings/test/jada.F90
@@ -23,7 +23,7 @@ implicit none
integer(c_int) :: iflag
! dummy args to phist_kernels_init
integer(c_int) :: argc
-type(c_ptr), target :: argv
+type(c_ptr), target, dimension(1) :: argv
! communicator and map handles
TYPE(comm_ptr) :: comm
@@ -59,7 +59,7 @@ integer :: rank
logical :: verbose
argc=0
-argv=C_NULL_PTR
+argv(1)=C_NULL_PTR
#ifdef PHIST_HAVE_MPI
call MPI_Init(iflag)
#endif
@@ -70,7 +70,7 @@ call tests_init('jada')
! *as long as we already initialized MPI!*
! Otherwise, the kernel lib may call the C variant
! of mpi_init and pass in these pointers
-call phist_kernels_init(argc,c_loc(argv), iflag)
+call phist_kernels_init(argc, argv, iflag)
ASSERT_EQ(0,iflag)
! create a communicator object, note that this may be different from an MPI_Comm in Fortran
diff --git a/fortran_bindings/test/kernels.F90 b/fortran_bindings/test/kernels.F90
index 6933e06e..a75c36e7 100644
--- a/fortran_bindings/test/kernels.F90
+++ b/fortran_bindings/test/kernels.F90
@@ -22,7 +22,7 @@ implicit none
integer(c_int) :: iflag
! dummy args to phist_kernels_init
integer(c_int) :: argc
-type(c_ptr), target :: argv
+type(c_ptr), target, dimension(1) :: argv
! indicate which types are available in the kernel library
logical :: haveS, haveC, haveD, haveZ
@@ -48,7 +48,7 @@ integer :: rank
logical :: verbose
argc=0
-argv=C_NULL_PTR
+argv(1)=C_NULL_PTR
#ifdef PHIST_HAVE_MPI
call MPI_Init(iflag)
@@ -60,7 +60,7 @@ call tests_init('kernels')
! *as long as we already initialized MPI!*
! Otherwise, the kernel lib may call the C variant
! of mpi_init and pass in these pointers
-call phist_kernels_init(argc,c_loc(argv), iflag)
+call phist_kernels_init(argc,argv, iflag)
ASSERT_EQ(0,iflag)
! create a communicator object, note that this may be different from an MPI_Comm in Fortran
diff --git a/src/kernels/builtin/crsmat_module.F90 b/src/kernels/builtin/crsmat_module.F90

View File

@ -145,6 +145,7 @@ class Phist(CMakePackage):
patch("ppc64_sse.patch", when="@1.9.4")
patch("update_tpetra_gotypes.patch", when="@1.6:1.8")
patch("sbang.patch", when="+fortran")
patch("fortran-fixes-pre-1.11.patch", when="+fortran @1.7.0:1.10.0")
# ###################### Dependencies ##########################
@ -200,7 +201,7 @@ class Phist(CMakePackage):
# the phist repo came with it's own FindMPI.cmake before, which may cause some other
# MPI installation to be used than the one spack wants.
def patch(self):
if self.spec.satisfies("@1.9.6:"):
if self.spec.satisfies("@1.9.6:1.10.0"):
filter_file("USE mpi", "use mpi_f08", "src/kernels/builtin/crsmat_module.F90")
# filter_file('use mpi', 'use mpi_f08', -> Needs more fixes
# 'fortran_bindings/phist_testing.F90')