Author Topic: building 3.12.0 from source  (Read 1621 times)

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
building 3.12.0 from source
« on: 24 January 2016, 19:53:43 »
It's strange. I've been building from git with no problem, but now I can't build from megaglest-source-3.12.0.tar.xz

Quote
Cannot find source file:

    /home/andy/src/megaglest-3.12.0/source/shared_lib/sources/libircclient/src/libircclient.c

My system is Debian Jessie x64. I believe I have all the deps installed because I've been building from git for the past few weeks.

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: building 3.12.0 from source
« Reply #1 on: 24 January 2016, 20:07:03 »
I'll post more info.

I downloaded https://github.com/MegaGlest/megaglest-source/releases/download/3.12.0/megaglest-source-3.12.0.tar.xz

After unpacking, I went to mk/linux and ran the script 'build-mg.sh'

This was my output:
Code: [Select]
CPU cores detected: 4
CPU cores to be used: 4
We have detected the following system:
 [ Debian ] [ 8.2 ] [ jessie ] [ x86_64 ]
Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT
Calling cmake with EXTRA_CMAKE_OPTIONS =  -DSTATIC_FontConfig=OFF -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CMAKE_SOURCE_DIR = /home/andy/src/megaglest-3.12.0
-- Build type for this compile will be: RelWithDebInfo
-- Determining version number system type to use:
-- ** Trying 3 part versioning
-- Detected MegaGlest Version is [v3.12.0]
-- Detected GNUC Compiler...
-- *NOTE: Checking for max SSE LEVEL [1]
-- Max SSE desired: [1]
-- Performing Test HAS_SSE3_EXTENSIONS
-- Performing Test HAS_SSE3_EXTENSIONS - Success
-- Performing Test HAS_SSE2_EXTENSIONS
-- Performing Test HAS_SSE2_EXTENSIONS - Success
-- Performing Test HAS_SSE_EXTENSIONS
-- Performing Test HAS_SSE_EXTENSIONS - Success
-- Found SSE extensions, using flags: -msse -mfpmath=sse
-- *NOTE: using SSE for STREFLOP.
-- Performing Test HAS_GCC_BACKTRACE
-- Performing Test HAS_GCC_BACKTRACE - Success
-- Found GCC backtrace lib, will support backtraces
-- Found Git: /usr/bin/git (found version "2.1.4")
-- *NOTE: NOT USING a Custom Data Install Path...
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -O2 -g -DNDEBUG -g -O3 
-- **Found game source code.
-- Will try to build MegaGlest shared library
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.1k")
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.38.0")
-- CURL RET = 0 libs: [/usr/lib/x86_64-linux-gnu/libcurl.a -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -lidn -lrtmp -lssh2 -lnettle -lgnutls -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z,relro -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -llber -llber -lldap -lz]
-- #2 CURL RET = 0, using CURL static libs
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread 
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so 
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so 
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.2.3")
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.50")
-- FONTCONFIG was not found. Make sure FONTCONFIG_LIBRARY and FONTCONFIG_INCLUDE_DIR are set.
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.5.2")
-- Found FTGL libraries at /usr/lib/x86_64-linux-gnu/libftgl.so and includes at /usr/include
-- **NOTE: FTGL font support was detected and enabled.
-- Found GLEW: /usr/include 
-- GLEW_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for module 'libvlc'
--   found libvlc, version 2.2.1
-- Found LibVLC include-dir path: [/usr/include]
-- Found LibVLC library path: [/usr/lib/libvlc.so]
-- Found LibVLCcore library path: [LIBVLCCORE_LIBRARY-NOTFOUND]
-- LIBVLC version: 2.2.1
-- **WARNING: LIBVLC NOT found so videos are NOT supported.
-- ** Searching for library: FriBiDi...
-- checking for one of the modules 'glib-2.0'
-- Found GLib2: glib-2.0 /usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Looking for fribidi_utf8_to_unicode in fribidi
-- Looking for fribidi_utf8_to_unicode in fribidi - found
-- Looking for fribidi_charset_to_unicode in fribidi
-- Looking for fribidi_charset_to_unicode in fribidi - found
-- Using FriBiDi: /usr/lib/x86_64-linux-gnu/libfribidi.so
-- BREAKPAD_ROOT=/home/andy/src/megaglest-3.12.0/mk/linux/../../google-breakpad/ Operating system: linux
-- BREAKPAD_INCLUDE_DIR=BREAKPAD_INCLUDE_DIR-NOTFOUND
-- ** WARNING: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.
-- Looking for miniupnpc...
-- Found MINIUPNP: /usr/lib/x86_64-linux-gnu/libminiupnpc.a 
-- Found the miniupnpc headers at /usr/include/miniupnpc
-- Performing Test MINIUPNPC_VERSION_1_7_OR_HIGHER
-- Performing Test MINIUPNPC_VERSION_1_7_OR_HIGHER - Success
-- Found miniupnpc version is v1.7 or higher
-- *** Using miniupnpc lib found in [/usr/include/miniupnpc] MINIUPNP_FOUND [TRUE] MINIUPNP_LIBRARY [/usr/lib/x86_64-linux-gnu/libminiupnpc.a]
-- **No macros required for miniupnpc version
-- *** Using EMBEDDED libircclient because it was forced by option
-- Performing Test HAS_LIBIRCCLIENT_1_6
-- Performing Test HAS_LIBIRCCLIENT_1_6 - Failed
-- EXTERNAL_LIBS = [-Bstatic /usr/lib/x86_64-linux-gnu/libcurl.a -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -lidn -lrtmp -lssh2 -lnettle -lgnutls -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z,relro -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -llber -llber -lldap -lz;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libSM.so;/usr/lib/x86_64-linux-gnu/libICE.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libSM.so;/usr/lib/x86_64-linux-gnu/libICE.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libopenal.so;/usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so;dl;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libftgl.so;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libGLEW.so;/usr/lib/x86_64-linux-gnu/libfribidi.so;glib-2.0;/usr/lib/x86_64-linux-gnu/libminiupnpc.a]
-- Will try to build MegaGlest game
-- OGG/Vorbis includes: /usr/include
-- OGG library        : /usr/lib/x86_64-linux-gnu/libogg.so
-- Vorbis library     : /usr/lib/x86_64-linux-gnu/libvorbis.so
-- Vorbis file library: /usr/lib/x86_64-linux-gnu/libvorbisfile.so
-- CURL RET = 0 libs: [/usr/lib/x86_64-linux-gnu/libcurl.a -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -lidn -lrtmp -lssh2 -lnettle -lgnutls -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z,relro -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -llber -llber -lldap -lz]
-- #2 CURL RET = 0, using CURL static libs
-- GLEW_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found LibVLC include-dir path: [/usr/include]
-- Found LibVLC library path: [/usr/lib/libvlc.so]
-- Found LibVLCcore library path: [LIBVLCCORE_LIBRARY-NOTFOUND]
-- **WARNING: LIBVLC NOT found so videos are NOT supported.
-- ***Note: The final output path for the MegaGlest engine will be [/home/andy/src/megaglest-3.12.0/mk/linux/]
-- BREAKPAD_ROOT=/home/andy/src/megaglest-3.12.0/mk/linux/../../google-breakpad/ Operating system: linux
-- BREAKPAD_INCLUDE_DIR=BREAKPAD_INCLUDE_DIR-NOTFOUND
-- ** WARNING: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.
-- Will try to build MegaGlest map editor
-- Found wxWidgets: TRUE 
--  wxWidgets: /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0;/usr/include/wx-3.0 ;/;  -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu-3.0
-- ***Note: The final output path for MegaGlest Map Editor will be [/home/andy/src/megaglest-3.12.0/mk/linux/]
-- Will try to build MegaGlest model viewer
-- GLEW_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLEW.so
--  wxWidgets: /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0;/usr/include/wx-3.0 ;/;  -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu-3.0
-- ***Note: The final output path for MegaGlest G3d Viewer will be [/home/andy/src/megaglest-3.12.0/mk/linux/]
-- Will try to build MegaGlest model import/export tools
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.1")
-- Will try to build MegaGlest unit tests
-- Found CPPUNIT: /usr/lib/x86_64-linux-gnu/libcppunit.so 
-- ** Searching for library: FriBiDi...
-- Using FriBiDi: /usr/lib/x86_64-linux-gnu/libfribidi.so
-- EXTERNAL_LIBS = [/usr/lib/x86_64-linux-gnu/libcppunit.so;/usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread;/usr/lib/x86_64-linux-gnu/libfribidi.so;glib-2.0]
-- ***Note: The final output path for the MegaGlest engine will be [/home/andy/src/megaglest-3.12.0/mk/linux/]
-- =====> Found Define: CURL_STATICLIB
-- =====> Found Define: STREFLOP_SSE
-- =====> Found Define: HAS_GCC_BACKTRACE
-- Configuring done
CMake Error at source/shared_lib/CMakeLists.txt:447 (ADD_LIBRARY):
  Cannot find source file:

    /home/andy/src/megaglest-3.12.0/source/shared_lib/sources/libircclient/src/libircclient.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

-- Build files have been written to: /home/andy/src/megaglest-3.12.0/mk/linux/build
ERROR: CMAKE failed.

From the Debian repo, I already have libircclient1 and libircclient-dev installed.

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: building 3.12.0 from source
« Reply #2 on: 24 January 2016, 20:13:46 »
When I unpacked https://github.com/MegaGlest/megaglest-source/releases/download/3.12.0/megaglest-source-embedded-3.12.0.tar.xz the files went into the same directory as the first archive. The build is working now.

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: building and installing 3.12.0 from source
« Reply #3 on: 24 January 2016, 20:41:28 »
Please forgive my ignorance, but I don't see clear instructions for installing after building.

I build the package from the source directory, but how to install it to $HOME/local/games ?

And if I want to then copy the data into the installation directory - There is no data package at All available downloads (3.12.0).

For the moment, I've installed 3.12.0 from the installer package, but I think it would be good to have answers to the questions I've asked. Thank you.

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: building 3.12.0 from source
« Reply #4 on: 24 January 2016, 21:32:04 »
hehe not easy questions
well, basically build script is optimized to build in the native git env, when you are downloading megaglest-source-3.12.0.tar.xz (designed for ~distro maintainers) then at the same time you are choosing "the hardest way" :D and ~ you should do compilation by hand "cmake <a lot of parameters which fits to your preferences> ... ; make"

I build the package from the source directory, but how to install it to $HOME/local/games ?
heh even much harder question because e.g. it depends what you want to get on the end and what methods are acceptable for you :)

in general my personal preferences for such private build are related with sequence "cmake <a lot of parameters which fits to your preferences> ... ; make; cpack; 'install'" but this is not related with $HOME area :)
« Last Edit: 24 January 2016, 22:29:26 by filux »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: building 3.12.0 from source
« Reply #5 on: 25 January 2016, 06:00:32 »
Filux is right. The breakdown of different downloads for source is done to satisfy linux distros (like Debian) as I worked closely with Pabs (and others) to design something that works well with their needs.

To build from git, we have our own scripts to make it very easy. To build from source archive requires multiple (and complex) steps because of the fact the each build environment's needs are different.

Thanks

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: building 3.12.0 from source
« Reply #6 on: 25 January 2016, 09:31:28 »
hehe not easy questions
well, basically build script is optimized to build in the native git env, when you are downloading megaglest-source-3.12.0.tar.xz (designed for ~distro maintainers) then at the same time you are choosing "the hardest way" :D and ~ you should do compilation by hand "cmake <a lot of parameters which fits to your preferences> ... ; make"

I build the package from the source directory, but how to install it to $HOME/local/games ?
heh even much harder question because e.g. it depends what you want to get on the end and what methods are acceptable for you :)

in general my personal preferences for such private build are related with sequence "cmake <a lot of parameters which fits to your preferences> ... ; make; cpack; 'install'" but this is not related with $HOME area :)

First, let me paste something from #megaglest

Quote

<andy_5995> As far as installing from a build, perhaps I should have been more clear -
<andy_5995> I am used to using ./configure --prefix=$HOME and then running make install
<andy_5995> I don't know how to do that when building mg
<titi_linux> well its not like that :D
<titi_linux> look at other (big) games, they all cannot be build so easy
<andy_5995> hmmm.. I noticed that actually, the very first time, right before I met you
<andy_5995> I was very surprised at how easily it built
<andy_5995> I thought I was stuck with 3.9 from the Debian repo. But I figured what the hell and downloaded the source and it actually built!
<titi_linux> send those kind words to softcoder and filux, they made most of this build process

What I often do with source packages that include a configure script is ./configure --prefix=$HOME or $HOME/local or some such thing. Sometimes I will install as root ./configure --prefix=/usr --sysconfdir=/etc

I don't have an extensive background in coding, or git, but I believe I understand enough of what  filux and softcoder said to accept their answer. :)

The installer package worked fine for me today, and I'm sure I will be quite happy with it.

Now the geek in me still must ask:

Isn't there a file I can edit (and I do have experience editing source code and Makefiles), that I can hard-code a path that I'd like the game installed to? So the built binaries know where to look for everything?

But perhaps it's not even really an issue if you're using relative paths. After I build, I could just copy what I need to $HOME/local/megaglest-current (for example)?

And then I'd extract the data to the appropriate directories. Simple. :)

I know there may be a little communication barrier here, and I'm often not the best writer, so please forgive me if I'm not being clear.

I will end, or summarize by trying to make my point better. I am fine with everything, but I am mostly curious. :) Also, I was a Slackware user for many years, so am just used to, or familiar with, building from source and then installing (thought I used Slackbuilds a lot which made things very easy).

But everything is working well, and I don't wish for anyone to spend a lot of time trying to answer my questions further. Thank you! :)

Perhaps I should add, for some reason I don't really know, I think running software built on my own system is better than running software built on another system. maybe that is because I "grew up" with Slackware (my first Linux distro).  To be honest, I don't have the knowledge in this area. Perhaps that should have been my first question: Is there much advantage to running software built on one's own system, instead of running software that's been precompiled?


filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: building 3.12.0 from source
« Reply #7 on: 25 January 2016, 19:48:29 »
...
Perhaps that should have been my first question: Is there much advantage to running software built on one's own system, instead of running software that's been precompiled?
Assuming that we are talking about "normal average users", then If precompiled binaries were "produced" on:
- the same OS & version of OS &
- and for the same processor architecture as you have &
- is based on the same libs' versions as you have
then ~ you will not notice any real difference > This describes ~ what you have in most linux distros.
If any from those conditions are not fulfilled then "you are losing something".

... but if you wanna fulfill those conditions yourself then you have to recompile "this binary" very often, e.g. you just updated your OS and with update came new version of libpng and binary is based on this so came recompile time, and again and again and ... in the future  ;D

...
But perhaps it's not even really an issue if you're using relative paths. After I build, I could just copy what I need to $HOME/local/megaglest-current (for example)?

And then I'd extract the data to the appropriate directories. Simple. :) ...
Sure, basically in your case easy way is to get prebuild binary archive + "standalone data" archive then unpack & merge them and put where you want and then just replace binaries (built by using "build script" and with using -d flag) and launch binaries directly (not by scripts) :).

...
<andy_5995> I am used to using ./configure --prefix=$HOME and then running make install
...
What I often do with source packages that include a configure script is ./configure --prefix=$HOME or $HOME/local or some such thing. Sometimes I will install as root ./configure --prefix=/usr --sysconfdir=/etc
...
I was a Slackware user for many years, so am just used to, or familiar with, building from source and then installing (thought I used Slackbuilds a lot which made things very easy).
...
So in the past you used ./configure <a lot of parameters> and now you need to use cmake <a lot of parameters>  :)
This part of guide should tell you most things which you want to know: Building_using_CMake_by_Hand

« Last Edit: 25 January 2016, 20:07:50 by filux »

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 472
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: building 3.12.0 from source
« Reply #8 on: 28 January 2016, 19:22:01 »
filux, I believe you've given me an adequate amount of information to digest, and answered my questions. Thanks!

For right now, I'll stick with the installer, and use this thread for reference if I decide to do more building in the future.