Ethan Mallove wrote:
> On Fri, Mar/20/2009 11:06:00AM, Doug Reeder wrote:
>> It looks likesome of the object files that you are trying to link to the
>> malloc.o and malloc-stats.o were compiled as 64 bit objects. Are you using
>> the 32 bit compiler flag for the compile step as well as the link step.
> It looks like I'm in 32-bit mode for the compile:
> libtool: compile: pgcc -DHAVE_CONFIG_H -I. -I../../opal/include -I../../orte/include -I../../ompi/include -I../../opal/mca/paffinity/linux/plpa/src/libplpa -I../.. -D_REENTRANT -O -DNDEBUG -tp=k8-32 -c malloc.c -fpic -DPIC -o .libs/malloc.o
> libtool: compile: pgcc -DHAVE_CONFIG_H -I. -I../../../../opal/include -I../../../../orte/include -I../../../../ompi/include -I../../../../opal/mca/paffinity/linux/plpa/src/libplpa -DMALLOC_DEBUG=0 -D_GNU_SOURCE=1 -DUSE_TSD_DATA_HACK=1 -DMALLOC_HOOKS=1 -I./sysdeps/pthread -I./sysdeps/generic -I../../../.. -D_REENTRANT -O -DNDEBUG -tp=k8-32 -c malloc-stats.c -fpic -DPIC -o .libs/malloc-stats.o
> Can't I ignore those warnings for now? It seems PGI allows me to
> create a working executable, even if I mix "i386" with "i386:x86-64":
> $ pgcc -c -tp=k8-32 bar.c -o bar_32.o
> $ pgcc -tp=k8-64 foo.c bar_32.o -o foo_mix
> /usr/bin/ld: warning: i386 architecture of input file `bar_32.o' is incompatible with i386:x86-64 output
> $ ./foo_mix
What's the output of 'file bar_32.o'?
What's the search path for your linker?
Normally when I see ld errors like that but the program still works, it
means one thing: Both 32-bit and 64-bit versions of the library are in
the ld search path (set in either /etc/ld.so.conf, or LD_LIBRARY_PATH)
and the wrong version is found earlier in the path than the correct
version. ld complains when it finds the wrong version, but finds the
correct version and completes the linking correctly and silently.