Project

General

Profile

Bug #1747

hwloc Breaking ROMIO Configure Script

Added by Ronak Buch over 1 year ago. Updated over 1 year ago.

Status:
Merged
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
11/27/2017
Due date:
% Done:

0%


Description

The ROMIO configure script is broken on 32-bit platforms, complaining:

checking if a simple MPI program compiles and links...  
*# Unable to compile a simple MPI program
*# Use the -mpi, -mpiincdir, and -mpilib options to configure to specify the
*# MPI implementation, the include path for mpi.h, and the MPI library to link
/scratch/autobuild/netlrts-linux/charm/netlrts-linux/bin/ampicc  -O -I/scratch/autobuild/netlrts-linux/charm/netlrts-linux/include -o conftest mpitest.c /scratch/autobuild/netlrts-linux/charm/netlrts-linux/lib/libmoduleampi.a > /dev/null 2>&1
buildcharm@esteem:/scratch/autobuild/netlrts-linux/charm/netlrts-linux-x86_64/tmp/libs/ck-libs/ampi/romio$ /scratch/autobuild/netlrts-linux/charm/netlrts-linux/bin/ampicc  -O -I/scratch/autobuild/netlrts-linux/charm/netlrts-linux/include -o conftest mpitest.c /scratch/autobuild/netlrts-linux/charm/netlrts-linux/lib/libmoduleampi.a
/usr/bin/ld: skipping incompatible /scratch/autobuild/netlrts-linux/charm/netlrts-linux/bin/../lib/libhwloc_embedded.a when searching for -lhwloc_embedded
/usr/bin/ld: cannot find -lhwloc_embedded
collect2: error: ld returned 1 exit status
Fatal Error by charmc in directory /scratch/autobuild/netlrts-linux/charm/netlrts-linux-x86_64/tmp/libs/ck-libs/ampi/romio
   Command g++ -rdynamic -m32 -O -L/scratch/autobuild/netlrts-linux/charm/netlrts-linux/bin/../lib mpitest.o moduleinit15380.o -lmoduletcharm -lmoduleampi -lmoduletcharmmain /scratch/autobuild/netlrts-linux/charm/netlrts-linux/lib/libmoduleampi.a -lddt -lampi-compat -lckmain -lck -lmemory-default -lthreads-default -lconv-cplus-y -lconv-core -ltmgr -lconv-util -lconv-partition -lhwloc_embedded -lm -lmemory-default -lthreads-default -lldb-rand -lconv-ldb -lckqt -ldl -lmoduletcharmmain -lmoduleampi -lmoduletcharm -ltcharm-compat -lmoduleNDMeshStreamer -lmodulecompletion -lm -o conftest returned error code 1
charmc exiting...

This may be due to an earlier issue in the hwloc build:

make[1]: Leaving directory `/scratch/autobuild/netlrts-linux-smp/charm/netlrts-linux-smp/tmp/hwloc'
( test -e hwloc/src/.libs/libhwloc_embedded.lib && cp -f hwloc/src/.libs/libhwloc_embedded.lib hwloc/src/.libs/libhwloc_embedded.a )
make: [hwloc-target] Error 1 (ignored)


Related issues

Related to Charm++ - Bug #1668: Ensure that all libraries/modules will build as dynamic/shared objects (.so/.dylib vs .a) Merged 08/29/2017

History

#1 Updated by Ronak Buch over 1 year ago

This was observed on netlrts-linux-smp and netlrts-linux (with commit e1608dd483df978cf070b4b561c0f257e7ea2ef1).

#2 Updated by Evan Ramos over 1 year ago

  • Related to Bug #1668: Ensure that all libraries/modules will build as dynamic/shared objects (.so/.dylib vs .a) added

#3 Updated by Evan Ramos over 1 year ago

The `cp -f hwloc/src/.libs/libhwloc_embedded.lib hwloc/src/.libs/libhwloc_embedded.a` line is for Windows, and failure is normal on all other platforms. I should still take care of the error message.

#4 Updated by Sam White over 1 year ago

  • Target version set to 6.9.0

#5 Updated by Sam White over 1 year ago

Merged the following, but ROMIO still doesn't like it: https://charm.cs.illinois.edu/gerrit/#/c/3335/

#6 Updated by Matthias Diener over 1 year ago

The problem appears to be that libhwloc_embedded.a is a 64-bit file, while g++ tries to link to it with the -m32 option.

$ ar x /scratch/autobuild/netlrts-linux/charm/netlrts-linux/bin/../lib/libhwloc_embedded.a
$ file topology.o
topology.o: ELF 64-bit LSB  relocatable, x86-64, version 1 (SYSV), not stripped

I.e., this particular issue is not ROMIO specific.

Running make test in tests fails with the same linker error for all of the tests (not only those that use AMPI or ROMIO).

#7 Updated by Evan Ramos over 1 year ago

The problem originates from this test as part of hwloc's configuration step:

checking size of void *... 8

By adding this line to configure.ac with the rest of the hwloc settings at the bottom, the test determines that sizeof(void *) == 4.

export CFLAGS="-m32"

With this, hwloc compiles as 32-bit and the build command completes, due to this code in hwloc.m4:

AC_MSG_CHECKING([which CPU support to include])
case ${target} in
i*86-*-*|x86_64-*-*|amd64-*-*)
case ${ac_cv_sizeof_void_p} in
4)
AC_DEFINE(HWLOC_X86_32_ARCH, 1, [Define to 1 on x86_32])
hwloc_x86_32=yes
HWLOC_MS_LIB_ARCH=X86
AC_MSG_RESULT([x86_32])
;;
8)
AC_DEFINE(HWLOC_X86_64_ARCH, 1, [Define to 1 on x86_64])
hwloc_x86_64=yes
HWLOC_MS_LIB_ARCH=X64
AC_MSG_RESULT([x86_64])
;;
*)
AC_DEFINE(HWLOC_X86_64_ARCH, 1, [Define to 1 on x86_64])
hwloc_x86_64=yes
HWLOC_MS_LIB_ARCH=X64
AC_MSG_RESULT([unknown -- assuming x86_64])
;;
esac
;;
*)
AC_MSG_RESULT([unknown])
;;
esac

The remaining question is how to add this flag properly in the correct circumstances.

#8 Updated by Matthias Diener over 1 year ago

Is the hwloc configure script honoring CMK_CC and so on? e.g., by running configure like this:

CC=$CMK_CC CFLAGS=$CMK_CFLAGS ./configure [...]

#10 Updated by Evan Ramos over 1 year ago

  • Status changed from New to Merged

#11 Updated by Phil Miller over 1 year ago

There seems to still be a problem of the same sort in the Windows builds, based on autobuild this morning.

Also available in: Atom PDF