[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bgl-discuss] netcdf compilation on BGL
I realized that the code uses xlf.
# wrote a fake code like
> cat f.f
call ncio_open
end
# compiling by xlf doesn't resolve symbol
> cp /home/walkup/local/netcdf-3.5.1/lib/libnetcdf.a .
> xlf f.f libnetcdf.a
** _main === End of Compilation 1 ===
1501-510 Compilation successful for file f.f.
../libnetcdf.a(ncio.o)(.text+0x1126): In function `px_pgin':
: undefined reference to `errno'
...
...
# link to libnetcdf.a using blrts_xlf instead of xlf
> blrts_xlf f.f libnetcdf.a
compiled!
# strace'ing compiler gave some hints
> strace -f -o st.log blrts_xlf f.f libnetcdf.a
seems it finally links to
/bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/lib/libc.a
>Actually libc for compute node has those symbols.
>
>To make sure,
>
>$ mpicc -Wall a.c && ./a.out
>0
>0x1480fc
>
>[a.c]
>#include <stdio.h>
>#include <errno.h>
>#include <ctype.h>
>int main()
>{
>printf("%d\n",errno);
>printf("%p\n",__ctype_b);
>return 0;
>}
>
>
>
>
>>On Tue, Jul 12, 2005 at 03:14:59PM -0500, Kazutomo Yoshii wrote:
>>
>>
>>
>>
>>>seems to me that this is linking order issue
>>>because error,__ctype**,etc are all libc symbols.
>>>nm /bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/lib/libc.a
>>>
>>>
>>>
>>>
>>[...]
>>
>>
>>
>>
>>>>>../netcdf/ibm_power3/libnetcdf.a(ncio.o)(.text+0x11be): In function
>>>>>`px_pgin':
>>>>>: undefined reference to `errno'
>>>>>../netcdf/ibm_power3/libnetcdf.a(string.o)(.text+0xe): In function
>>>>>`toupper':
>>>>>: undefined reference to `__ctype_toupper'
>>>>>../netcdf/ibm_power3/libnetcdf.a(string.o)(.text+0x4f6): In function
>>>>>`NC_check_name':
>>>>>: undefined reference to `__ctype_b'
>>>>>
>>>>>
>>>>>
>>>>>
>>My memory's a bit hazy, but IIRC, these symbols are no longer defined
>>in newer versions of glibc, having been replaced by locale-aware
>>versions (see, eg,
>>https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86465). Perhaps
>>the netcdf library being linked against
>>(/home/walkup/local/netcdf-3.5.1/lib/libnetcdf.a) was created with an
>>older glibc? In that case, perhaps linking against a netcdf library
>>which was created under the current glibc would work? Don't know if
>>such a library exists offhand.
>>
>>John
>>
>>- --------------------------------------------------------------------
>>To add or remove yourself from this mailing list, use the 'notifyme'
>>command on any BGL machine. To remove: notifyme -n, to add: notifyme -y.
>>
>>
>>
>>
>>
>
>
>
>
--
Kazutomo Yoshii http://www-unix.mcs.anl.gov/~kazutomo/
- --------------------------------------------------------------------
To add or remove yourself from this mailing list, use the 'notifyme'
command on any BGL machine. To remove: notifyme -n, to add: notifyme -y.