Custom Compilation/Linking Flags

5 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
Custom Compilation/Linking Flags

Hi,

How do I pass in custom flags to C++ and linker when building InfiniDB? I tried setting and exporting environment variables CXXFLAGS and LDFLAGS, as well as passing "CXXFLAGS=..." on the configure command line, to no avail.

I am trying to get InfiniDB 1.0.3 built on Solaris SPARC using Sun Studio 12. I understand that this is not a platform you currently support.

Thanks.
Hering

davidhill
davidhill's picture
Offline
Last seen: 1 month 4 days ago
Joined: Oct 27 2009
Administrator

Posts: 595

david hill
Re:Custom Compilation/Linking Flags

Thanks for downloading and trying InfiniDB.

For reference, the INSTALL document shows how to pass compiler flags when you run the 'configure' command. Here is an example:

./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

Please let us know how your build and tests go - we'd love to get your feedback

Thanks

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

Posts: 5

Hering Cheng
Re:Custom Compilation/Linking Flags

I did try what you suggested:

...
./configure "CXXFLAGS=-m64 -library=stlport4 -xcode=pic32" "LDFLAGS=-m64 -library=stlport4 -xcode=pic32"
...

And when I run make:

...
make[3]: Entering directory `/nfsdata/taqstore-tr13/chenher/share/infinidb/calpont-infinidb-1.0.3/utils/boost_idb'
source='cregex.cpp' object='libboost_idb_la-cregex.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
/bin/bash ../../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I. -I. -I../.. -g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP -c -o libboost_idb_la-cregex.lo `test -f 'cregex.cpp' || echo './'`cregex.cpp
CC -DHAVE_CONFIG_H -I. -I. -I../.. -g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP -c cregex.cpp -KPIC -DPIC -o .libs/libboost_idb_la-cregex.o
...

The last line above shows that the settings have no effect.

As I mentioned in the beginning, I also tried setting those as environment variables. But it doesn't work either.

Any idea?

Thanks.

davidhill
davidhill's picture
Offline
Last seen: 1 month 4 days ago
Joined: Oct 27 2009
Administrator

Posts: 595

david hill
Re:Custom Compilation/Linking Flags

Thanks for your feedback.

We will need to be a little more investigation to see what the problem is.

Thanks, David

bdempsey
bdempsey's picture
Offline
Last seen: 1 month 1 week ago
Joined: Oct 27 2009
Platinum Boarder

Posts: 194

Robert Dempsey
Re:Custom Compilation/Linking Flags

Locate this line in configure.ac:
CXXFLAGS="-g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP"
and add any new flags there.

Then run autoreconf, and configure again.