Multiple Declaration in utils/boost_idb/path.c

6 posts / 0 new
Last post
heringcheng
heringcheng's picture
Offline
Last seen: 4 years 5 months ago
Joined: Mar 11 2010
Junior Boarder

Posts: 5

Hering Cheng
Multiple Declaration in utils/boost_idb/path.c

I am trying to compile version 1.0.3 on Solaris SPARC using Sun Studio 12 compiler suite (whose C++ compiler is named "CC"), and I am getting the following error:

/bin/sh ../../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I. -I. -I../.. -g0 -O3 -DSKIP_SNMP -library=stlport4 -m64 -mt -xcode=pic32 -errtags=yes -erroff=wvarhidemem,hidevf,hidevfinvb,badargtypel2w,wbadinitl,nullref,temwhileinst,unassigned -errtags=yes -c -o libboost_idb_la-operations.lo `test -f 'operations.cpp' || echo './'`operations.cpp
CC -DHAVE_CONFIG_H -I. -I. -I../.. -g0 -O3 -DSKIP_SNMP -library=stlport4 -m64 -mt -xcode=pic32 -errtags=yes -erroff=wvarhidemem,hidevf,hidevfinvb,badargtypel2w,wbadinitl,nullref,temwhileinst,unassigned -errtags=yes -c operations.cpp -KPIC -DPIC -o .libs/libboost_idb_la-operations.o
"./path.cpp", line 56: Error, multdecl: Multiple declaration for locked.
1 Error(s) detected.
make[3]: *** [libboost_idb_la-operations.lo] Error 1

Looking at the source code, I am unable to see why the compiler thinks "locked" variable has multiple declarations.

I understand that Solaris is not a supported platform, but any help would be appreciated.

davidhill
davidhill's picture
Offline
Last seen: 3 weeks 3 days ago
Joined: Oct 27 2009
Administrator

Posts: 595

david hill
Re:Multiple Declaration in utils/boost_idb/path.c

We do include the boost libraries as part of our package, so it's possibly related our packaged version and the version installed on the Sun machine.

If you are adding a library path with a boost library, try building without it.

heringcheng
heringcheng's picture
Offline
Last seen: 4 years 5 months ago
Joined: Mar 11 2010
Junior Boarder

Posts: 5

Hering Cheng
Re:Multiple Declaration in utils/boost_idb/path.c

Actually, I do not have boost on my server. So my build is using the boost libraries that comes with InfiniDB. Any other suggestion?

If I am to use my own boost library, what do I modify (presumably in configure.ac) so the build process uses it instead of that from InfiniDB? My boost library will be installed in a non-standard location; I don't have admin/root access on my server.

pleblanc
pleblanc's picture
Offline
Last seen: 2 months 5 days ago
Joined: Mar 17 2010
Junior Boarder

Posts: 10

Patrick LeBlanc
Re:Multiple Declaration in utils/boost_idb/path.c

Hi Hering,

That's a pretty strange error you're getting. It seems to be complaining about a name collision between anonymous namespaces in different files. I don't think that should be possible. In fact, that's what anonymous namespaces are for. :blink: My suspicion is that the version of boost we've included just won't build with that compiler.

Unfortunately, even if you got it to compile and link correctly, it's safe to say it wouldn't work right. Some of our code depends on a little-endian CPU, and your SPARC is big-endian.

Sorry about that,
Patrick

heringcheng
heringcheng's picture
Offline
Last seen: 4 years 5 months ago
Joined: Mar 11 2010
Junior Boarder

Posts: 5

Hering Cheng
Re:Multiple Declaration in utils/boost_idb/path.c

Thank you, Patrick.

For my own edification, can you point me to one example in the source code where dependency on byte-ordering exists?

pleblanc
pleblanc's picture
Offline
Last seen: 2 months 5 days ago
Joined: Mar 17 2010
Junior Boarder

Posts: 10

Patrick LeBlanc
Re:Multiple Declaration in utils/boost_idb/path.c

Sure, I just happen to be working on one of those pieces at the moment. Search for "order_swap" in dbcon/joblist/lbidlist.cpp. In the LbidList class we swap the byte order for strings up to 8 chars so that we can use numeric operators < > to compare them instead of string equivalents.

To illustrate, on our little-endian boxes, if you cast a char * containing "louis\0" to a uint64 * then print the hex, you can see it's the numeric equivalent of "\0siuol". On a big-endian machine it would still be "louis".