mpip / pfft

Parallel fast Fourier transforms
GNU General Public License v3.0
54 stars 23 forks source link

Installation fails to link openmpi "PFFT requires an MPI C compiler" #33

Closed ashwinvis closed 6 years ago

ashwinvis commented 6 years ago

Here is the log:

[avmo@kthxps pfft-1.0.8-alpha]$ 
[avmo@kthxps pfft-1.0.8-alpha]$ ls
api/        doc/    kernel/  tests/  aclocal.m4  bootstrap.sh*  config.h.in  configure.ac  COPYING       INSTALL      Makefile.in  pfft.pc.in  TODO
build-aux/  gcell/  m4/      util/   AUTHORS     ChangeLog      configure*   CONVENTIONS   fconfig.h.in  Makefile.am  NEWS         README
[avmo@kthxps pfft-1.0.8-alpha]$ export LANG=C
[avmo@kthxps pfft-1.0.8-alpha]$ ./bootstrap.sh 
PLEASE IGNORE WARNINGS AND ERRORS
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: linking file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltversion.m4'
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:139: installing 'build-aux/compile'
configure.ac:55: installing 'build-aux/missing'
api/Makefile.am: installing 'build-aux/depcomp'
autoreconf: Leaving directory `.'
[avmo@kthxps pfft-1.0.8-alpha]$ ./configure --prefix=/home/avmo/src/spack/opt/spack/linux-archrolling-x86_64/gcc-7.3.0/pfft-1.0.8-alpha-vg4mvddn4ybvvasdceoodnlxh3xfxv4d CC=/usr/bin/gcc MPICC=/usr/bin/mpicc FC=/usr/bin/gfortran MPIFC=/usr/bin/mpif90
configure: ****************************************************************
configure: *      Configuring in common/pfft                              *
configure: ****************************************************************
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking dependency style of /usr/bin/gcc... gcc3
checking for function MPI_Init... no
checking for function MPI_Init in -lmpi... no
checking for function MPI_Init in -lmpich... no
configure: error: in `/home/avmo/tmp/pfft-1.0.8-alpha':
configure: error: PFFT requires an MPI C compiler.
See `config.log' for more details
[avmo@kthxps pfft-1.0.8-alpha]$ pacman -Qi openmpi
Name            : openmpi
Version         : 3.0.0-1
Description     : High performance message passing library (MPI)
Architecture    : x86_64
URL             : https://www.open-mpi.org
Licenses        : custom:OpenMPI
Groups          : None
Provides        : None
Depends On      : libltdl  hwloc  openssh
Optional Deps   : gcc-fortran: fortran support [installed]
Required By     : arpack  hdf5-openmpi  icet  ospray  python-mpi4py  python2-mpi4py
Optional For    : boost-libs  valgrind  vtk  vtk-visit  vtk6
Conflicts With  : None
Replaces        : None
Installed Size  : 9.52 MiB
Packager        : Levente Polyak <anthraxx@archlinux.org>
Build Date      : Wed 20 Dec 2017 10:26:45 AM CET
Install Date    : Mon 08 Jan 2018 02:31:37 PM CET
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
mpip commented 6 years ago

Hi,

the log tells that linking with the MPI libs did not work. Configure tried the linker flag -lmpi and -lmpich (not relevant for openmpi). For more details have a look into config.log and search for the failed linker job.

What flags do you use on your machine to compile and link a simple test MPI program? This may give us a hint what is missing here.

Best regards Michael

Ashwin Vishnu notifications@github.com schrieb am Do., 15. März 2018, 11:03:

Here is the log:

[avmo@kthxps pfft-1.0.8-alpha]$ [avmo@kthxps pfft-1.0.8-alpha]$ ls api/ doc/ kernel/ tests/ aclocal.m4 bootstrap.sh config.h.in configure.ac COPYING INSTALL Makefile.in pfft.pc.in TODO build-aux/ gcell/ m4/ util/ AUTHORS ChangeLog configure CONVENTIONS fconfig.h.in Makefile.am NEWS README [avmo@kthxps pfft-1.0.8-alpha]$ export LANG=C [avmo@kthxps pfft-1.0.8-alpha]$ ./bootstrap.sh PLEASE IGNORE WARNINGS AND ERRORS libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'. libtoolize: linking file 'build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: linking file 'm4/libtool.m4' libtoolize: linking file 'm4/ltoptions.m4' libtoolize: linking file 'm4/ltversion.m4' autoreconf: Entering directory .'autoreconf: configure.ac: not using Gettextautoreconf: running: aclocal --force -I m4autoreconf: configure.ac: tracingautoreconf: running: libtoolize --copy --forcelibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.libtoolize: copying file 'build-aux/ltmain.sh'libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.libtoolize: copying file 'm4/libtool.m4'libtoolize: copying file 'm4/ltoptions.m4'libtoolize: copying file 'm4/ltsugar.m4'libtoolize: copying file 'm4/ltversion.m4'libtoolize: copying file 'm4/lt~obsolete.m4'autoreconf: running: /usr/bin/autoconf --forceautoreconf: running: /usr/bin/autoheader --forceautoreconf: running: automake --add-missing --copy --force-missingconfigure.ac:139: installing 'build-aux/compile'configure.ac:55: installing 'build-aux/missing'api/Makefile.am: installing 'build-aux/depcomp'autoreconf: Leaving directory.'[avmo@kthxps pfft-1.0.8-alpha]$ ./configure --prefix=/home/avmo/src/spack/opt/spack/linux-archrolling-x86_64/gcc-7.3.0/pfft-1.0.8-alpha-vg4mvddn4ybvvasdceoodnlxh3xfxv4d CC=/usr/bin/gcc MPICC=/usr/bin/mpicc FC=/usr/bin/gfortran MPIFC=/usr/bin/mpif90configure: ****configure: Configuring in common/pfft configure: ****checking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /usr/bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking whether make supports nested variables... yeschecking for style of include used by make... GNUchecking for gcc... /usr/bin/gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether /usr/bin/gcc accepts -g... yeschecking for /usr/bin/gcc option to accept ISO C89... none neededchecking whether /usr/bin/gcc understands -c and -o together... yeschecking dependency style of /usr/bin/gcc... gcc3checking for function MPI_Init... nochecking for function MPI_Init in -lmpi... nochecking for function MPI_Init in -lmpich... noconfigure: error: in /home/avmo/tmp/pfft-1.0.8-alpha':configure: error: PFFT requires an MPI C compiler.Seeconfig.log' for more details[avmo@kthxps pfft-1.0.8-alpha]$ pacman -Qi openmpiName : openmpiVersion : 3.0.0-1Description : High performance message passing library (MPI)Architecture : x86_64URL : https://www.open-mpi.orgLicenses : custom:OpenMPIGroups : NoneProvides : NoneDepends On : libltdl hwloc opensshOptional Deps : gcc-fortran: fortran support [installed]Required By : arpack hdf5-openmpi icet ospray python-mpi4py python2-mpi4pyOptional For : boost-libs valgrind vtk vtk-visit vtk6Conflicts With : NoneReplaces : NoneInstalled Size : 9.52 MiBPackager : Levente Polyak anthraxx@archlinux.orgBuild Date : Wed 20 Dec 2017 10:26:45 AM CETInstall Date : Mon 08 Jan 2018 02:31:37 PM CETInstall Reason : Installed as a dependency for another packageInstall Script : NoValidated By : Signature

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mpip/pfft/issues/33, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3lQj0R_QjL5beG4hc2BSkINV_1NuSnks5tejxagaJpZM4Sr23a .

ashwinvis commented 6 years ago

the log tells that linking with the MPI libs did not work. Configure tried the linker flag -lmpi and -lmpich (not relevant for openmpi). For more details have a look into config.log and search for the failed linker job.

config.log has tried both.

What flags do you use on your machine to compile and link a simple test MPI program?

I hope this helps:

sandbox/mpi-test » mpicc --showme
gcc -pthread -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi
sandbox/mpi-test » mpif90 --showme
/usr/bin/gfortran -I/usr/include -pthread -I/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
sandbox/mpi-test » mpicc --showme:link
-pthread -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi
sandbox/mpi-test » mpif90 --showme:link
-pthread -I/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
ashwinvis commented 6 years ago

Configure seems to work when I do either of the following.

./configure  .... LDFLAGS="-L/usr/lib/openmpi"
./configure ... LDFLAGS="$(mpicc -showme:link)"

Is it possible to automate this?

mpip commented 6 years ago

Please send config.log

Did you already compile, link and run a MPI program on this machine? If yes, please send the command lines for compilation and linkage.

Ashwin Vishnu notifications@github.com schrieb am Do., 15. März 2018, 11:51:

the log tells that linking with the MPI libs did not work. Configure tried the linker flag -lmpi and -lmpich (not relevant for openmpi). For more details have a look into config.log and search for the failed linker job.

config.log has tried both.

What flags do you use on your machine to compile and link a simple test MPI program?

I hope this helps:

sandbox/mpi-test » mpicc --showme gcc -pthread -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi sandbox/mpi-test » mpif90 --showme /usr/bin/gfortran -I/usr/include -pthread -I/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi sandbox/mpi-test » mpicc --showme:link -pthread -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi sandbox/mpi-test » mpif90 --showme:link -pthread -I/usr/lib/openmpi -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mpip/pfft/issues/33#issuecomment-373335973, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3lQsyAaPhenIDf_Rm9slHOJR4FYu-fks5tekeogaJpZM4Sr23a .

mpip commented 6 years ago

Ok. Great. Therefore I was asking for your standard linker flags. On most machines the MPI lib path is part of the global search paths. If not you have to add it to LD_FLAGS like you did.

Ashwin Vishnu notifications@github.com schrieb am Do., 15. März 2018, 12:03:

Configure seems to work when I do this.

./configure .... LDFLAGS="-L/usr/lib/openmpi" ./configure ... LDFLAGS="$(mpicc -showme:link)"

Is it possible to automate this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mpip/pfft/issues/33#issuecomment-373339083, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3lQqLf-mseuAXKPggC2xnXP5mem_w2ks5tekqKgaJpZM4Sr23a .

ashwinvis commented 6 years ago

The config.log when it fails: config.log

About compiling I normally just use mpicc or mpif90. If you want something more explicit:

sandbox/mpi-test » gcc -pthread -Wl,-rpath -Wl,/usr/lib/openmpi -Wl,--enable-new-dtags -L/usr/lib/openmpi -lmpi hello_mpi.c 
sandbox/mpi-test » mpirun -np 2 ./a.out 

HELLO_MPI - Master process:
  C/MPI version
  An MPI example program.

  The number of processes is 2.

  Process 0 says 'Hello, world!'
  Elapsed wall clock time = 0.000032 seconds.
  Process 1 says 'Hello, world!'

HELLO_MPI - Master process:
  Normal end of execution: 'Goodbye, world!'

15 March 2018 12:11:36 PM
ashwinvis commented 6 years ago

On most machines the MPI lib path is part of the global search paths. If not you have to add it to LD_FLAGS like you did.

Got it. However a more portable solution would have been interesting. Thank you for your time. Closing this issue.