Thread: [Cppcms-users] ICU lib error in building cppcms 64bit environment
Brought to you by:
artyom-beilis
From: Aris S. <ari...@gm...> - 2010-08-29 09:49:18
|
Hi, I have following errors when running "make" command, after successfully running "cmake .." command. I have 64-bit linux environment and I have build ICU library with --enable-static and without --disable-shared option. root@aris-laptop:/opt/cppcms/build# make Linking CXX shared library libbooster.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/libicuuc.a( utypes.ao): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/libicuuc.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [booster/libbooster.so.0.0.0] Error 1 make[1]: *** [booster/CMakeFiles/booster.dir/all] Error 2 make: *** [all] Error 2 What the meaning of errors above? What should I do? Thanks you, -Aris |
From: Artyom <art...@ya...> - 2010-08-29 10:59:53
|
Hello, 1. I'd recommend using your distribution's ICU rather then custom build one, unless you have very good reasons. CppCMS works and tested with ICU 3.6 and above and should work even with ICU 3.2. 2. From what I can see you are trying to link libicuuc.a into shared object, you can't. You need link shared objects with shared objects. It looks like you had compiled only static version of ICU. Take a look on what you had installed if you find only libicu*.a and not libicu*.so then you need to compile shared version or disable building shared libraries of CppCMS (which is very bad idea). Artyom > >From: Aris Setyawan <ari...@gm...> >To: cpp...@li... >Sent: Sun, August 29, 2010 12:49:12 PM >Subject: [Cppcms-users] ICU lib error in building cppcms 64bit environment > >Hi, > >I have following errors when running "make" command, after successfully running >"cmake .." command. I have 64-bit linux environment and I have build ICU library > >with --enable-static and without --disable-shared option. > > >root@aris-laptop:/opt/cppcms/build# make >Linking CXX shared library libbooster.so >/usr/bin/ld: >/usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/libicuuc.a(utypes.ao): >relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a >shared object; recompile with -fPIC >/usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/libicuuc.a: could not read >symbols: Bad value >collect2: ld returned 1 exit status >make[2]: *** [booster/libbooster.so.0.0.0] Error 1 >make[1]: *** [booster/CMakeFiles/booster.dir/all] Error 2 >make: *** [all] Error 2 > >What the meaning of errors above? What should I do? > >Thanks you, >-Aris > |
From: Aris S. <ari...@gm...> - 2010-08-29 12:49:10
|
Before I install my own ICU, there were ICU library in my "/usr/lib64" folder, but when I run "make" in my "cppcms/buil" folder, there is an error explain that some dynamic library need libicuuc.a (a static library). I have remove all libicu*.a and libicu*.so which I just install in case to repeat that error. They are: root@aris-laptop:/opt/cppcms/build# cmake .. -- Looking for ICU libraries -- ICU Found, building booster locale -- Configuring done -- Generating done -- Build files have been written to: /opt/cppcms/build root@aris-laptop:/opt/cppcms/build# make make[2]: *** No rule to make target `/usr/lib/libicuuc.a', needed by `booster/libbooster.so.0.0.0'. Stop. make[1]: *** [booster/CMakeFiles/booster.dir/all] Error 2 make: *** [all] Error 2 Because of errors above, then I build my own ICU to get static ICU library. I'm new in linux programming and manual compiling. It is not normal when a dynamically library links against static archives, isn't it? What about -fPIC errors? I have ubuntu-amd 64-bit environment. In this link: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3#doc_chap7 , descibed about -fPIC errors and explained that on certain architectures (AMD64 amongst them), shared libraries must be "PIC-enabled". The error produced by "-fPIC errors" is similar to my error. How do you think? Thanks -Aris |
From: Artyom <art...@ya...> - 2010-08-29 19:04:35
|
Few points for Linux newcomer: 1. Stop working as root! It is very bad habit! 2. Install icu using apt-get install libicu-dev and stop compiling it on your own. 3. Remove all files from build directory and run cmake .. and then make again. > Before I install my own ICU, there were ICU library in my "/usr/lib64" > folder, but when I run "make" in my "cppcms/buil" folder, there is an > error explain that some dynamic library need libicuuc.a (a static > library). I have remove all libicu*.a and libicu*.so which I just > install in case to repeat that error. They are: If you really what to build ICU on your own, build the default version without any flags, it would build shared version. > > Because of errors above, then I build my own ICU to get static ICU library. > > I'm new in linux programming and manual compiling. It is not normal > when a dynamically library links against static archives, isn't it? Not, there is not import libraries crap so you link against shared objects directly. But the code, as you mentioned should be compiled with -fPIC - make it position independent - suitable for shared objects, static libraries are usually compiled without this option as expected to be used in static libraries. Artyom P.S.: There should be no problems on 64 bit platform as I develop it mostly on 64bit one :-) |
From: Aris S. <ari...@gm...> - 2010-08-29 20:10:08
|
> Not, there is not import libraries crap so you link against shared > objects directly. But the code, as you mentioned should be compiled > with -fPIC - make it position independent - suitable for shared objects, > static libraries are usually compiled without this option > as expected to be used in static libraries. I have try to pass --with-pic option into "./configure" command and "--with-pic" option wasn't recognized. Then I execute "./configure --help" command to show all acceptable option with "./configure" command, and there is no "--with-pic" option, as explained in some article which show how to use PIC in compilation. How I can compile with -fPIC command? Is it same if I use "--with-pic" option? I use "--with-pic" command because I don't know yet about passing "-fPIC" option. I don't know in which command I must pass it into; in "./configure" or "gcc/g++"? Thanks -Aris |
From: augustin <aug...@ov...> - 2010-08-30 13:13:46
|
On Monday 30 August 2010 03:04:24 am Artyom wrote: > 2. Install icu using > > apt-get install libicu-dev > > and stop compiling it on your own. > > 3. Remove all files from build directory and run cmake .. and then > make again. > Hello Aris, and welcome! Like you, I am using Ubuntu -64bit. Which version of Ubuntu are you using? I had a small problem with the ICU version on Kubuntu 09.10 but Artyom promptly fixed it so that now cppcms compiles cleanly on this platform with a somewhat older ICU version. So, my advice is to follow Artyom's advice above. Check the wiki for the official list of ubuntu packages to install. Completely delete the build/ directory of your cppcms. Make sure you get the latest code from svn. There is one extra step that I had to do once to make sure the compiler knew to get the extra libraries in /usr/share/local. I forgot what it is, but it is in the 'troubleshooting' section in the wiki. Otherwise, you shouldn't have any problem compiling it using the default options. You should start over from scratch. Good luck, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Aris S. <ari...@gm...> - 2010-08-31 03:23:27
|
Hello, I use ubuntu 9.10 64-bit too. Thanks augustin, I plan to work on it this night. -Aris |
From: augustin <aug...@ov...> - 2010-08-31 04:22:41
|
Hi Aris, http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build_troubleshooting The section "Linux Debian and Ubuntu and derivatives" has the list of packages you need. (clean completely your manual ICU installation first). In the same page, note also the section: "My sample application does not find the shared object libcppcms.so when I try to run it." As a newbie, this is the only difficulty I encountered. I had to run ldconfig. Other than that, I don't recall I used any configuration flag. As a newbie compiling such software and libraries, I always try with the defaults first, since most of the time I don't know what the flags are for... ;) Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Aris S. <ari...@gm...> - 2010-09-02 22:52:21
|
Thank's, augustin, artyom; I have passed the "cmake" step using default ubuntu ICU package. But, after running "make" command, I got the following error: ... ... [ 11%] Building CXX object booster/CMakeFiles/booster.dir/lib/locale/src/date_time.cpp.o [ 11%] Building CXX object booster/CMakeFiles/booster.dir/lib/locale/src/format.cpp.o [ 11%] Building CXX object booster/CMakeFiles/booster.dir/lib/locale/src/formatter.cpp.o /opt/cppcms/booster/lib/locale/src/formatter.cpp: In member function ‘virtual std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT> > booster::locale::impl::number_format<CharType>::format(booster::int64_t, size_t&) const’: /opt/cppcms/booster/lib/locale/src/formatter.cpp:65: error: call of overloaded ‘format(booster::int64_t&, icu_4_0::UnicodeString&)’ is ambiguous /usr/include/unicode/numfmt.h:247: note: candidates are: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(double, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:260: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int32_t, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:273: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int64_t, icu_4_0::UnicodeString&) const /opt/cppcms/booster/lib/locale/src/formatter.cpp: In member function ‘virtual std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT> > booster::locale::impl::number_format<CharType>::format(booster::uint64_t, size_t&) const’: /opt/cppcms/booster/lib/locale/src/formatter.cpp:73: error: call of overloaded ‘format(booster::int64_t&, icu_4_0::UnicodeString&)’ is ambiguous /usr/include/unicode/numfmt.h:247: note: candidates are: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(double, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:260: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int32_t, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:273: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int64_t, icu_4_0::UnicodeString&) const /opt/cppcms/booster/lib/locale/src/formatter.cpp: In member function ‘virtual std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT> > booster::locale::impl::number_format<CharType>::format(booster::uint32_t, size_t&) const’: /opt/cppcms/booster/lib/locale/src/formatter.cpp:91: error: call of overloaded ‘format(booster::int64_t&, icu_4_0::UnicodeString&)’ is ambiguous /usr/include/unicode/numfmt.h:247: note: candidates are: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(double, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:260: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int32_t, icu_4_0::UnicodeString&) const /usr/include/unicode/numfmt.h:273: note: icu_4_0::UnicodeString& icu_4_0::NumberFormat::format(int64_t, icu_4_0::UnicodeString&) const make[2]: *** [booster/CMakeFiles/booster.dir/lib/locale/src/formatter.cpp.o] Error 1 make[1]: *** [booster/CMakeFiles/booster.dir/all] Error 2 make: *** [all] Error 2 I use: . 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux . CppCMS version At revision 1395 . Python 2.6.4rc2 . cmake version 2.6-patch 4 . PCRE version 7.8 2008-09-05 . gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 I guess, the errors above about booster::locale conflict with icu_4_0 namespace, so "formater.cpp" can't find the right function (format) in the booster::locale. How I can fix this? |
From: augustin <aug...@ov...> - 2010-09-04 00:54:23
|
Hello Aris, Artyom would be much more competent than me to reply. I simply tried to recompile everything to test, since we have the same system. I deleted my build directory and recompiled the latest from svn: beside a few minor warnings, everything compiled cleanly. Your problem is with ICU again: since you tried to compile it by hand previously, have you deleted all the libraries you installed then? Maybe do: - remove the icu ubuntu package. - do 'updatedb' - 'locate icu' - delete the remaining icu libraries (those you had compiled and installed by hand). - reinstall the ubuntu package. - try make again. Again, I am not the most competent to help you. Most of this stuff is still above my head. But that's the only thing I can think of. Blessings, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Aris S. <ari...@gm...> - 2010-09-04 06:53:58
|
Hi, > Your problem is with ICU again: since you tried to compile it by hand > previously, have you deleted all the libraries you installed then? > Maybe do: > - remove the icu ubuntu package. > - do 'updatedb' > - 'locate icu' > - delete the remaining icu libraries (those you had compiled and installed by > hand). > - reinstall the ubuntu package. > - try make again. I reinstall my ubuntu, :) and install ICU with apt-get. It was the fastest solution, because I think, I had broke my ubuntu with doing all compilation manually, since ubuntu is my secondary operating system, it was okay to reinstall. The result is my PIC error is gone. Thanks for your help. |
From: Aris S. <ari...@gm...> - 2010-09-04 07:45:45
|
My installation is working now. I just remove my build folder, then recreate it and rebuild it. And before this, I update all my ubuntu package to the newest version. |
From: augustin <aug...@ov...> - 2010-09-04 09:39:59
|
On Saturday 04 September 2010 03:45:39 pm Aris Setyawan wrote: > My installation is working now. Good! :) Have fun with cppcms! Blessings, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |