build errors w/ 2.0.1 release (debian lenny i386

9 posts / 0 new
Last post
srand
srand's picture
Offline
Last seen: 3 years 7 months ago
Joined: Dec 21 2009
Junior Boarder

Posts: 11

cyril scetbon
build errors w/ 2.0.1 release (debian lenny i386

Hi,

When I try to build infinidb community 2.0.1 version on a debian lenny i386 host, I get :

make[3]: entrant dans le répertoire « /WOO/DATA/calpont-infinidb-2.0.1/writeengine/bulk »
/bin/sh ../../libtool --tag=CXX --mode=link g++ -g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP -DSKIP_UDF -DSKIP_IDB_COMPRESSION -L/usr/local/Calpont/lib -L/usr/local/lib -lwriteengine -lcacheutils -ldm -ljoblist -lexecplan -ljoiner -lrowgroup -lmulticast -lfuncexp -ldataconvert -lcommon -lbrm -lrwlock -lmessageqcpp -lloggingcpp -lconfigcpp -lboost_idb -lxml2 -lpthread -lrt -loamcpp -lsnmpmanager -Wl,--rpath -Wl,/usr/local/Calpont/lib -o cpimport cpimport-cpimport.o libwe_bulk.a ../xml/libwe_xml.a
g++ -g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP -DSKIP_UDF -DSKIP_IDB_COMPRESSION -Wl,--rpath -Wl,/usr/local/Calpont/lib -o cpimport cpimport-cpimport.o -L/usr/local/Calpont/lib -L/usr/local/lib /usr/local/Calpont/lib/libwriteengine.so /usr/local/Calpont/lib/libcacheutils.so /usr/local/Calpont/lib/libdm.so /usr/local/Calpont/lib/libjoblist.so /usr/local/Calpont/lib/libexecplan.so /usr/local/Calpont/lib/libjoiner.so /usr/local/Calpont/lib/librowgroup.so /usr/local/Calpont/lib/libmulticast.so /usr/local/Calpont/lib/libfuncexp.so /usr/local/Calpont/lib/libdataconvert.so /usr/local/Calpont/lib/libcommon.so /usr/local/Calpont/lib/libbrm.so /usr/local/Calpont/lib/librwlock.so /usr/local/Calpont/lib/libmessageqcpp.so /usr/local/Calpont/lib/libloggingcpp.so /usr/local/Calpont/lib/libconfigcpp.so /usr/local/Calpont/lib/libboost_idb.so /usr/lib/libxml2.so -lpthread -lrt /usr/local/Calpont/lib/liboamcpp.so /usr/local/Calpont/lib/libsnmpmanager.so libwe_bulk.a ../xml/libwe_xml.a
/usr/local/Calpont/lib/libjoblist.so: undefined reference to `__sync_add_and_fetch_8'
/usr/local/Calpont/lib/libjoblist.so: undefined reference to `__sync_sub_and_fetch_8'
collect2: ld returned 1 exit status
make[3]: *** [cpimport] Erreur 1
make[3]: quittant le répertoire « /WOO/DATA/calpont-infinidb-2.0.1/writeengine/bulk »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /WOO/DATA/calpont-infinidb-2.0.1/writeengine »
make[1]: *** [all-local] Erreur 2
make[1]: quittant le répertoire « /WOO/DATA/calpont-infinidb-2.0.1 »
make: *** [all] Erreur 2

I don't find any definition of __sync_sub_and_fetch in source files

any idea ?

davidhill
davidhill's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Oct 27 2009
Administrator

Posts: 561

david hill
Re:build errors w/ 2.0.1 release (debian lenny i38

If you could, could you post the results of this command:

uname -m

Also it might be related to InfiniDB requires at least a Pentium 4 CPU.

You can force the CPU architecture by adding the following line to configure.ac
near the bottom but before AC_CONFIG_FILES:

AC_SUBST([march_flags], [-march=pentium4])

Then run autoreconf, and then run configure again.

David H
Calpont

srand
srand's picture
Offline
Last seen: 3 years 7 months ago
Joined: Dec 21 2009
Junior Boarder

Posts: 11

cyril scetbon
Re:build errors w/ 2.0.1 release (debian lenny i38

Quote:could you post the results of this command:
uname -m

X86_64
However I use a 32 bit OS on a 64 bits processor

Quote:Also it might be related to InfiniDB requires at least a Pentium 4 CPU.

You can force the CPU architecture by adding the following line to configure.ac
near the bottom but before AC_CONFIG_FILES:

AC_SUBST([march_flags], [-march=pentium4])

Then run autoreconf, and then run configure again.

I tried but got the same issue :

g++ -march=pentium4 -g0 -O3 -fno-strict-aliasing -Wall -DSKIP_SNMP -DSKIP_UDF -DSKIP_IDB_COMPRESSION -Wl,--rpath -Wl,/usr/local/Calpont/lib -o cpimport cpimport-cpimport.o -L/usr/local/Calpont/lib -L/usr/local/lib /usr/local/Calpont/lib/libwriteengine.so /usr/local/Calpont/lib/libcacheutils.so /usr/local/Calpont/lib/libdm.so /usr/local/Calpont/lib/libjoblist.so /usr/local/Calpont/lib/libexecplan.so /usr/local/Calpont/lib/libjoiner.so /usr/local/Calpont/lib/librowgroup.so /usr/local/Calpont/lib/libmulticast.so /usr/local/Calpont/lib/libfuncexp.so /usr/local/Calpont/lib/libdataconvert.so /usr/local/Calpont/lib/libcommon.so /usr/local/Calpont/lib/libbrm.so /usr/local/Calpont/lib/librwlock.so /usr/local/Calpont/lib/libmessageqcpp.so /usr/local/Calpont/lib/libloggingcpp.so /usr/local/Calpont/lib/libconfigcpp.so /usr/local/Calpont/lib/libboost_idb.so /usr/lib/libxml2.so -lpthread -lrt /usr/local/Calpont/lib/liboamcpp.so /usr/local/Calpont/lib/libsnmpmanager.so libwe_bulk.a ../xml/libwe_xml.a
/usr/local/Calpont/lib/libjoblist.so: undefined reference to `__sync_add_and_fetch_8'
/usr/local/Calpont/lib/libjoblist.so: undefined reference to `__sync_sub_and_fetch_8'
collect2: ld returned 1 exit status
make: *** [cpimport] Erreur 1

davidhill
davidhill's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Oct 27 2009
Administrator

Posts: 561

david hill
Re:build errors w/ 2.0.1 release (debian lenny i38

I beleive the issue is the use of the 32-bit OS. InfiniDB requires the CPU to support 64-bit atomic operations. It seems that yours does not. Sorry, there is no workaround for this issue.

So it seems that it's just a CPU / OS configuration that we don't support.

David H
Calpont

srand
srand's picture
Offline
Last seen: 3 years 7 months ago
Joined: Dec 21 2009
Junior Boarder

Posts: 11

cyril scetbon
Re:build errors w/ 2.0.1 release (debian lenny i38

Quote:I believe the issue is the use of the 32-bit OS. InfiniDB requires the CPU to support 64-bit atomic operations. It seems that yours does not. Sorry, there is no workaround for this issue.
So it seems that it's just a CPU / OS configuration that we don't support.

Ok thanks. I didn't know that 32bits was not supported. Where can I get this information about the requierements ?

bdempsey
bdempsey's picture
Offline
Last seen: 1 hour 19 min ago
Joined: Oct 27 2009
Platinum Boarder

Posts: 194

Robert Dempsey
Re:build errors w/ 2.0.1 release (debian lenny i38

Some 32-bit CPUs are supported. They must, at a minimum, support atomic operations on long long datatypes. Generally, this means a Pentium 4 or later. The trick is to get GCC to emit the proper machine instructions for your CPU. When you see errors like you have, it means GCC was not able to do so automatically. You can influence GCC's choice with the -march flag. That it was we were attempting to do with previous instructions. If you post the output of "cat /proc/cpuinfo" I can probably tell you if you have any hope at all of compiling InfiniDB.

In any event, there's only so much you can do with a 32-bit address space. You will probably not see very impressive results from InfiniDB unless you have several 64-bit cores, lots of RAM and lots of disk.

srand
srand's picture
Offline
Last seen: 3 years 7 months ago
Joined: Dec 21 2009
Junior Boarder

Posts: 11

cyril scetbon
Re:build errors w/ 2.0.1 release (debian lenny i38

Quote:If you post the output of "cat /proc/cpuinfo" I can probably tell you if you have any hope at all of compiling InfiniDB.

Are you talking about cx8 and cx16 flags ?
here is my /proc/cpuinfo :

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(TM) CPU 2.50GHz
stepping : 8
cpu MHz : 2500.000
cache size : 4096 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc pni monitor ds_cpl vmx cid cx16 xtpr lahf_lm
bogomips : 5016.36
clflush size : 64
cache_alignment : 128
address sizes : 40 bits physical, 48 bits virtual
power management:

I understand for the performance needs. However, we want to install it and juste test queries before doing benchmarks

bdempsey
bdempsey's picture
Offline
Last seen: 1 hour 19 min ago
Joined: Oct 27 2009
Platinum Boarder

Posts: 194

Robert Dempsey
Re:build errors w/ 2.0.1 release (debian lenny i38

Sorry in advance for the long post.

First, it seems like your CPU should support the required 8-byte atomic ops.

Next, let me say that it will be far, far, far easier to tryout InfiniDB by:
Installing 64-bit CentOS 5
Installing the 64-bit InfiniDB RPMs

If you must compile from source, It will be far easier to install 64-bit CentOS 5 first and then try building from source.

And, finally, if you simply must build 32-bit binaries you will have to convince GCC to emit the proper machine code. To determine what that needs to be, use the following program:

#include
long long x;
int main()
{
long long y;
x = 0;
y=__sync_add_and_fetch(&x, 1);
std::cout << y << std::endl;
}

Now, if I try to compile with no march flags on a 32-bit machine (using an older gcc) I get:

$ g++ -g0 -O3 test6.cpp
/tmp/ccrMFBPS.o: In function `main':
test6.cpp:(.text+0xad): undefined reference to `__sync_add_and_fetch_8'
collect2: ld returned 1 exit status

Now I force gcc to think I'm on a P4:

$ g++ -g0 -O3 -march=pentium4 test6.cpp
$ ./a.out
1

So, for this CPU, I need to add -march=pentium4 to the CXXFLAGS. If you look in configure.ac and search for "SKIP" you will find 2 places to add the correct march setting. After making this change you need to run autoreconf and then configure again. Then you need to make it sure it took by looking in a Makefile. Try versioning/BRM/Makefile first and look for march_flags. It should be set to your march setting. If it is, follow the instructions in INSTALL and it should work.

We check our source builds on 64-bit debian lenny before every release. We follow the instructions in INSTALL and it works or we don't release. Except for Windows, 32-bit is simply not a high-priority item for us.

srand
srand's picture
Offline
Last seen: 3 years 7 months ago
Joined: Dec 21 2009
Junior Boarder

Posts: 11

cyril scetbon
Re:build errors w/ 2.0.1 release (debian lenny i38

thanks for all this information :)