Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static libraries, F90 module, and alignment warnings #13043

Open
MJRutter opened this issue Jan 16, 2025 · 0 comments
Open

static libraries, F90 module, and alignment warnings #13043

MJRutter opened this issue Jan 16, 2025 · 0 comments

Comments

@MJRutter
Copy link

If I try to use static libraries with the F90 module, lots of warning messages about alignment result whenever code is compiled. These disappear with the F08 module. Is the use of static libraries and F90 fully supported?

OpenMPI 5.0.6 source download (and several earlier versions), Ubuntu 24.04, GCC 13.3, x86_64

$ FC=gfortran CC=gcc CXX=g++ ./configure --enable-static --prefix=/scratch/OMPI
$ make -j 4
$ make install
$ /scratch/OMPI/bin/mpif90 -static hello.mpi.f90 

gives many warnings from ld starting

/bin/ld: warning: alignment 8 of normal symbol `mpi_fortran_weights_empty_' in /scratch/OMPI/lib/libmpi.a(ompi_mpi_init.o) is smaller than 16 used by the common definition in /tmp/cc4e0CUZ.o
/bin/ld: warning: NOTE: alignment discrepancies can cause real problems.  Investigation is advised.

The example code was

program hello
  use mpi
  integer npe,mype,ierr
  call mpi_init(ierr)
  call mpi_comm_rank(mpi_comm_world, mype, ierr)
  call mpi_comm_size(mpi_comm_world, npe, ierr)
  write(*,101) mype,npe
101   format(' Hello F90 parallel world, I am process ',I3,' out of ',I3)
  call mpi_finalize(ierr)
end program hello

Switching to "use mpi_f08" seems to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant