How to build on linux? [unstable 2.0, CMake]
Hi,
Originally I used to build this project using the following command line:
qmake-qt4 -r ../doomsday.pro PREFIX=/mnt/games/native_games/doomsday CONFIG+=deng_notools
I have not built it for a while and it appears that the doomsday.pro no longer exists?
I assume that the project has moved away from qmake so I went to the distrib folder and run the following command:
python platform_release.py
This starts configuring as expected but fails with the following problem:
Have I skipped a step? What is the correct procedure for building from source nowadays?
Thanks
Originally I used to build this project using the following command line:
qmake-qt4 -r ../doomsday.pro PREFIX=/mnt/games/native_games/doomsday CONFIG+=deng_notools
I have not built it for a while and it appears that the doomsday.pro no longer exists?
I assume that the project has moved away from qmake so I went to the distrib folder and run the following command:
python platform_release.py
This starts configuring as expected but fails with the following problem:
CMake Error at sdk/libgui/CMakeLists.txt:17 (add_subdirectory):
The source directory
/mnt/games/native_games/games_source/deng-code/doomsday/external/assimp
does not contain a CMakeLists.txt file.
CMake Error at sdk/libgui/CMakeLists.txt:18 (set_property):
set_property could not find TARGET assimp. Perhaps it has not yet been
created.
Have I skipped a step? What is the correct procedure for building from source nowadays?
Thanks
Comments
The platform_release.py script is part of our autobuilder system and probably will not do exactly what you'd like, since it produces a distribution package rather than just doing a build.
Assimp is a Git submodule, so if you are building in a Git repository, you need to git submodule update --init. This will check out the appropriate version of the Assimp library into doomsday/external/assimp.
We haven't updated the wiki with new build instructions yet, since the current stable version is still using the old build mechanism. However, when you have the Assimp sources checked out, it's pretty much a standard CMake build:
Many thanks for your response. The build now gets past the assimp issue but seems to have a new one.
Cmake appears to invoke some python scripts that are expecting some zip files but in linux they appear to be directories?
-- The C compiler identification is GNU 5.1.1 -- The CXX compiler identification is GNU 5.1.1 -- 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 -- Detecting C compile features -- Detecting C compile features - 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 -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring doomsday... -- Install prefix: /usr -- QMake path: /usr/bin/qmake-qt5 -- Qt version: 5.4.2 -- Qt install prefix: /usr/lib64/qt5 -- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.10") -- cotire 1.7.2 loaded. -- Configuring sdk... -- Configuring libcore... -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") -- Revision: build1679-0-g48c60c2 Traceback (most recent call last): File "/mnt/games/native_games/games_source/deng-code/doomsday/build/scripts/buildpackage.py", line 70, in <module> p.build(sys.argv[2]) File "/mnt/games/native_games/games_source/deng-code/doomsday/build/scripts/buildpackage.py", line 29, in build pack = zipfile.ZipFile(outputName, 'w', zipfile.ZIP_DEFLATED) File "/usr/lib64/python2.7/zipfile.py", line 756, in __init__ self.fp = open(file, modeDict[mode]) IOError: [Errno 21] Is a directory: '/mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/net.dengine.stdlib.pack' CMake Error at cmake/Macros.cmake:310 (clean_paths): clean_paths Macro invoked with incorrect arguments for macro named: clean_paths Call Stack (most recent call first): sdk/libcore/CMakeLists.txt:48 (deng_add_package)I get the same issue if I run the autobuild.py in he distrib folder.
Should linux treat the .pack as an extension rather than a folder name?
Did you create a separate build directory and run CMake from there? It should not be trying to overwrite anything the source tree.
cmake ../deng-code/doomsday/CMakeLists.txt
cmake -DCMAKE_INSTALL_PREFIX=$INST_PATH ../doomsday
cmake now functions correctly and a Makefile is created. Now make fails @ 27% with the following errors:
[ 27%] Building CXX precompiled header sdk/libappfw/cotire/libappfw_CXX_prefix.hxx.gch In file included from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../Counted:1:0, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/function.h:24, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../Function:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/process.h:26, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../Process:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/config.h:23, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../Config:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/app.h:34, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/App:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libappfw/src/precompiled.h:57, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.cxx:4, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.hxx:4: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h:240:5: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat] AutoRef() : _ref(nullptr) {} ^ In file included from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../filesys/../Record:1:0, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../filesys/file.h:26, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../File:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/logbuffer.h:24, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../LogBuffer:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/app.h:27, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/App:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libappfw/src/precompiled.h:57, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.cxx:4, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.hxx:4: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../filesys/../data/record.h:403:32: error: ‘std::function’ has not been declared Subrecords subrecords(std::function<bool (Record const &)> filter) const; ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../filesys/../data/record.h:403:40: error: expected ‘,’ or ‘...’ before ‘<’ token Subrecords subrecords(std::function<bool (Record const &)> filter) const; ^ In file included from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../FileSystem:1:0, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/app.h:30, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/App:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libappfw/src/precompiled.h:57, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.cxx:4, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.hxx:4: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../filesys/filesystem.h:184:55: error: ‘std::function’ has not been declared LoopResult forAll(String const &partialPath, std::function<LoopResult (File &)> func); ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../filesys/filesystem.h:184:63: error: expected ‘,’ or ‘...’ before ‘<’ token LoopResult forAll(String const &partialPath, std::function<LoopResult (File &)> func); ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../filesys/filesystem.h:196:34: error: ‘std::function’ has not been declared std::function<LoopResult (File &)> func); ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../filesys/filesystem.h:196:42: error: expected ‘,’ or ‘...’ before ‘<’ token std::function<LoopResult (File &)> func); ^ In file included from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../Counted:1:0, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/function.h:24, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../Function:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/process.h:26, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../Process:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/config.h:23, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../Config:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/app.h:34, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/App:1, from /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libappfw/src/precompiled.h:57, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.cxx:4, from /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.hxx:4: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h:252:31: warning: explicit conversion operators only available with -std=c++11 or -std=gnu++11 explicit operator bool () const { return _ref != nullptr; } ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h: In constructor ‘de::AutoRef<CountedType>::AutoRef()’: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h:240:22: error: ‘nullptr’ was not declared in this scope AutoRef() : _ref(nullptr) {} ^ /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h: In member function ‘de::AutoRef<CountedType>::operator bool() const’: /mnt/games/native_games/games_source/deng-code/doomsday/sdk/libcore/include/de/core/../core/../scriptsys/../scriptsys/../data/counted.h:252:54: error: ‘nullptr’ was not declared in this scope explicit operator bool () const { return _ref != nullptr; } ^ CMake Error at /mnt/games/native_games/games_source/deng-code/doomsday/cmake/cotire.cmake:1682 (message): cotire: error 1 precompiling /mnt/games/native_games/games_source/deng-code/my_build/sdk/libappfw/cotire/libappfw_CXX_prefix.hxx. Call Stack (most recent call first): /mnt/games/native_games/games_source/deng-code/doomsday/cmake/cotire.cmake:3199 (cotire_precompile_prefix_header) sdk/libappfw/CMakeFiles/libappfw.dir/build.make:54: recipe for target 'sdk/libappfw/cotire/libappfw_CXX_prefix.hxx.gch' failed make[2]: *** [sdk/libappfw/cotire/libappfw_CXX_prefix.hxx.gch] Error 1 CMakeFiles/Makefile2:799: recipe for target 'sdk/libappfw/CMakeFiles/libappfw.dir/all' failed make[1]: *** [sdk/libappfw/CMakeFiles/libappfw.dir/all] Error 2 Makefile:136: recipe for target 'all' failed make: *** [all] Error 2std::function errors seem to be because "--std=c++11" is missing? I am not sure but it looks like part of assimp disables this as part of its build process?
I recommend you set DENG_ENABLE_COTIRE to NO.
On Linux, "ccache" is very helpful if you do repeated builds. Doomsday's CMake config will autodetect if you have ccache installed and use it.
Out of interest is there a way to remove the 35FPS frame rate limiter?