How to build on linux? [unstable 2.0, CMake]

edited 2015 Aug 9 in Developers
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:
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 1.15 stable release was the last one where we used qmake. Since then, in the master branch, we've switched to CMake (3+).

    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:
    1. Create a build directory outside/next to the source tree.
    2. Run CMake on doomsday/CMakeLists.txt.
    3. Check the CMake configuration options for any customization needs, particularly the *_DIR and DENG_ENABLE_* variables. You should set the installation prefix with the PREFIX variable.
    4. make && make install
  • Hi skyjake.

    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?
  • The .pack files work the same way on all platforms. In the repository, they are folders, however the build scripts will compress them into ZIP archives that still use the .pack extension.

    Did you create a separate build directory and run CMake from there? It should not be trying to overwrite anything the source tree.
  • The build folder is outside of the main source directory. This is the command I am running:

    cmake ../deng-code/doomsday/CMakeLists.txt
  • I deleted the source and got a clean copy and run the following command (part of a script):

    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 2
    

    std::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?
  • "cotire" is a 3rd party helper macro we use to set up precompiled headers and other build streamlining. However, it sometimes seems to have issues with GCC — I should disable it by default when using GCC.

    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.
  • That did the job thanks!

    Out of interest is there a way to remove the 35FPS frame rate limiter?
Sign In or Register to comment.