Linux – Installing ICU 49 on CentOS

centoslinuxPHP

I'm trying to install ICU 49 on CentOS release 5.8 (Final). The only way I know how to do it is compiling by source.

I do the following:

./runConfigureICU Linux
gmake

And get the following error towards the end of the compile:

make[2]: Leaving directory `/root/icu/icu/source/tools/toolutil'
make[1]: Making `all' in `ctestfw'
make[2]: Entering directory `/root/icu/icu/source/tools/ctestfw'
generating dependency information for ucln_ct.c
generating dependency information for uperf.cpp
generating dependency information for datamap.cpp
generating dependency information for testdata.cpp
generating dependency information for tstdtmod.cpp
generating dependency information for ctest.c
make[2]: Leaving directory `/root/icu/icu/source/tools/ctestfw'
make[2]: Entering directory `/root/icu/icu/source/tools/ctestfw'
gcc -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o ctest.o ctest.c
g++ -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o tstdtmod.o tstdtmod.cpp
g++ -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o testdata.o testdata.cpp
g++ -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o datamap.o datamap.cpp
g++ -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o uperf.o uperf.cpp
gcc -D_REENTRANT   -I../../common -I../../i18n -I./../toolutil -I.   -DU_ATTRIBUTE_DEPRECATED= -DT_CTEST_IMPLEMENTATION -O3 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long   -c -DPIC -fPIC -o ucln_ct.o ucln_ct.c
g++ -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long     -shared -Wl,-Bsymbolic -Wl,-soname -Wl,libicutest.so.49 -o libicutest.so.49.1.2 ctest.o tstdtmod.o testdata.o datamap.o uperf.o ucln_ct.o -L../../lib -licutu -L../../lib -licui18n -L../../lib -licuuc -L../../stubdata -licudata -lpthread -ldl -lm
rm -f libicutest.so.49 && ln -s libicutest.so.49.1.2 libicutest.so.49
rm -f libicutest.so && ln -s libicutest.so.49.1.2 libicutest.so
make[2]: Leaving directory `/root/icu/icu/source/tools/ctestfw'
make[1]: Making `all' in `makeconv'
make[2]: Entering directory `/root/icu/icu/source/tools/makeconv'
generating dependency information for gencnvex.c
generating dependency information for genmbcs.cpp
generating dependency information for ucnvstat.c
generating dependency information for makeconv.c
make[2]: Leaving directory `/root/icu/icu/source/tools/makeconv'
make[2]: Entering directory `/root/icu/icu/source/tools/makeconv'
gcc -D_REENTRANT   -I../../common -I./../toolutil -DU_ATTRIBUTE_DEPRECATED= -O3 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long  -c   -o makeconv.o makeconv.c
gcc -D_REENTRANT   -I../../common -I./../toolutil -DU_ATTRIBUTE_DEPRECATED= -O3 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long  -c   -o ucnvstat.o ucnvstat.c
g++ -D_REENTRANT   -I../../common -I./../toolutil -DU_ATTRIBUTE_DEPRECATED= -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long  -c   -o genmbcs.o genmbcs.cpp
gcc -D_REENTRANT   -I../../common -I./../toolutil -DU_ATTRIBUTE_DEPRECATED= -O3 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long  -c   -o gencnvex.o gencnvex.c
g++ -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   -o ../../bin/makeconv makeconv.o ucnvstat.o genmbcs.o gencnvex.o -L../../lib -licutu -L../../lib -licui18n -L../../lib -licuuc -L../../stubdata -licudata -lpthread -ldl -lm
../../lib/libicuuc.so: undefined reference to `__sync_val_compare_and_swap_4'
../../lib/libicuuc.so: undefined reference to `__sync_add_and_fetch_4'
../../lib/libicuuc.so: undefined reference to `__sync_sub_and_fetch_4'
collect2: ld returned 1 exit status
make[2]: *** [../../bin/makeconv] Error 1
make[2]: Leaving directory `/root/icu/icu/source/tools/makeconv'
make[1]: *** [all-recursive] Error 2
make[1]: Leaving directory `/root/icu/icu/source/tools'
make: *** [all-recursive] Error 2

I've found absolutely nothing on Google to help me. I'm using icu4c-49_1_2-src.tgz from http://site.icu-project.org/download/49

Best Answer

I might be a little late here, but I experienced this exact same problem building ICU 49.1.2 on 32-bit SLES 11 SP2.

After a bit of research and the bug report below, I tried updating my gcc/g++ installation. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40134

Using gcc/g++.46 (after performing a "make clean"), I was able to build the libraries. Obviously, this might be a little late for the OP, but perhaps someone else will benefit.