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

Name collision with new UTF8 library, pnetcdf 1.6.1 #372

Closed
WardF opened this issue Feb 28, 2017 · 5 comments
Closed

Name collision with new UTF8 library, pnetcdf 1.6.1 #372

WardF opened this issue Feb 28, 2017 · 5 comments

Comments

@WardF
Copy link
Member

WardF commented Feb 28, 2017

I have not tested this with a newer version of pnetcdf; the latest support is 1.6.1, until we're able to resolve the issues around #319 .

In trying to move our regression testing to newer versions of Ubuntu and the openmpi/mpich libraries, I've encountered a couple issues. The first, we have name collisions between libnetcdf and libpnetcdf, as shown below. These functions are utf8 related and I'm sure come from the adoption of the new utf8 library. I didn't think to check before merging into master, and I will refactor the netcdf functions to avoid this collision in the future. It first arose with netCDF but could have occurred in any application which uses the same open-source utf8 implementation.

@WardF
Copy link
Member Author

WardF commented Feb 28, 2017

[ 20%] Linking C shared library libnetcdf.so
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_errmsg':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:110: multiple definition of `utf8proc_errmsg'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:95: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_iterate':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:133: multiple definition of `utf8proc_iterate'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:115: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_errmsg':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:110: multiple definition of `utf8proc_utf8class'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:(.rodata+0x44600): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_codepoint_valid':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:169: multiple definition of `utf8proc_codepoint_valid'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:161: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_encode_char':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:174: multiple definition of `utf8proc_encode_char'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:165: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_get_property':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:207: multiple definition of `utf8proc_get_property'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:232: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o):(.rodata+0x216c0): multiple definition of `utf8proc_stage1table'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:(.rodata+0x4980): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o):(.rodata+0x160c0): multiple definition of `utf8proc_stage2table'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:(.rodata+0x6b80): first defined here
/usr/bin/ld: Warning: size of symbol `utf8proc_stage2table' changed from 77824 in ../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o to 46592 in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_errmsg':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:110: multiple definition of `utf8proc_properties'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:(.rodata+0x19b80): first defined here
/usr/bin/ld: Warning: size of symbol `utf8proc_properties' changed from 163848 in ../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o to 314608 in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_decompose_char':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:217: multiple definition of `utf8proc_decompose_char'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:398: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_decompose':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:364: multiple definition of `utf8proc_decompose'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:486: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_reencode':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:423: multiple definition of `utf8proc_reencode'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:669: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_iterate':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:156: multiple definition of `utf8proc_combinations'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:(.rodata+0x41ba0): first defined here
/usr/bin/ld: Warning: size of symbol `utf8proc_combinations' changed from 10820 in ../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o to 90000 in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_map':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:540: multiple definition of `utf8proc_map'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:695: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_NFD':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:567: multiple definition of `utf8proc_NFD'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:729: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_NFC':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:574: multiple definition of `utf8proc_NFC'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:736: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_NFKD':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:581: multiple definition of `utf8proc_NFKD'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:743: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o): In function `utf8proc_NFKC':
/home/tester/parallel-netcdf-1.6.1/src/lib/utf8proc.c:588: multiple definition of `utf8proc_NFKC'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:750: first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o):(.rodata+0x238c0): multiple definition of `utf8proc_sequences'
../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o:/home/tester/netcdf-c/libdispatch/utf8proc.c:91: first defined here
/usr/bin/ld: Warning: size of symbol `utf8proc_sequences' changed from 18808 in ../libdispatch/CMakeFiles/dispatch.dir/utf8proc.c.o to 46016 in /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpnetcdf.a(utf8proc.o)
collect2: error: ld returned 1 exit status
liblib/CMakeFiles/netcdf.dir/build.make:302: recipe for target 'liblib/libnetcdf.so.11.4.0' failed
make[2]: *** [liblib/libnetcdf.so.11.4.0] Error 1
CMakeFiles/Makefile2:1533: recipe for target 'liblib/CMakeFiles/netcdf.dir/all' failed
make[1]: *** [liblib/CMakeFiles/netcdf.dir/all] Error 2

@DennisHeimbigner
Copy link
Collaborator

If pnetcdf is using utf8proc, then it needs to upgrade to the same versions we are using
in netcdf. As I mentioned elsewhere, we can make everything in utf8proc.c be static
except the 2 or 3 functions I mentioned. We could rename those functions by prepending
them with e.g. nc_.

@WardF
Copy link
Member Author

WardF commented Feb 28, 2017

That was my thought; I have my hands full tonight but will pretend the relevant functions with nc_ tomorrow before turning back to unravel the issues with #319 on ARM.

@wkliao
Copy link
Contributor

wkliao commented Feb 28, 2017

I found this problem as well.
Starting from PnetCDF 1.8.0, I added the prefix "ncmpi_" to those functions in utf8 related files.
The problem should go away if using 1.8.0 and later.

@WardF
Copy link
Member Author

WardF commented Feb 28, 2017

I was going to drop you a note this morning @wkliao but I'm glad to see you've already addressed this :). Once I get this taken care of I will return to resolving the issues on #319 so that we can finally get that taken care of and start using the latest parallel netcdf! Updating our regression test docker images to the latest Ubuntu has uncovered a handful of issues that needed to be resolved, so it's taken a little bit longer than expected.

@WardF WardF closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants