Jump to content

Getting the internationalization branch to build on more than one machine


Recommended Posts

EDIT: Use https://github.com/leper/0ad/tree/i18n.

As some people have started trying to build the internationalization branch (patch against the Subversion trunk), Ive not gotten a single report of anyone having successfully built it. In fact, people have reported issues on both Linux and Windows, which worries me.

I would like to keep track of the known issues here, and try to fix them one by one until the internationalization branch not only allows to run the game in any language, but in any machine as well.

These are the known issues:

  • (FIXED) In Windows, ICU must be added to the libraries folder for Windows. IconV, a dependency of ICU, might be required as well.
  • (FIXED) In source/i18n/L10n.cpp, the line #include "precompiled.h" is missing (it appears in every cpp source file).
  • (IN PROGRESS) In Linux, tinygettext is not automatically compiled. When making the program, -ltinygettext cannot be found, I have to run myself build.sh in libraries/source/tinygettext to make it work.
  • In Linux, it is not possible to lauch the game, as it gets core dumped.
  • (IN PROGRESS) In Windows, tinygettext must be built for Windows and binaries must be included.
  • For tinygettext built with a compiler to be compatible with the game being built with a different compiler, we cannot use std::string, but a wrapper as in https://github.com/JoshuaJB/0ad/blob/lobby/source/lobby/glooxwrapper/glooxwrapper.h#L107
  • In Linux, the tinygettext build script does not have execution permissions.
If you are aware of any issue building or running the internationalization branch that is not listed here yet, please let me know. If you succeeded on building and running the internationalization branch, please let me know as well. In both cases, I would really appreciate it if you could provide some details (operating system name and version and build tools mainly). Edited by leper
Link to comment
Share on other sites

The build.sh command can be added to the update_workspaces.sh script. But it doesn't have the right permissions for now (the build.sh file was missing the x permission), and for some reason, that file is also crashing for me. I'll investigate that further.

Edit: it was simple, you need scons as an extra dependency.

Link to comment
Share on other sites

If you succeeded on building and running the internationalization branch, please let me know as well. In both cases, I would really appreciate it if you could provide some details (operating system —name and version— and build tools mainly).

I successfully built it on Ubuntu 12.04 a month ago (not sure if something has changed since then) and wrote an instruction (on Russian) here: https://www.transifex.com/projects/p/0ad/language/ru/discussion/37989/ .

I installed two additional packages: scons and libicu-dev and then followed the regular build instructions: http://trac.wildfiregames.com/wiki/BuildInstructions .

Link to comment
Share on other sites

Hi Gallaecio

I, who was eager to get back to my week of travel, I've just returned.

Feedback to ubuntu (and debian derived ?) :

As fcxSanya recall, we had already seen that to build your branch internationalization on ubuntu 12.04 and 13.04, it was necessary to install "only" scons and libicu-dev.

I have not tested if "only" was still current with the latest version of your GIT, because I just upgrade to 13.10 (GNOME Ubuntu 13.10 x64), and it seems there are changes (failed to build from, but I admit I do not have time to focus).

Thinking does not have a problem, I have unfortunately did it roughly, and do not really remember the order of everything I've experienced, but I think remember that:


When I wanted to make sure that the problems were caused by the very branch of internationalization, I tested with the SVN version = no success. Then asking me if it came from SVN / GIT, Ubuntu 13.10, or ubuntu-GNOME, I ended up installing the version of the official repositories (0ad 0.0.14-3) on ubuntu 13.10 (not tested on Ubuntu-GNOME) and I realized that I was now two additional dependencies needed: fonts-texgyre and tex-common.

Since the installation of these two dependencies, the SVN version (before yesterday), is built well and
starts. I have not tested in game, but it was enough to retest the branch of internationalization, which still does not work.

I have seen something related to "(IN PROGRESS) In Linux, tinygettext is not automatically compiled. When making the program, -ltinygettext cannot be found, I have to run myself build.sh in libraries/source/tinygettext to make it work.", and tested libraries/source/tinygettext/build.sh (one eye only, the second is already gone to sleep), which was not successful, and caused a closure of the remaining eye.

In short, two additional dependencies
for ubuntu 13.10, and still build failure of the last branch of internationalization.

I will try again later in the day (with the command
"2>&1 > mylogfile" given by leper), but any information is welcome.

Edited by Loki72
Link to comment
Share on other sites

  • 2 months later...

Hi guys.

I am trying to build pyrogenesis to check my translations (japanese version of .po files from Transifex) are correct. But it was failed because of linker error. So, let me ask.

I did git clone from https://github.com/leper/0ad.git and also checkout the branch 'i18n'. After struggling, I could compile for codes of branch 'master'. It works fine. I can play this binary.

Then I am doing compile for codes of branch 'i18n' but I get linker error at linking pyrogenesis and test such as:

> ld: '__ZN4L10nD2Ev' in ../../../binaries/system/libengine.a(L10n.o) contains undefined reference for architecture x86_64

Are there any missing libraries which I have to link? I did 'nm -m' for gcc/engine_Release/L10n.o. Yes, there are 118 undefined references but I cannot find what libraries are needed (I guess these must be linked at linking final output (pyrogenesis or test), but It didn't).

My environment is:

  • Mac OSX 10.9, Xcode 5.
  • The command to build which I executed is `CC="clang" CXX="clang++ -stdlib=libstdc++ -v -idirafter /usr/local/opt/icu4c/include" LDFLAGS="-L/usr/local/opt/icu4c/lib" ./build-osx-bundle.sh` in workspaces directory.
  • ld is executed as follows:

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.6.0 -o ../../../binaries/system/pyrogenesis -lcrt1.10.6.o -L/usr/local/opt/icu4c/lib -L../../../binaries/system -L../../../libraries/osx/libjpg/lib -L../../../libraries/osx/libpng/lib -L../../../libraries/osx/zlib/lib -L../../../libraries/source/spidermonkey/lib -L../../../libraries/osx/boost/lib -L../../../libraries/source/cxxtest/lib -L../../../libraries/source/enet/lib -L../../../libraries/osx/libcurl/lib -L../../../libraries/source/tinygettext/lib -L../../../libraries/source/valgrind/lib -L../../../libraries/osx/libogg/lib -L../../../libraries/osx/vorbis/lib -L../../../libraries/source/nvtt/lib -L../../../libraries/source/miniupnpc/lib -L/usr/local/lib -L/Users/masamac/work/cc/0ad/leper/0ad/libraries/osx/libxml2/lib -L/Users/masamac/work/cc/0ad/leper/0ad/libraries/osx/zlib/lib -L/Users/masamac/work/cc/0ad/leper/0ad/libraries/osx/libiconv/lib -L/Users/masamac/work/cc/0ad/leper/0ad/libraries/osx/gloox/lib obj/pyrogenesis_Release/main.o -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -framework OpenGL -framework OpenAL -framework ApplicationServices -framework Cocoa -framework CoreFoundation ../../../binaries/system/libmocks_real.a ../../../binaries/system/libnetwork.a ../../../binaries/system/liblobby.a ../../../binaries/system/libglooxwrapper.a ../../../binaries/system/libsimulation2.a ../../../binaries/system/libscriptinterface.a ../../../binaries/system/libengine.a ../../../binaries/system/libgraphics.a ../../../binaries/system/libatlas.a ../../../binaries/system/libgui.a ../../../binaries/system/liblowlevel.a ../../../binaries/system/libmongoose.a -lmocks_real -ljpeg -lpng15 -lz -lmozjs185-ps-release -lboost_filesystem-mt -lboost_system-mt -lenet -lcurl -ltinygettext -licui18n -licuuc -lvorbis -lvorbisenc -lvorbisfile -logg -lnvcore -lnvmath -lnvimage -lnvtt -lsquish -lminiupnpc -lpthread -lnetwork -llobby -lglooxwrapper -lsimulation2 -lscriptinterface -lengine -lgraphics -latlas -lgui -llowlevel -lmongoose -lSDLmain -lSDL -framework Cocoa -lxml2 -lz -lpthread -liconv -lm -lresolv -lresolv -lz -lgloox -lstdc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a

Link to comment
Share on other sites

You need to build tinygettext (build-osx-libs.sh doesn't do this yet). I also think you are the first one to try building on OS X.

You should install scons and add some code to build-osx-libs.sh to build tinygettext and copy it to the proper place.

Posting all errors would also help a bit.

Link to comment
Share on other sites

I am trying to build pyrogenesis to check my translations (japanese version of .po files from Transifex) are correct.

Using actual Japanese characters? If so, you won't be able to check them because our fonts don't contain them yet.

Then I am doing compile for codes of branch 'i18n' but I get linker error at linking pyrogenesis and test such as:

> ld: '__ZN4L10nD2Ev' in ../../../binaries/system/libengine.a(L10n.o) contains undefined reference for architecture x86_64

Are there any missing libraries which I have to link? I did 'nm -m' for gcc/engine_Release/L10n.o. Yes, there are 118 undefined references but I cannot find what libraries are needed (I guess these must be linked at linking final output (pyrogenesis or test), but It didn't).

As leper said, you definitely need tinygettext, which is bundled in libraries/source/tinygettext. The other dependencies I can think of which may or may not be included on OS X are libicu and iconv. So you need to build tinygettext in the correct location and update the premake script extern_libs4.lua for "macosx", probably using the same paths as for Windows, like we do for other bundled libraries.

I might test it myself on OS X and if I get it working, I will push the changes.

You should install scons and add some code to build-osx-libs.sh to build tinygettext and copy it to the proper place.

Wouldn't cmake work? It has the scripts anyway and I used them for the Windows build. Let's not require yet another build tool just for tinygettext :unsure:
  • Like 1
Link to comment
Share on other sites

Oh, thank you many replys.

Actually, I have already installed scons (maybe it is not used?) and compiled libtinygettext.a by hand (due to CMakeFiles/tinygettext.dir/link.txt with modification and copy it into tinygettext/lib.) before trying to compile of i18n.

'iconv' is expanded in libraries/osx/ and compiled by build script. And I am using icu libraries which is brew installed (by -L/usr/local/opt/icu4c/lib).

Using actual Japanese characters? If so, you won't be able to check them because our fonts don't contain them yet.

I guess this is not related to linker error, but I have also such problem in the next step after building i18n. Thank you.

Link to comment
Share on other sites

Posting all errors would also help a bit.

Uhm... The error is linker error only. So,

ld: '__ZN4L10nD2Ev' in ../../../binaries/system/libengine.a(L10n.o) contains undefined reference for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)make[1]: *** [../../../binaries/system/pyrogenesis] Error 1make: *** [pyrogenesis] Error 2make: *** Waiting for unfinished jobs....

This is all error messages which I got.

Link to comment
Share on other sites

'iconv' is expanded in libraries/osx/ and compiled by build script. And I am using icu libraries which is brew installed (by -L/usr/local/opt/icu4c/lib).

Sounds like you're working with a very confused build environment there, so things are bound to break :) The game is no longer intended to use MacPorts or Homebrew, but in this case you might be OK. I can't really say because it's not a tested or supported configuration anymore (for a lot of reasons).

iconv might exist in libraries/osx, but that doesn't mean tinygettext has to use it, iconv also comes bundled with OS X - and if you have Homebrew installed, some scripts will pick up its libraries too. So unless you modified the tinygettext build scripts or Makefiles to pick up the correct iconv, maybe it's using a different one than you expect. The same goes for ICU, a very basic version comes bundled with OS X, so you would need to modify premake scripts or the Makefiles to use Homebrew's version, which could have its own dependencies in turn.

Of course, it's easy to check what the compiler is doing, by building with "make verbose=1" or passing -v directly to the compiler and closely inspecting the linker invocations.

Uhm... The error is linker error only. So,

ld: '__ZN4L10nD2Ev' in ../../../binaries/system/libengine.a(L10n.o) contains undefined reference for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)make[1]: *** [../../../binaries/system/pyrogenesis] Error 1make: *** [pyrogenesis] Error 2make: *** Waiting for unfinished jobs....
This is all error messages which I got.
__ZN4L10nD2Ev is the mangled symbol name, c++filt will tell you the human readable name. Most likely it's failing at some earlier step, perhaps an unresolved dependency, you should post the entire build log since it's easy to miss something. In fact, if you do, use "make clean && make verbose=1", to get the full verbose output up to the error. You can save it to a file with something like "make verbose=1 > build_output.txt 2>&1"
  • Like 1
Link to comment
Share on other sites

I am trying to build pyrogenesis to check my translations (japanese version of .po files from Transifex) are correct.

Please pull the latest changes from leper's i18n branch. These changes fixed the build for me on OS X Lion. Note: you will need to run build-osx-libs.sh again to build ICU and tinygettext, and update-workspaces.sh as usual when things change :) I haven't tested on Mavericks and it could have its own problems, so let's see how it goes for you.

The game won't run yet, it segfaults, we think it's the tinygettext API using STL types and probably some compiler flags are different. Anyway it looks a lot like the same problem which can be encountered on Windows, until we fix tinygettext.

Link to comment
Share on other sites

Please pull the latest changes from leper's i18n branch. These changes fixed the build for me on OS X Lion.

Thank you very much and I will check it.

By the way, In former experiment of mine (against commit: "Fixed generateLongStringTranslations.py ..." by Gallaecio), on OSX 10.9 (Mavericks), I had compile error on compiling SDL. Because SDL uses deleted API (ref. "Fixed bug 2085 - SDL 1.2.15 fails to build on OSX 10.9 Mavericks – deprecated CGDirectPaletteRef was removed

", http://hg.libsdl.org/SDL/rev/e9466ead70e5). So I guess some patches are needed for SDL to compile on Mavericks (and my W/A for this is using homebrewed-version of SDL. I confirmed that 0ad.app can play (this is not i18n).)

Link to comment
Share on other sites

The game won't run yet, it segfaults, we think it's the tinygettext API using STL types and probably some compiler flags are different. Anyway it looks a lot like the same problem which can be encountered on Windows, until we fix tinygettext.

Sounds like it should be fixed by r14141.

At last, I could get same result (can build, but segv) as historic_buruno. So this is a report of compilation on Mac OSX 10.9 (Marvericks).

Environment

  • EDITED: Source code: the latest commit of i18n ("Fixes tinygettext CMake script. Apparently it was only tested for gli…")
  • OS version: Mac OSX 10.9
  • SYSROOT= "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"
  • CC="clang" CXX="clang++"
  • EDITED: C++ library: libstdc++

Results

Other modified things

  • Boost build
    • specify toolset, etc.
    • (./bootstrap.sh --with-toolset=darwin --with-libraries=filesystem,system,signals --prefix=$INSTALL_DIR && ./b2 toolset=darwin cflags="$CFLAGS" cxxflags="-stdlib=libstdc++ $CPPFLAGS" linkflags="-stdlib=libstdc++ -lc++abi $LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install)
    • maybe, "clang" is also okay at toolset.
    • I guess CPPFLAGS should be CXXFLAG...? :music:
    • without toolset option, boost scripts use gcc/g++ and this cause linker error which is related to boost filesystem on pyrogenesis linking phase (mangling problem?).
  • Premake
    • modified Premake4.lua at premake/build/gmake.macosx as
    • <   CFLAGS    += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=10.4<   CXXFLAGS  += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=10.4<   LDFLAGS   += -Wl,-x -mmacosx-version-min=10.4--->   CFLAGS    += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=$(MIN_OSX_VERSION)>   CXXFLAGS  += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=$(MIN_OSX_VERSION)>   LDFLAGS   += -Wl,-x -mmacosx-version-min=$(MIN_OSX_VERSION)

BTW, I also whole build with LDFLAGS="-undefined suppress -flat_namespace", this gives me

dyld: lazy symbol binding failed: Symbol not found: __ZN11tinygettext10Dictionary9translateERKSs  Referenced from: /Users/masamac/work/cc/0ad/leper/0ad/build/workspaces/0ad.app/Contents/MacOS/./pyrogenesis  Expected in: flat namespacedyld: Symbol not found: __ZN11tinygettext10Dictionary9translateERKSs  Referenced from: /Users/masamac/work/cc/0ad/leper/0ad/build/workspaces/0ad.app/Contents/MacOS/./pyrogenesis  Expected in: flat namespace

on executing pyrogenesis. So, for some reasons "tinygettext::Dictionary::translate(std::string const&)" cannot see from pyrogenesis.

I also tried otool, install_name_tool -change, and DYLD_LIBRARY_PATH, but they were not working. I don't know why...

Edited by mephisto
Link to comment
Share on other sites

Sounds like it should be fixed by r14141.

As for SDL, I could build it with SDK 10.8 and MIN_OSX_VERSION="10.6" (In this case, liblzma is needed on after phase. my W/A for this is using homebrewed one (xz)).

With SDK 10.9 and MIN_OSX_VERSION="10.6", I couldn't compile it, as I told previously.

So I guess using SDK 10.8 is better solution to build on Mavericks.

Link to comment
Share on other sites

As for SDL, I could build it with SDK 10.8 and MIN_OSX_VERSION="10.6" (In this case, liblzma is needed on after phase. my W/A for this is using homebrewed one (xz)).

With SDK 10.9 and MIN_OSX_VERSION="10.6", I couldn't compile it, as I told previously.

So I guess using SDK 10.8 is better solution to build on Mavericks.

I wouldn't try to target 10.6 from Mavericks, there are a lot of problems, even if you fix the build, it may not run stably. You should either leave MIN_OSX_VERSION unset or make it 10.8+. It doesn't matter unless you're trying to run the same executable on an older version of OS X.
Link to comment
Share on other sites

  • 2 weeks later...
Hi,


I would take the French translation with my new PC, but I still can not successfully build (since November 2013).


I think follow the correct process "Debian (7 or later) / Ubuntu (12.04 or later)", adapted to the internationalization:



sudo apt-get install build-essential libboost-dev libboost-filesystem-dev \

libboost-signals-dev libcurl4-gnutls-dev libenet-dev libgloox-dev \

libjpeg-dev libminiupnpc-dev libmozjs185-dev libnvtt-dev libogg-dev \

libopenal-dev libpng-dev libsdl-dev libvorbis-dev libwxgtk2.8-dev \

libxcursor-dev libxml2-dev subversion zlib1g-dev


sudo apt-get install git cmake scons libicu-dev





cd /home/loki/0ad/libraries/source/tinygettext/

sudo '/home/loki/0ad/libraries/source/tinygettext/build.sh'



cd ~/0ad/build/workspaces

sudo ./update-workspaces.sh -j4



cd gcc

sudo make -j4






but I finished the make-j4 with the error:


/usr/bin/ld: cannot find -liconv


I hope someone would have an idea, because it is not possible to translate without being able to check the result ... which is very regrettable to approach the alpha 16 :shutup:
Link to comment
Share on other sites

but I finished the make-j4 with the error:
/usr/bin/ld: cannot find -liconv
I hope someone would have an idea, because it is not possible to translate without being able to check the result ... which is very regrettable to approach the alpha 16 :shutup:

Do you have "libiconv" in your new PC? If not, I guess you should install it (by apt-get or something).

Link to comment
Share on other sites

Do you have "libiconv" in your new PC? If not, I guess you should install it (by apt-get or something).

Only packets like "libiconv" on Ubuntus are: "libiconv-hook1" and "libiconv-hook-dev" what I have not installed because it does not seem to be what I want. I have /usr/bin/iconv, but it may not be enough ...

I'll try to reinstall https://www.gnu.org/software/libiconv/, which did not work yesterday

Please, never use sudo when compiling something.

I'll try without sudo, but from memory I had a permission problem.

Thank you, I will come to you after a few tests.

Link to comment
Share on other sites

Hi leper

Installing https://www.gnu.org/software/libiconv/ (I do may be wrong, creates an error that I did not have before on ./update-workspaces.sh-j4)

Otherwise, there are some days I was not able to recover your i18n branch with the only link I found:

$ git clone https://github.com/leper/0ad.git

Can you tell me how to point on the i18n branch ?

Edited by Loki72
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...