Closed akohlmey closed 4 years ago
Hi Axel,
which compilers are used by Fedora when compiling the package, I assume gfortran? If yes, which version?
Hi Axel,
which compilers are used by Fedora when compiling the package, I assume gfortran? If yes, which version?
as the subject line of the issue says, it is gfortran 10.
build-scafacos> gfortran --version
GNU Fortran (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)
FWIW, there are no issues with Fedora 31 and gfortran 9.x
It seems that gfortran changed its default behavior when dealing with Fortran interfacing. Now it checks if, when calling an external function, e.g. mpi_allreduce, if the function is always called with the same arguments. Since it is not called with the same arguments here, it fails. There is a way to revert this change by passing the -fallow-argument-mismatch
flag. I will check if this resolves the issue by reverting the errors to warnings and will let you know once the compilation finished.
@akohlmey: The flag seems to fix the issue for me, I will talk to Christoph Junghans, how to pass the flag with cmake, only if gfortran 10+ is used, if that is fine with you. . Then I will open a pull-request on Lammps to fix it.
On Mon, Jun 15, 2020 at 10:44 AM rhalver notifications@github.com wrote:
@akohlmey https://github.com/akohlmey: The flag seems to fix the issue for me, I will talk to Christoph Junghans, how to pass the flag with cmake, only if gfortran 10+ is used, if that is fine with you. . Then I will open a pull-request on Lammps to fix it.
already working on it. just noticed some other, related issues and am working on those, too.
axel.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scafacos/scafacos/issues/29#issuecomment-644178535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGTY64UHNISJMI54SLXO3RWYXTJANCNFSM4N5XCEOA .
-- Dr. Axel Kohlmeyer akohlmey@gmail.com http://goo.gl/1wk0 College of Science & Technology, Temple University, Philadelphia PA, USA International Centre for Theoretical Physics, Trieste. Italy.
Ok, let me know, if there is anything I need to do. For the time being, I close this issue now.
One more followup to this. While the compiler flag works around the compilation issue, it should be considered to address this through changes in the source code. After some reading of bug reports and discussions on the gcc bugzilla pages, the origin of the compiler issue is that mpi_allreduce
and mpi_allgather
are called with an implicit interface. However modern revisions of the Fortran standard require explicit interfaces for subroutines and functions that can take multiple types or ranks of arguments. Thus one way to make the library compile without switching the compiler to "legacy mode" would require either converting the whole thing to use the MPI (or MPI_F08?) module instead of the (legacy) mpif.h
include file, or adding explicit interfaces, e.g. in each of the wrapper functions calling mpi_allreduce
one would add something like following after the variable declarations:
interface
subroutine mpi_allgather(send,scount,stype,recv,rcount,rtype,comm,err)
! declare data types of the interface here as they are called in this wrapper
end subroutine mpi_allgather
end interface
This is a bit tedious and requires some careful debugging, but would help to future-proof the library and avoid problems compiling it for less "technical" people.
Hi when trying to build LAMMPS with the USER-SCAFACOS package (current git master) on a Fedora 32 installation, compilation fails to compile
lib/fmm/src/mp_wrapper.f90
with the errors listed below. The code looks valid to me, so I am confused what may be the cause and what could be a possible workaround. To reproduce:Here are the error messages: