Jump to content

How-to use custom ACE and TBB libs without screwing the one already installed on your


Guest fdb_

Recommended Posts

How-to use custom ACE and TBB libs without screwing the one already installed on your system.

>> Unix specific / Only tested on linux <<

Well many peeps have problems compiling MaNGOS with the last ACE or with an another version of TBB libs.

They mostly use an hacky way to dupe the configure tool (homemade links in the /usr/lib etc...), in fact it works but it also screws the system libs and some errors can happen when you update your system.

Moreover if some of the installed binaries need the old versions of the libs you can face some unwanted behaviour of the programs that require those libs.

Here is a way to manage ACE and TBB localy without screwing your system neither modifying it.

Requirements:

  • * working with a non-privileged account (non-root)
    * pkg-config installed

Notes:

  • * This is not a cut & paste How-To

First here is a brief description of the directories used in this guide.

~/src        (main working sources directory, mangos and other libs)
~/opt        (install dir for libs)
~/server    (install dir of the mangos server)

Go in ~/src directory and get all your sources code:

git clone mangos...
wget [url]http://..../ACE.tgz[/url]
wget [url]http://..../tbb.tgz[/url]

ACE Compilation/Installation:

cd ~/src
tar xfz ACE.tgz
cd ACE_wrappers
mkdir objdir && cd objdir
../configure --disable-ace-tests --disable-ace-examples --prefix=~/opt
make
make install

At this time ACE libs are installed in your ~/opt/lib directory and ACE includes are located in ~/opt/includes

The systems lib files stay untouched.

Note: You can also use the same tip for the openssl libs

TBB Compilation:

cd ~/src
tar xfz tbb.tgz
cd tbb_directory
make

Now TBB is fully compiled inside 2 directories, one for the release and the other for the debug use.

The TBB binaries are located in ~/src/tbb/build/linux_?????_release/ or ~/src/tbb/build/linux_?????_release/

Inside the build directories of TBB you can find the tbbvars.sh script, thanks god it will definitively help.

Evironment settings:

Edit your ~/.profile file with your fav editor and add these lines at the end:

export PKG_CONFIG_PATH=$HOME/opt/lib/pkgconfig
export LIBRARY_PATH=$HOME/opt/lib
export LD_LIBRARY_PATH=$HOME/opt/lib
export CPATH=$HOME/opt/include
source $HOME/src/tbb/build/linux_????_release/tbbvars.sh

Notes:

- As it is not a cut & paste how-to you have to change the tbb paths.

- Do not forget to logout and login again to activate these changes (or juste write this command "source ~/.profile")

MaNGOS Compilation/Installation:

cd ~/src/mangos
autoreconf stuff
scriptdev2 stuff
mkdir objdir && cd objdir
../configure --prefix=/home/user/server --sysconfdir=/home/user/server/etc --enable-cli --enable-ra --datadir=/home/user/server/data --disable-builtin-ace
make -jNBCORE

Note: Sometime you can face a linking error at the end of the compilation, it is often due to the existing mangos libs in the install dir. The solution is to move or delete the existing libs located in /home/user/server/lib.

Note: I had some problems during the installation, the make install target did not create the lib sub directory inside the install dir, the easiest way to avoid this issue is to manually create it.

mkdir -p /home/user/server/lib && make install

Now you should have your newly compiled MaNGOS with the local ACE and TBB libs.

Note for those who use a restarter inside a screen, do not forget to source the .profile file or the mangos binaries will have some problems finding the local libs.

Link to comment
Share on other sites

  • 4 weeks later...

Hello, I've this error on the compilation. The mangos sources are okay because it's functioning in another server.

Do you have an idea to resolve this issue ?

Master.o: In function `ACE_Acceptor<RASocket, ACE_SOCK_Acceptor>::accept_svc_handler(RASocket*)':

Master.cpp:(.text._ZN12ACE_AcceptorI8RASocket17ACE_SOCK_AcceptorE18accept_svc_handlerEPS0_[ACE_Acceptor<RASocket, ACE_SOCK_Acceptor>::accept_svc_handler(RASocket*)]+0x5d): undefined reference to `ACE_SOCK_Acceptor::accept(ACE_SOCK_Stream&, ACE_Addr*, ACE_Time_Value*, bool, bool) const'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Object_Manager::remove_at_exit(void*)':

/usr/include/ace/Object_Manager.inl:38: undefined reference to `ACE_Object_Manager::remove_at_exit_i(void*)'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Object_Manager::at_exit(ACE_Cleanup*, void*, char const*)':

/usr/include/ace/Object_Manager.inl:17: undefined reference to `ACE_Object_Manager::at_exit_i(void*, void (*)(void*, void*), void*, char const*)'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Acceptor<WorldSocket, ACE_SOCK_Acceptor>::accept_svc_handler(WorldSocket*)':

/usr/include/ace/Acceptor.cpp:303: undefined reference to `ACE_SOCK_Acceptor::accept(ACE_SOCK_Stream&, ACE_Addr*, ACE_Time_Value*, bool, bool) const'

../shared/libmangosshared.a(DelayExecutor.o): In function `ACE_Object_Manager::remove_at_exit(void*)':

/usr/include/ace/Object_Manager.inl:38: undefined reference to `ACE_Object_Manager::remove_at_exit_i(void*)'

../shared/libmangosshared.a(DelayExecutor.o): In function `ACE_Object_Manager::at_exit(ACE_Cleanup*, void*, char const*)':

/usr/include/ace/Object_Manager.inl:17: undefined reference to `ACE_Object_Manager::at_exit_i(void*, void (*)(void*, void*), void*, char const*)'

collect2: ld returned 1 exit status

Link to comment
Share on other sites

Hello, I've this error on the compilation. The mangos sources are okay because it's functioning in another server.

Do you have an idea to resolve this issue ?

Master.o: In function `ACE_Acceptor<RASocket, ACE_SOCK_Acceptor>::accept_svc_handler(RASocket*)':

Master.cpp:(.text._ZN12ACE_AcceptorI8RASocket17ACE_SOCK_AcceptorE18accept_svc_handlerEPS0_[ACE_Acceptor<RASocket, ACE_SOCK_Acceptor>::accept_svc_handler(RASocket*)]+0x5d): undefined reference to `ACE_SOCK_Acceptor::accept(ACE_SOCK_Stream&, ACE_Addr*, ACE_Time_Value*, bool, bool) const'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Object_Manager::remove_at_exit(void*)':

/usr/include/ace/Object_Manager.inl:38: undefined reference to `ACE_Object_Manager::remove_at_exit_i(void*)'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Object_Manager::at_exit(ACE_Cleanup*, void*, char const*)':

/usr/include/ace/Object_Manager.inl:17: undefined reference to `ACE_Object_Manager::at_exit_i(void*, void (*)(void*, void*), void*, char const*)'

../game/libmangosgame.a(WorldSocketMgr.o): In function `ACE_Acceptor<WorldSocket, ACE_SOCK_Acceptor>::accept_svc_handler(WorldSocket*)':

/usr/include/ace/Acceptor.cpp:303: undefined reference to `ACE_SOCK_Acceptor::accept(ACE_SOCK_Stream&, ACE_Addr*, ACE_Time_Value*, bool, bool) const'

../shared/libmangosshared.a(DelayExecutor.o): In function `ACE_Object_Manager::remove_at_exit(void*)':

/usr/include/ace/Object_Manager.inl:38: undefined reference to `ACE_Object_Manager::remove_at_exit_i(void*)'

../shared/libmangosshared.a(DelayExecutor.o): In function `ACE_Object_Manager::at_exit(ACE_Cleanup*, void*, char const*)':

/usr/include/ace/Object_Manager.inl:17: undefined reference to `ACE_Object_Manager::at_exit_i(void*, void (*)(void*, void*), void*, char const*)'

collect2: ld returned 1 exit status

Link to comment
Share on other sites

Note: Sometime you can face a linking error at the end of the compilation, it is often due to the existing mangos libs in the install dir. The solution is to move or delete the existing libs located in /home/user/server/lib.

If this not the source of the issue, I have no clues.

Link to comment
Share on other sites

  • 5 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use