Jump to content

[11167][Patch] Entirely new build-system for MaNGOS-Core


Auntie Mangos

Recommended Posts

Sometimes I feel like Windows users need help, but that's beyond what MaNGOS Devs can offer ;)

* If you plan build MaNGOS at Windows then for this time prefered use old way with Visual Studio projects in win directory. So nothing really changes in this case.
[1]

Just compile MaNGOS the way you did before cmake. Go to your MaNGOS sources folder and there inside the win folder. Double click mangosdVC80.sln, get a cup of tea. Done.

Regards

Skirnir

[1] http://getmangos.eu/community/post/131661/#p131661

Link to comment
Share on other sites

  • 41 years later...

With this new build-system for the MaNGOS-Core projects master (/mangos/mangos) and one (/mangos/one) you can revolutionize the build-process of your server.

stable - https://github.com/cipherCOM/mangos/tree/cmake

nightly - https://github.com/cipherCOM/mangos/tree/cmake-dev

This project allows you to compile MaNGOS on your platform with your compiler and even your favorite IDE. This implies generation of project files for Visual Studio, Xcode, CodeBlocks, Eclipse CDT4 and KDevelop3 to name a few and therefore gain the full advantages for software development that each of these tools offer.

It all started with the cumbersome ./configure every time i wanted to set up my MaNGOS distribution. On the Unix-side this step is mandatory, really takes forever and the flood of options didn't make it any easier. I also disliked the idea to debug MaNGOS without any interface for GDB like you got one in Xcode (native IDE for Mac OSX). The windows-side clearly has the superior position when you want to do more than simply compile MaNGOS. But now, you even have the possibility on Unix to compile your server with PCH.

To give you an example on how I use CMake to generate a Xcode project for me, look at the following command:

mangosdir> mkdir build
mangosdir> cd build
build> cmake .. -G Xcode -DPREFIX=/opt/mangos-server -DPCH=1

Note: -G defines your generator, the type of IDE you want to use. Go and look for yourself if your IDE is supported http://www.cmake.org/cmake/help/cmake-2-8-docs.html#section_Generators

Of course, you can also use the GUI of CMake. So there is no need to open your terminal to generate the project files. And if I'm honest, I also use the GUI more often. ;)

So give it a try, see if this CMake project can improve your daily working process with MaNGOS and enables you to try your favorite IDE.

But as with every young project everything is still in development. So I would appreciate if you can give me feedback about the system, new feature requests or errors you encounter so I can improve this system furthermore.

And one side note: The branch of this project also includes the needed sources for CMake to build the widely used scripting library and completely integrates it in the build process. So no more divided project files to compile every part of your server.

Thanks for your time and happy building... cC

And thanks to everyone that helped me so far... be it Funkybit, vladimir, DasBlub, Lynx3d, Zor, NoFantasy ... the list goes on!

Link to comment
Share on other sites

Yeah, congratulations!

I'm using this branch for some time now and I'm happy to see it her finally.

Without this branch working with MaNGOS on a Mac OS machine (and Debian also) would have been hell to me since there was no Xcode project bevor.

Hopefully this will make it's way into the official repos and then improve the whole process for everyone.

Nice work and big thanks!!

Link to comment
Share on other sites

  • 3 weeks later...

Hmm, it expected same exactly as for mangos one. one/master differences only in diff path to vmap dir. And this diff not exist for one/zero.

And yes, only limited amount responses here and at ru-mangos prevent apply it at least for unix side use. :(

Ofc, we can do in normal rule for like case: if ppl don't want test as patch they will test as commit in repo ;)

Link to comment
Share on other sites

Testing cmake-master on Ubuntu 64bit with gcc 4.5.1 using make (running "make -j2")

With included ACE and TBB:

[ 20%] Performing build step for 'ACE_Project'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
cd /home/lynx/coding/mangos/dep/ACE_wrappers && /bin/bash /home/lynx/coding/mangos/dep/ACE_wrappers/aux_config/missing --run automake-1.11 --foreign
configure.ac:7284: required file `examples/Makefile.in' not found
configure.ac:7284: required file `examples/APG/Makefile.in' not found
(...)

With external ACE and TBB it doesn't link against tbb-malloc:

Linking CXX executable realmd
../framework/libframework.a(MemoryManagement.cpp.o): In function `operator new(unsigned long)':
MemoryManagement.cpp:(.text+0x5): undefined reference to `scalable_malloc'
(...)

With external ACE and included TBB, it doesn't link against libdl but needs to:

Linking CXX executable mangosd
/usr/bin/ld: ../game/libgame.a(ScriptMgr.cpp.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO //lib64/libdl.so.2 so try adding it to the linker command line

Also configuring with directory like /opt or /usr/local where you don't have write permission as normal user you get

CMake Error at /usr/share/cmake-2.8/Modules/ExternalProject.cmake:504 (file):
file problem creating directory: /opt/mangos-cmake

I'd expect directories to be created at "make install", configuring shouldn't need super user priviledges IMHO

Link to comment
Share on other sites

Testing cmake-master on Ubuntu 64bit with gcc 4.5.1 using make (running "make -j2")

With external ACE and TBB it doesn't link against tbb-malloc:

Linking CXX executable realmd
../framework/libframework.a(MemoryManagement.cpp.o): In function `operator new(unsigned long)':
MemoryManagement.cpp:(.text+0x5): undefined reference to `scalable_malloc'
(...)

With external ACE and included TBB, it doesn't link against libdl but needs to:

Linking CXX executable mangosd
/usr/bin/ld: ../game/libgame.a(ScriptMgr.cpp.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO //lib64/libdl.so.2 so try adding it to the linker command line

Should be solved on branch cmake-dev. Will port it back to the stable cmake and cmake-master after all issues in this thread are cleared.

Link to comment
Share on other sites

  • 2 weeks later...
Testing cmake-master on Ubuntu 64bit with gcc 4.5.1 using make (running "make -j2")

With included ACE and TBB:

[ 20%] Performing build step for 'ACE_Project'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
cd /home/lynx/coding/mangos/dep/ACE_wrappers && /bin/bash /home/lynx/coding/mangos/dep/ACE_wrappers/aux_config/missing --run automake-1.11 --foreign
configure.ac:7284: required file `examples/Makefile.in' not found
configure.ac:7284: required file `examples/APG/Makefile.in' not found
(...)

Should also be fixed, but I don't have a gcc4.5 on my systems so I cannot check this. Like before only cmake-dev has this fixes. Also cmake-master will be deleted, as the cmake branch is exactly the same thanks to the backport of vmap3.

Link to comment
Share on other sites

Hm don't really know how to use it with master now, i can't just merge a mangos one + cmake branch with master...

So will only give feedback for mangos one.

Included ACE now works, but it installs all its stuff (includes, libs, man-pages...) to the install dir on normal "make", not just on "make install".

I think it should only install the lib anyway...also with the default PREFIX being the source root, it litters your sources on build :/

Speaking of prefix, changing install path in interactive mode (cmake -i) doesn't work, it asks you for "CMAKE_INSTALL_PREFIX" but you get caught in an infinite loop when trying to enter any other path until you give up and accept the current setting. Only way to change it is passing it directly with -DPREFIX option. The cmake-gui also only shows CMAKE_INSTALL_PREFIX which keeps jumping back to last setting.

At least it now accepts protected paths like /opt or /usr/local.

Other than that, everything seems to work (PCH, internal and external ACE/TBB)

Link to comment
Share on other sites

With current state sources, don't must be any differences in cmake test results for One/master.

About PREFIX. as cmake noob I from start use PREFIX ^^ so only from you read about CMAKE_INSTALL_PREFIX

I test patch (with last fixes) at FreeBSD and it good work now. I think patch ready for repo in only-for-Unix-by-default mode.

It just missing small cleanup parts for drop now not working anyway (as i understand from ciphercom notes) makefile.am and related remains.

Because use it for windows still have some problems mostly related dev. way work (testing from IDE/etc), hmmm, at least for VS100 by default better preserve current project files. This not prevent ppl from use cmake way project files generation and use.

Link to comment
Share on other sites

Compiled MaNGOS + SD2 with cmake version 2.8.2, gcc (Debian 4.4.5-8) 4.4.5 this cmake command

cmake ../ -DPREFIX=/opt/mangos -DDEBUG=1 -DACE_USE_EXTERNAL=1 -DTBB_USE_EXTERNAL=1

and got a bunch of warnings, like this:

/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'pVictim'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'damage'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'triggeredByAura'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'procSpell'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'procFlag'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'procEx'
/home/skirnir/source/mangos/src/game/Unit.h:1857: warning: unused parameter 'cooldown'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'pVictim'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'damage'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'triggeredByAura'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'procSpell'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'procFlag'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'procEx'
/home/skirnir/source/mangos/src/game/Unit.h:1862: warning: unused parameter 'cooldown'

Full build warnings here (2.7MB [make 2> make.log]): [1]

Regards

Skirnir

[1] http://filebeam.com/7a9a06fca34530c98416044d72620eb4

PS: pasdVN you can't thank developers announcements, must be a FluxBB "feature" ;)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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