Building Open Dungeons on Linux

Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 16:44

EDIT: Meant to post this in the forum for install stuff, went one too high, sorry

I've been trying to get this game running for a few days now and I'm having a lot of trouble. I've managed to make varying amounts of progress trying to do it in different ways (e.g. with the normal source download, git master source and git development source using cmake, codeblocks, or given scripts) but I always seem to run into a series of increasingly weird problems and eventually stop because there's just no way I'm doing this right.

You can skip the below bit and jump right to the immediate problem if you wish - below is just a lead up to how I got where I am now.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I'm going to start with the normal source download (the 0.4.9 Linux source from the download page here http://sourceforge.net/projects/opendun ... 20Release/).

So, first I run into this:
CMake Error: The current CMakeCache.txt directory /home/dylan/GameAndInstallStuff/Games/opendungeons/CMakeCache.txt is different than the directory /home/tom/Opendungeons/opendungeons where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt


Well, okay, a little weird but simple enough. But replacing all the "/home/tom/Opendungeons/opendungeons" paths with the appropriate one results in this:

Cannot find source file:

/home/dylan/GameAndInstallStuff/Games/opendungeons/source/AbstractApplicationMode.cpp


Note: there is no AbstractApplicationMode.cpp anywhere within the extracted directory. There *is*, however, a "/home/dylan/GameAndInstallStuff/Games/opendungeons/CMakeFiles/OpenDungeons.bin.dir/source/" directory with an AbstractApplicationMode.cpp.o file. So, I skipped the whole cmake bit entirely since it's already been run and, though it's perhaps not ideal, I just changed the directory in all the configuration files I could find and ran make. That resulted in this:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Current Problem

/home/dylan/GameAndInstallStuff/Games/opendungeons//dependencies/tinygettext/dictionary_manager.cpp:19:29: fatal error: ResourceManager.h: No such file or directory
#include "ResourceManager.h"
^
compilation terminated.
make[2]: *** [CMakeFiles/OpenDungeons.bin.dir/dependencies/tinygettext/dictionary_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenDungeons.bin.dir/all] Error 2
make: *** [all] Error 2


This file doesn't appear to exist anywhere within that directory (I'd note it *does* exist in the git ones, though the problems with those are also angelscript related). Not really sure where to go from here. So - has anyone been able to get this to compile successfully on Linux? I noticed there weren't really a ton of downloads for that version.
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby paul424 » 23 Mar 2014, 20:37

Heh seems my push of my Opendungeons directory tree causes more confusion than good.
The whole thing is intended to start ./Opendungeons.bin , that is to try launching the binary out of the package.
Sure the CMAKE's caches are invalid cause they keep settings from my computer. Further steps depends hard on what you wanna to do with OD . If only play try Windows bundle. You could however try getting to run raw binary exec I included in this package. This would involve heavy debbuging and pasting your OS and librarires configuration .
Use git repo to compile it on your machine , not my tar gz package ( seems I should remove it anyway)
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 20:58

Ahh, that explains a lot. Unfortunately, I already tried that. Here's what I get with the master branch from the git:

In file included from /home/dylan/GameAndInstallStuff/Games/opendungeons-git-master/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.h:14:0,
from /home/dylan/GameAndInstallStuff/Games/opendungeons-git-master/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:1:
/home/dylan/GameAndInstallStuff/Games/opendungeons-git-master/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function ‘void RegisterStdString_Native(asIScriptEngine*)’:
/home/dylan/GameAndInstallStuff/Games/opendungeons-git-master/dependencies/angelscript/angelscript/include/angelscript.h:376:77: error: invalid static_cast from type ‘<unresolved overloaded function type>’ to type ‘bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}’
#define asFUNCTIONPR(f,p,r) asFunctionPtr((void (*)())(static_cast<r (*)p>(f)))
^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git-master/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:433:86: note: in expansion of macro ‘asFUNCTIONPR’
r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(operator ==, (const string &, const string &), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );
^
make[2]: *** [CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenDungeons.bin.dir/all] Error 2
make: *** [all] Error 2


This is after the standard

cmake .
make
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby paul424 » 23 Mar 2014, 21:54

User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 22:02

Done that as well. With

cmake .
make

I get:
FOR LONG PASTES USE CODE TAG NOT QUOTE TAG [PAUL424]
{l Code}: {l Select All Code}
In file included from /usr/include/c++/4.8.2/type_traits:35:0,
                 from /home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:40,
                 from /home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp:2:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from /home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp:2:0:
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h: In function ‘asUINT GetTypeTraits()’:
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:25: error: ‘is_default_constructible’ is not a member of ‘std’
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:56: error: expected primary-expression before ‘>’ token
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                                                        ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:57: error: ‘::value’ has not been declared
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                                                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:69: error: ‘has_trivial_default_constructor’ is not a member of ‘std’
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                                                                     ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:107: error: expected primary-expression before ‘>’ token
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                                                                                                           ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:46:108: error: ‘::value’ has not been declared
  bool hasConstructor =  std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
                                                                                                            ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:23: error: ‘is_destructible’ is not a member of ‘std’
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                       ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:45: error: expected primary-expression before ‘>’ token
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                                             ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:46: error: ‘::value’ has not been declared
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                                              ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:58: error: ‘is_trivially_destructible’ is not a member of ‘std’
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                                                          ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:90: error: expected primary-expression before ‘>’ token
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                                                                                          ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:49:91: error: ‘::value’ has not been declared
  bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
                                                                                           ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:31: error: ‘is_copy_assignable’ is not a member of ‘std’
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                               ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:56: error: expected primary-expression before ‘>’ token
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                                                        ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:57: error: ‘::value’ has not been declared
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                                                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:69: error: ‘has_trivial_copy_assign’ is not a member of ‘std’
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                                                                     ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:99: error: expected primary-expression before ‘>’ token
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                                                                                                   ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:53:100: error: ‘::value’ has not been declared
  bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
                                                                                                    ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:28: error: ‘is_copy_constructible’ is not a member of ‘std’
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                            ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:56: error: expected primary-expression before ‘>’ token
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                                                        ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:57: error: ‘::value’ has not been declared
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                                                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:69: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                                                                     ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:104: error: expected primary-expression before ‘>’ token
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                                                                                                        ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:54:105: error: ‘::value’ has not been declared
  bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
                                                                                                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:55:17: error: ‘is_floating_point’ is not a member of ‘std’
  bool isFloat = std::is_floating_point<T>::value;
                 ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:55:41: error: expected primary-expression before ‘>’ token
  bool isFloat = std::is_floating_point<T>::value;
                                         ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:55:42: error: ‘::value’ has not been declared
  bool isFloat = std::is_floating_point<T>::value;
                                          ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:21: error: ‘is_integral’ is not a member of ‘std’
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                     ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:39: error: expected primary-expression before ‘>’ token
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                       ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:40: error: ‘::value’ has not been declared
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                        ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:51: error: ‘is_pointer’ is not a member of ‘std’
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                   ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:68: error: expected primary-expression before ‘>’ token
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                                    ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:69: error: ‘::value’ has not been declared
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                                     ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:80: error: ‘is_enum’ is not a member of ‘std’
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                                                ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:94: error: expected primary-expression before ‘>’ token
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                                                              ^
/home/dylan/GameAndInstallStuff/Games/opendungeons-git/dependencies/angelscript/add_on/scripthelper/scripthelper.h:56:95: error: ‘::value’ has not been declared
  bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
                                                                                               ^
make[2]: *** [CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenDungeons.bin.dir/all] Error 2
make: *** [all] Error 2[


No idea why this one gives c++11 errors. I can work around those in codeblocks, but then I get a whole bunch of weird errors with more popping up as I fix them, mostly having to do with missing files. Currently I'm up to

||=== Build: Debug in OpenDungeons (compiler: GNU GCC Compiler) ===|
C++/OpenDungeons/dependencies/angelscript/add_on/contextmgr/contextmgr.h|14|fatal error: ../../angelscript/include/angelscript.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


Note that I'd already added several files from the master branch because they weren't found at this point. I gave up here because I'm clearly setting it up wrong if I have to keep going to fetch other code files that weren't in the repository.
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby paul424 » 23 Mar 2014, 22:15

/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

Sorry FAQ states clearly how to set that .
Each compiler has it's C++0x or C++11 flag, for GNU g++ it's :
"g++ --std=c++11"
On CMake, make sure to add that to the CMakeCxxFlags.
Or type bash cmd 'cmake-gui' it opens graphical configurator, unfold the CMake node. And find
the CMakeCxxFlags flag.
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 22:21

I'm fairly certain it's set, but I'll double check.
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby KroArtem » 23 Mar 2014, 22:28

Just my 2 cents:
I'm not sure it's convenient to edit CMakeCache.txt manually so I recommend you to do something like this in CMakeLists.txt:
{l Code}: {l Select All Code}
if(UNIX)
    option(USE_CPP2011 "Activate C++ 2011 mode (GCC only)" OFF)
endif()

and then later in CMakeLists.txt:
{l Code}: {l Select All Code}
if(UNIX)
    if(USE_CPP2011)
        add_definitions("-std=gnu++11")
    endif()
endif()

or c++11 or whatever you think is right. This will add an option to cmakelists and there will be a checkbox for this in case you'll use cmake-gui.
KroArtem
 
Posts: 375
Joined: 26 Aug 2010, 19:04

Re: Building Open Dungeons on Linux

Postby Akien » 23 Mar 2014, 23:05

Hi there, I'm also trying to build OD on Linux, and I run into another issue when building AngelScript.

I didn't know anything about C++11, but I read what was posted here and tried to specify CMAKE_CXX_FLAGS="-std=c++11", but it did not solve the issue. Note that I have no mention of making use of the wrong compiler as Dylan got.

Here is what I get when running cmake (note that I tweaked the FindCEGUI.cmake file so that it finds CEGUI 0.8.3, upstream like to change their paths and sonames every other release it seems):
{l Code}: {l Select All Code}
[akien@cauldron build (master)]$ cmake ..
-- CMake build type is not set, defaulting to 'Release'
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.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
-- Looking for OIS...
-- OIS_PREFIX_PATH changed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for module 'OIS'
--   found OIS, version 1.3.0
-- Found OIS: optimized;/usr/lib64/libOIS.so;debug;/usr/lib64/libOIS.so
-- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- checking for module 'OGRE'
--   found OGRE, version 1.9.0
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib64/libOgreMain.so;debug;/usr/lib64/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib64/libOgrePaging.so;debug;/usr/lib64/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib64/libOgreTerrain.so;debug;/usr/lib64/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib64/libOgreProperty.so;debug;/usr/lib64/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib64/libOgreRTShaderSystem.so;debug;/usr/lib64/libOgreRTShaderSystem.so
-- looking for headers
-- Found CEGUI: /usr/lib64/libCEGUIBase-0.so 
-- /usr/lib64/libCEGUIBase-0.so/usr/lib64/libCEGUIOgreRenderer-0.so
-- Found SFML: /usr/lib64/libsfml-audio.so;/usr/lib64/libsfml-system.so 
-- Found OpenAL: /usr/lib64/libopenal.so 
-- 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 
-- Plugin path rel: /usr/lib64/OGRE

-- Plugin path dbg: /usr/lib64/OGRE

-- Configuring done
-- Generating done
-- Build files have been written to: /home/akien/Mageia/Sandbox/opendungeon/development/build


And make:
{l Code}: {l Select All Code}
[akien@cauldron build (master)]$ LC_ALL=C make
Scanning dependencies of target OpenDungeons.bin
[  0%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_atomic.cpp.o
[  1%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_builder.cpp.o                                                                     
[  2%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_bytecode.cpp.o                                                                     
[  3%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc.cpp.o                                                                     
[  4%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_arm.cpp.o                                                                 
[  5%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_mips.cpp.o                                                               
[  5%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_ppc.cpp.o                                                                 
[  6%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_ppc_64.cpp.o                                                             
[  7%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_sh4.cpp.o                                                                 
[  8%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_x64_gcc.cpp.o                                                             
[  9%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_x64_msvc.cpp.o                                                           
[ 10%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_x64_mingw.cpp.o                                                           
[ 10%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_x86.cpp.o                                                                 
[ 11%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_callfunc_xenon.cpp.o                                                               
[ 12%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_compiler.cpp.o                                                                     
[ 13%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_configgroup.cpp.o                                                                 
[ 14%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_context.cpp.o                                                                     
[ 15%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_datatype.cpp.o                                                                     
[ 15%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_gc.cpp.o                                                                           
[ 16%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_generic.cpp.o                                                                     
[ 17%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_globalproperty.cpp.o                                                               
[ 18%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_memory.cpp.o                                                                       
[ 19%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_module.cpp.o                                                                       
[ 20%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_objecttype.cpp.o                                                                   
[ 21%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_outputbuffer.cpp.o                                                                 
[ 21%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_parser.cpp.o                                                                       
[ 22%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_restore.cpp.o                                                                     
[ 23%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_scriptcode.cpp.o                                                                   
[ 24%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_scriptengine.cpp.o                                                                 
[ 25%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_scriptfunction.cpp.o                                                               
[ 26%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_scriptnode.cpp.o                                                                   
[ 26%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_scriptobject.cpp.o                                                                 
[ 27%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_string.cpp.o                                                                       
[ 28%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_string_util.cpp.o                                                                 
[ 29%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_thread.cpp.o                                                                       
[ 30%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_tokenizer.cpp.o                                                                   
[ 31%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_typeinfo.cpp.o                                                                     
[ 31%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/angelscript/source/as_variablescope.cpp.o                                                               
[ 32%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptarray/scriptarray.cpp.o                                                                     
[ 33%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptbuilder/scriptbuilder.cpp.o                                                                 
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptbuilder/scriptbuilder.cpp: In member function 'int CScriptBuilder::ExcludeCode(int)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptbuilder/scriptbuilder.cpp:585:17: warning: variable 't' set but not used [-Wunused-but-set-variable]
   asETokenClass t = engine->ParseToken(&modifiedScript[pos], modifiedScript.size() - pos, &len);
                 ^
[ 34%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp.o
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp: In function 'void PrintException(asIScriptContext*, bool)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scripthelper/scripthelper.cpp:430:19: warning: unused variable 'engine' [-Wunused-variable]
  asIScriptEngine *engine = ctx->GetEngine();
                   ^
[ 35%] Building CXX object CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp.o
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function 'std::string formatInt(asINT64, const string&, asUINT)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:239:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool leftJustify = options.find("l") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:240:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool padWithZero = options.find("0") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:241:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool alwaysSign  = options.find("+") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:242:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool spaceOnSign = options.find(" ") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:243:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool hexSmall    = options.find("h") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:244:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool hexLarge    = options.find("H") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function 'std::string formatFloat(double, const string&, asUINT, asUINT)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:282:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool leftJustify = options.find("l") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:283:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool padWithZero = options.find("0") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:284:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool alwaysSign  = options.find("+") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:285:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool spaceOnSign = options.find(" ") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:286:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool expSmall    = options.find("e") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:287:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  bool expLarge    = options.find("E") != -1;
                                           ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function 'asINT64 parseInt(const string&, asUINT, asUINT*)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:331:9: warning: value computed is not used [-Wunused-value]
   *end++;
         ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:334:9: warning: value computed is not used [-Wunused-value]
   *end++;
         ^
In file included from /home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.h:14:0,
                 from /home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:1:
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function 'void RegisterStdString_Native(asIScriptEngine*)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/angelscript/include/angelscript.h:376:77: error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}'
 #define asFUNCTIONPR(f,p,r) asFunctionPtr((void (*)())(static_cast<r (*)p>(f)))
                                                                             ^
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp:433:86: note: in expansion of macro 'asFUNCTIONPR'
  r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(operator ==, (const string &, const string &), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );
                                                                                      ^
CMakeFiles/OpenDungeons.bin.dir/build.make:1000: recipe for target 'CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp.o' failed
make[2]: *** [CMakeFiles/OpenDungeons.bin.dir/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp.o] Error 1
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/OpenDungeons.bin.dir/all' failed
make[1]: *** [CMakeFiles/OpenDungeons.bin.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2


Any idea?
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 23:09

I actually just got the dev version to compile...ish...by setting std=c++11. Turns out that it wasn't taking when I set it through the GUI for some reason, so I set it in the text file manually and it worked. Now I'm just having some SFML issues, trying to figure out why. If you're using the master version, try the dev one instead.
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby paul424 » 23 Mar 2014, 23:16

/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/angelscript/include/angelscript.h:376:77: error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}'


For sure it is problem of not setting the C++11 option.,
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Building Open Dungeons on Linux

Postby Akien » 23 Mar 2014, 23:33

Dylan {l Wrote}:I actually just got the dev version to compile...ish...by setting std=c++11. Turns out that it wasn't taking when I set it through the GUI for some reason, so I set it in the text file manually and it worked. Now I'm just having some SFML issues, trying to figure out why. If you're using the master version, try the dev one instead.


Could you tell me what you added precisely so that it works? I've tried with cmake-gui and with manual tweaks in CMakeLists.txt, but I haven't seen a difference yet.
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Dylan » 23 Mar 2014, 23:37

For the dev version I had to go into the CMakeCache.txt file itself and change the "CMAKE_CXX_FLAGS:STRING=" section to "CMAKE_CXX_FLAGS:STRING=-std=c++11". For some reason it doesn't show up in the UI and trying to add it has no effect for me. This *only* worked for the dev version though, no difference in the master branch that I saw.
Dylan
 
Posts: 6
Joined: 23 Mar 2014, 14:31

Re: Building Open Dungeons on Linux

Postby nido » 24 Mar 2014, 00:24

As you both have rightly observed, the current cmakefile is not working well. There are a few problems which we will try to address more clearly soon. It also doesn't help that the development branch requires newer and libraries, incompatible with the old one. Also, after it is compiled, you also need to copy the media files into a media/ directory so opendungeons can find it (also being addressed).

Given the library incompatibilties and slightly better situation in development, I would recommend you check out the development branch. This is also the branch I know best and will describe.

CMake Error: The current CMakeCache.txt directory /home/dylan/GameAndInstallStuff/Games/opendungeons/CMakeCache.txt is different than the directory /home/tom/Opendungeons/opendungeons where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt


I would guess you would have ran cmake; copied it from one user to another, then checked out the source, and tried to run cmake again. Unfortunately, cmake does not like that. Rather then editing the cmakecache.txt file, the right course of action would be to delete it instead and try it again.


Note: there is no AbstractApplicationMode.cpp anywhere within the extracted directory. There *is*, however, a "/home/dylan/GameAndInstallStuff/Games/opendungeons/CMakeFiles/OpenDungeons.bin.dir/source/" directory with an AbstractApplicationMode.cpp.o file


To my best guesses, this file is available in devel and not in master; this also hints that you switched branched and ran cmake again; this .o file would be a leftover from the development compilation environment. (as would be the cmakecache, which now tries to make you compile devel in the master tree, more or less). The 'current problem in this post would also indicate the same. I advice to delete the cmakecache file, or better, clean the whole git directory so you are sure no traces of the old environment are left.


OpenDungeons requires c++11 in order to get compiler. Development has a check for gcc and sets -std=c++11 if it is the compiler used.

Hi there, I'm also trying to build OD on Linux, and I run into another issue when building AngelScript.


{l Code}: {l Select All Code}
RegisterStdString_Native(asIScriptEngine*)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/angelscript/include/angelscript.h:376:77: error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}'
 #define asFUNCTIONPR(f,p,r) asFunctionPtr((void (*)())(static_cast<r (*)p>(f)))
                                                                             ^


Could you check the code? I see that function on line 391. looking around for this problem it seemed it might have to do with a hidden dependency on irricht which angelscript doesn't mention. If you aren't using it, I would also like to recommend you to check out the development branch and clean the tree before compiling.

I'm not sure it's convenient to edit CMakeCache.txt manually so I recommend you to do something like this in

A similar check already exists for gcc. Also I would recommend against using variables as such the USE_CPP2011 you propose if they are to be set in a fixed position, as opposed to beging configurable.


I hope this will help you get on your way. Should it fail, I would like to request you provide your cmakecache.txt file which can give more insight in the differnet configuration options that are present. Good luck in getting it compiled and I would love to hear your progress.

kind regards,
nido media
nido
 
Posts: 57
Joined: 07 Mar 2014, 00:47

Re: Building Open Dungeons on Linux

Postby Akien » 24 Mar 2014, 09:31

nido {l Wrote}:
{l Code}: {l Select All Code}
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/add_on/scriptstdstring/scriptstdstring.cpp: In function 'void RegisterStdString_Native(asIScriptEngine*)':
/home/akien/Mageia/Sandbox/opendungeon/development/dependencies/angelscript/angelscript/include/angelscript.h:376:77: error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}'
 #define asFUNCTIONPR(f,p,r) asFunctionPtr((void (*)())(static_cast<r (*)p>(f)))
                                                                             ^

Could you check the code? I see that function on line 391. looking around for this problem it seemed it might have to do with a hidden dependency on irricht which angelscript doesn't mention. If you aren't using it, I would also like to recommend you to check out the development branch and clean the tree before compiling.

Many thanks nido! Paul and you said it quite a few time already, and I was really convinced I was running the development branch, but it was actually master. I'm not that experienced with git yet, but I'm learning :-)

So, switching to the dev branch, I'm having the same issues as Dylan. As he did, I could circumvent the failed setting of the CMAKE_CXX_FLAGS by editing the CMakeCache.txt.
For the record, running "cmake -DCMAKE_CXX_FLAGS=-std=c++11 .." does the trick too.

Now I'm running into a CEGUI include issue, but that's just because I packaged CEGUI 0.8.3 for Mageia using upstream's default paths, and they really like to break everything (now the includes are in /usr/include/cegui-0/CEGUI for example, and every CEGUI lib is suffixed with -0...)
Edit: I fixed this with this argument for CMake: -DCEGUI_INCLUDE_DIR=/usr/include/cegui-0 and that's exactly what it's meant for :)

For the reference, here is the patch I'm using to have CMake find my CEGUI 0.8.3 and SFML2 libraries:

{l Code}: {l Select All Code}
diff --git a/cmake/modules/FindCEGUI.cmake b/cmake/modules/FindCEGUI.cmake
index bbfbcb8..b23ad38 100644
--- a/cmake/modules/FindCEGUI.cmake
+++ b/cmake/modules/FindCEGUI.cmake
@@ -15,7 +15,7 @@ message(STATUS "looking for headers")
 find_path(CEGUI_INCLUDE_DIR CEGUI.h
     HINTS $ENV{CEGUIDIR}
         ${PC_CEGUI_INCLUDEDIR}
-    PATH_SUFFIXES include/CEGUI CEGUI include cegui/include
+    PATH_SUFFIXES include/CEGUI cegui-0/CEGUI include cegui/include
     PATHS
     ~/Library/Frameworks
     /Library/Frameworks
@@ -29,7 +29,7 @@ find_path(CEGUI_INCLUDE_DIR CEGUI.h
     
#Look for libs
 find_library(CEGUI_LIBRARY
-  CEGUIBase
+  CEGUIBase-0
   HINTS
   $ENV{CEGUIDIR}
   ${PC_CEGUI_LIBDIR}
@@ -45,7 +45,7 @@ find_library(CEGUI_LIBRARY
)

 find_library(CEGUIOGRE_LIBRARY
- CEGUIOgreRenderer
+ CEGUIOgreRenderer-0
  HINTS
  $ENV{CEGUIDIR}
  ${PC_CEGUI_LIBDIR}
diff --git a/cmake/modules/FindSFML.cmake b/cmake/modules/FindSFML.cmake
index 49678b0..d49e7f4 100644
--- a/cmake/modules/FindSFML.cmake
+++ b/cmake/modules/FindSFML.cmake
@@ -61,7 +61,7 @@ if(SFML_STATIC_LIBRARIES)
endif()
   
# deduce the libraries suffix from the options
-set(FIND_SFML_LIB_SUFFIX "")
+set(FIND_SFML_LIB_SUFFIX "-2.1")
if(SFML_STATIC_LIBRARIES)
    set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s")
endif()
@@ -81,7 +81,7 @@ set(FIND_SFML_PATHS
   
# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
-          PATH_SUFFIXES include
+          PATH_SUFFIXES include/SFML2
           PATHS ${FIND_SFML_PATHS})
 
# check the version number


BTW on a clean clone of the repo with a clean checkout of the dev branch, I'm always getting this in git status:
{l Code}: {l Select All Code}
modified: dependencies/angelscript/angelscript/projects/msvc2012/angelscript.sln
modified: dependencies/angelscript/tests/test_feature/projects/msvc9/msvc9.sln

The diff looks like it removes the content to add it back, so I suppose it's some kind of end-of-line issue. It's no big deal but somewhat annoying when I want to produce a git diff :-)
Last edited by Akien on 27 Mar 2014, 12:22, edited 2 times in total.
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Akien » 24 Mar 2014, 09:47

It built!

Now I'm getting an issue when running ./OpenDungeons.bin, and quite an annoying one:

{l Code}: {l Select All Code}
Loading library /lib64/OGRE/RenderSystem_GL
Installing plugin: GL RenderSystem
OpenGL Rendering Subsystem created.
Plugin successfully installed
Loading library /lib64/OGRE/Plugin_CgProgramManager
An internal Ogre3D error ocurred: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /lib64/OGRE/Plugin_CgProgramManager.  System Error: /lib64/OGRE/Plugin_CgProgramManager.so.1.9.0: cannot open shared object file: No such file or directory in DynLib::load at /home/iurt/rpmbuild/BUILD/ogre_src_v1-9-0/OgreMain/src/OgreDynLib.cpp (line 109)
OpenDungeons.bin: /usr/include/OGRE/OgreSingleton.h:91: static T& Ogre::Singleton<T>::getSingleton() [with T = LogManager]: Assertion `msSingleton' failed.
Abandon

It seems OD makes use of OGRE's Plugin_CgProgramManager.so.1.9.0, but in Mageia we don't build this plugin for OGRE. Cg is proprietary software and deprecated, so we even dropped it from the distro. Even if we still had Cg and wanted to build OGRE against cg-devel, we would need to put the whole OGRE package in our nonfree repository, since the core (free software) repository can't require nonfree dependencies.

Is this plugin really used in OD, or is there a way to disable it?
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby paul424 » 24 Mar 2014, 13:34

Naah our Cmake scripts are far from being complete and reliable .
I had to debug just now our script with
make VERBOSE=1
just to link the sfml system and audio libs. ( set the correct g++ -l linker flag) .
Don't know how the escape from CG recipe work .... in prev. Ogre version I was able to do that ... don't see how it works for 1.9 though ... you must find yourself and tell us , so we add that to FAQ .
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Building Open Dungeons on Linux

Postby Akien » 24 Mar 2014, 15:00

paul424 {l Wrote}:Don't know how the escape from CG recipe work .... in prev. Ogre version I was able to do that ... don't see how it works for 1.9 though ... you must find yourself and tell us , so we add that to FAQ .

Commenting out "Plugin=Plugin_CgProgramManager" in plugins.cfg does the trick :)
Since it is a proprietary dependency, maybe it would be wise to have it disabled as the default behaviour? It could maybe switch on/off on build time using a CMake variable (OGRE_WITH_CG or such)?

OD runs fine now :-D
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Bertram » 25 Mar 2014, 10:51

Ah great to hear. :)

About the plugins.cfg file. I didn't check thoroughly but how is it created/copied from on linux?

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Building Open Dungeons on Linux

Postby Akien » 25 Mar 2014, 12:57

Bertram {l Wrote}:About the plugins.cfg file. I didn't check thoroughly but how is it created/copied from on linux?

It seems to come from cmake/plugins/plugins*.cfg.in, see:

{l Code}: {l Select All Code}
[akien@cauldron opendungeons-git (development)]$ ack -il "CgProgramManager"
cmake/modules/FindOGRE.cmake
cmake/config/plugins.cfg.in
cmake/config/plugins_d.cfg.in
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Bertram » 25 Mar 2014, 13:23

Ah, indeed.

Those two files need to be changed:
http://sourceforge.net/p/opendungeons/g ... ins.cfg.in
http://sourceforge.net/p/opendungeons/g ... s_d.cfg.in

I'll do that asap if nobody else does.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Building Open Dungeons on Linux

Postby nido » 26 Mar 2014, 20:17

Akien {l Wrote}:Edit: I fixed this with this argument for CMake: -DCEGUI_INCLUDE_DIR=/usr/include/cegui-0 and that's exactly what it's meant for :)

yay~. Also thank you for giving me an extra excuse to include that path as a custom default path for searching the library.

<code>

Would you mind it if I use parts of this code in my efforts to rebuild the cmakefile? If I am not mistaken, the file you edited is one which is copied from upstream. I could check it out and get back to you about it so you can also report it there if you like.

The diff looks like it removes the content to add it back, so I suppose it's some kind of end-of-line issue. It's no big deal but somewhat annoying when I want to produce a git diff :-)

I experience the same problem. This would be fixed once the dependencies have been put into their own external archive, which is a progress we are working on.
nido
 
Posts: 57
Joined: 07 Mar 2014, 00:47

Re: Building Open Dungeons on Linux

Postby Akien » 26 Mar 2014, 20:51

nido {l Wrote}:
Akien {l Wrote}:Edit: I fixed this with this argument for CMake: -DCEGUI_INCLUDE_DIR=/usr/include/cegui-0 and that's exactly what it's meant for :)

yay~. Also thank you for giving me an extra excuse to include that path as a custom default path for searching the library.


Yes from what I've understood CEGUI decided to change its SONAME and include path once again when changing to 0.8.x. I don't know CEGUI much, but we had 0.7.9 packaged in Mageia, so I took some time to find out how to build 0.8.3 (they moved to cmake and changed quite a few things). I didn't submit my changes to Mageia yet, though, because we only have Super Maryo Chronicles that depends on CEGUI, and it won't build with CEGUI 0.8.x. Hopefully smc's upstream resurrects and ports it before I decide to package OD :-D

nido {l Wrote}:
<code>

Would you mind it if I use parts of this code in my efforts to rebuild the cmakefile? If I am not mistaken, the file you edited is one which is copied from upstream. I could check it out and get back to you about it so you can also report it there if you like.

If you mean my patch to the .cmake files, go on :-) For cegui-0 the new path is the default upstream path, so the fix might be wise.

For SFML2 I would double check though. Looking at Mageia's SFML2 package spec file, it seems we decided to put it there and add the %{version} tag to the libname:
{l Code}: {l Select All Code}
# Make parallel installable with 1.6, pkg-config files are adjusted likewise
# by patch0, so apps properly using pkg-config, won't notice any difference
mkdir %{buildroot}%{_includedir}/SFML2
mv %{buildroot}%{_includedir}/SFML \
 %{buildroot}%{_includedir}/SFML2
pushd %{buildroot}%{_libdir}
for i in libsfml-*.so; do
 mv $i $(echo $i | sed 's/.so/-%{version}.so/')
done
popd


Here is the content of this "patch0":
{l Code}: {l Select All Code}
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-all.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-all.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-all.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-all.pc.in   2013-08-08 18:12:43.197589525 +0200
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-all
 Description: The Simple and Fast Multimedia Library, all modules.
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-audio.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-audio.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-audio.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-audio.pc.in   2013-08-08 18:12:43.198589524 +0200
@@ -1,12 +1,12 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-audio
 Description: The Simple and Fast Multimedia Library, audio module.
 URL: http://www.sfml-dev.org
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Requires: sfml-system
-Libs: -L${libdir} -lsfml-audio
+Libs: -L${libdir} -lsfml-audio-2.1
 Cflags: -I${includedir}
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-graphics.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-graphics.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-graphics.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-graphics.pc.in   2013-08-08 18:12:43.198589524 +0200
@@ -1,12 +1,12 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-graphics
 Description: The Simple and Fast Multimedia Library, graphics module.
 URL: http://www.sfml-dev.org
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Requires: sfml-window
-Libs: -L${libdir} -lsfml-graphics
+Libs: -L${libdir} -lsfml-graphics-2.1
 Cflags: -I${includedir}
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-network.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-network.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-network.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-network.pc.in   2013-08-08 18:12:43.199589522 +0200
@@ -1,12 +1,12 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-network
 Description: The Simple and Fast Multimedia Library, network module.
 URL: http://www.sfml-dev.org
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Requires: sfml-system
-Libs: -L${libdir} -lsfml-network
+Libs: -L${libdir} -lsfml-network-2.1
 Cflags: -I${includedir}
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-system.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-system.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-system.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-system.pc.in   2013-08-08 18:12:43.200589521 +0200
@@ -1,11 +1,11 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-system
 Description: The Simple and Fast Multimedia Library, system module.
 URL: http://www.sfml-dev.org
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
-Libs: -L${libdir} -lsfml-system
+Libs: -L${libdir} -lsfml-system-2.1
 Cflags: -I${includedir}
diff -Naur SFML-2.1.orig/tools/pkg-config/sfml-window.pc.in SFML-2.1.parallel-install/tools/pkg-config/sfml-window.pc.in
--- SFML-2.1.orig/tools/pkg-config/sfml-window.pc.in   2013-07-21 09:30:08.000000000 +0200
+++ SFML-2.1.parallel-install/tools/pkg-config/sfml-window.pc.in   2013-08-08 18:12:43.201589521 +0200
@@ -1,12 +1,12 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
-includedir=${prefix}/include
+includedir=${prefix}/include/SFML2
 
 Name: SFML-window
 Description: The Simple and Fast Multimedia Library, window module.
 URL: http://www.sfml-dev.org
 Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Requires: sfml-system
-Libs: -L${libdir} -lsfml-window
+Libs: -L${libdir} -lsfml-window-2.1
 Cflags: -I${includedir}


So basically my change to the FindSFML.cmake file is a dirty fix, and it would be better to use pkgconfig to locate SFML2, so that every distro can put it wherever they want if they edit the pkgconfig files accordingly.
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Akien » 27 Mar 2014, 12:22

Akien {l Wrote}:So, switching to the dev branch, I'm having the same issues as Dylan. As he did, I could circumvent the failed setting of the CMAKE_CXX_FLAGS by editing the CMakeCache.txt.
For the record, running "cmake -DCMAKE_CXX_FLAGS=-std=c++11 .." does the trick too.


I don't know what's missing in the current CMake setting so that the compilation flag is properly set, but for the record I just found this nice bit of CMake instructions here: http://www.guyrutenberg.com/2014/01/05/ ... -in-cmake/
{l Code}: {l Select All Code}
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
        message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Building Open Dungeons on Linux

Postby Bertram » 27 Mar 2014, 16:26

Hi,

To make the CMAKE_CXX_FLAGS correctly set, on Debian, I had to put the project() statement before the part where that variable is set.
Unfortunately, doing this is breaking some other people cmake invocation, eg: Paul's.

In case it could help.

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Who is online

Users browsing this forum: No registered users and 1 guest