Giter VIP home page Giter VIP logo

Comments (12)

cbnolok avatar cbnolok commented on July 19, 2024

Can you give us more informations? Like: on Windows, which version of Visual Studio do you have? Which version of CMake? Are you using the CMake GUI or using it via command line? Are you familiar with CMake or would you like a more detailed "guide" about using it?

from source-x.

joaoescribano avatar joaoescribano commented on July 19, 2024

Thanks for replying so fast.
I'm not that familiar with cmake, but there is no need for a walkthrough or a how to use it, don't worry! :)

I'm trying to know the correct way to compile the source (or even the correct information to make an appveyor automatic compilation for me as I've made to Sphere master source).

I've tried to compile using Visual Studio 2017 on a windows 10 64 bits machine and on Linux using the property described TDM-GCC in the readme file.

What I basically don't understand how to work is this:

Should I call cmake in another folder then "src"?
There is a file where I need to configure something?
Do I need to create a runtime to the compiler?
There is no chance that the repository (like Sphere master source) to have a pre-build project file?

Thanks!

from source-x.

joaoescribano avatar joaoescribano commented on July 19, 2024

I'm right now at ubunut, so here is the output i got:

when i run cmake:

escribano@escribano:~/sources/Source2/src$ cmake .
-- Scanning system for compilers...
-- Toolchain not specified. Detecting the one to use.
-- Toolchain: defaulting to 32 bits compiler.
-- Toolchain: Linux-GNU-32.cmake.
-- Single-target build system (Makefile) detected: generating multiple projects!
-- No target specified: building all the projects (Release, Debug, Nightly).
-- Checking git revision...
-- Git revision 2590
-- Checking git revision hash...
-- Git revision hash 7fca6a402ff10ac0ea3f4c0922796a218a7b176a
-- Generating config.h for LibEV... (may require some time)
-- config.h for LibEV generated
-- Configuring done
-- Generating done
-- Build files have been written to: /home/escribano/sources/Source2/src

escribano@escribano:~/sources/Source2/src$ make
[  0%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CBase.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/spheresvr_nightly.dir/build.make:62: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/spheresvr_nightly.dir/all' failed
make[1]: *** [CMakeFiles/spheresvr_nightly.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error

from source-x.

cbnolok avatar cbnolok commented on July 19, 2024

I think that the problem is that you have a 64 bits gcc package but you're trying to build a 32 bits binary.
If you don't specify a toolchain, our cmake script will pick the 32 bits one as default, but your gcc is capable of compiling only into 64 bits binaries.
From your log:

-- Scanning system for compilers...
-- Toolchain not specified. Detecting the one to use.
-- Toolchain: defaulting to 32 bits compiler.
-- Toolchain: Linux-GNU-32.cmake.

If you want to be able to build both 64 and 32 bits binary you'll need the gcc-multilib package.

I use this build script to build a 64 bits binary on ubuntu (it's placed in a folder with two subfolders, Source2, with the repo, and build_makefiles, with the generated build files):

#!/bin/sh
cd build_makefiles
cmake -DCMAKE_TOOLCHAIN_FILE=`pwd`/../Source2/src/cmake/toolchains/Linux-GNU-64.cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Nightly" --build ./ ../Source2/src
make -j8

As you can see, i specified also the build type. Since a single makefile works only for a single target (unlike VS, where you open a single solution/project file but you can choose if compile a Debug, Nightly or Release build), the cmake script generates a makefile for each build type. If you don't specify the build type, it generates all the 3 makefiles, and doing 'make' compiles three times sphere, one time for each build type, generating 3 different binaries with different names.

-- Single-target build system (Makefile) detected: generating multiple projects!
-- No target specified: building all the projects (Release, Debug, Nightly).

To compile a single target, add this as cmake parameter -DCMAKE_BUILD_TYPE="Nightly", as i did in the sh script.

from source-x.

roberpot avatar roberpot commented on July 19, 2024

/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
#include <bits/c++config.h>

Probably you need the libstdc++-6-dev package to be installed on your system.

from source-x.

cbnolok avatar cbnolok commented on July 19, 2024

Yup or also it's libstdc++ dev package.
Speaking about compilers, TDM-GCC is a windows compiler suite, while on linux you will find only GCC.
As for appveyor/travis-ci, we plan to provide automated builds as soon as we port all the relevant commits from Source to Source2, since we lack some new functionality or bugfix that Source has.

As for the Windows build, in the field "Where is the source code:" i put the Source2 "src" directory and in the field "Where to build the binaries" you can put any folder you want. Then i use the generator "Visual Studio 15 Win64" (i also have VS 2017), and check "Use default native compilers". If this doesn't solve your problem, could you paste here your cmake or vs log?

from source-x.

roberpot avatar roberpot commented on July 19, 2024

And yes, if you are cross compiling to 32 bits, you need that lib on 32 bits too:

sudo dpkg --add-architecture i386
sudo apt-get update
apt-get install libstdc++-6-dev:i386

This works for me, at least in debian.

from source-x.

joaoescribano avatar joaoescribano commented on July 19, 2024

Dudes, thanks so much for the explanations!

So i've added the libraries to my system then tried to compile again using this "bash" from @cbnolok.

I just edited to this (so the file could find my directories):

#!/bin/sh
cd build_makefiles
cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchains/Linux-GNU-64.cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Nightly" --build ./ ../Source2/src
make -j8
(To be true, i don't get why the usage of the 'pwd' before the tollchain folder (it's really needed?)

And here is the output:

escribano@escribano:~/sources/Source2/src$ ./build.sh 
./build.sh: 2: cd: can't cd to build_makefiles
CMake Error: The source directory "/home/escribano/sources/Source2/Source2/src" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
[  0%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o
[  0%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CResourceDef.cpp.o
[  1%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CContainer.cpp.o
[  3%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CResourceCalc.cpp.o
[  3%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CPathFinder.cpp.o
[  4%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CSectorEnviron.cpp.o
[  5%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CSector.cpp.o
In file included from /home/escribano/sources/Source2/src/game/../common/sphere_library/CSArray.h:10:0,
                 from /home/escribano/sources/Source2/src/game/../common/sphere_library/CSAssoc.h:10,
                 from /home/escribano/sources/Source2/src/game/CResourceDef.cpp:3:
/usr/include/c++/7/cstring:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
[  1%] Building CXX object CMakeFiles/spheresvr_nightly.dir/game/CObjBase.cpp.o
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CBase.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
CMakeFiles/spheresvr_nightly.dir/build.make:182: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CResourceDef.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CResourceDef.cpp.o] Error 1
make[2]: ** Esperando que outros processos terminem.
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CSector.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
In file included from /home/escribano/sources/Source2/src/game/../common/sphere_library/CSString.h:14:0,
                 from /home/escribano/sources/Source2/src/game/../common/sphereproto.h:10,
                 from /home/escribano/sources/Source2/src/game/CSectorEnviron.h:10,
                 from /home/escribano/sources/Source2/src/game/CSectorEnviron.cpp:2:
/usr/include/c++/7/cstdarg:42:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
In file included from /home/escribano/sources/Source2/src/game/../common/sphere_library/CSArray.h:10:0,
                 from /home/escribano/sources/Source2/src/game/../common/sphere_library/CSAssoc.h:10,
                 from /home/escribano/sources/Source2/src/game/CServerConfig.h:10,
                 from /home/escribano/sources/Source2/src/game/CResourceCalc.cpp:3:
/usr/include/c++/7/cstring:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CObjBase.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/spheresvr_nightly.dir/build.make:62: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CBase.cpp.o] Error 1
CMakeFiles/spheresvr_nightly.dir/build.make:110: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CObjBase.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CObjBase.cpp.o] Error 1
CMakeFiles/spheresvr_nightly.dir/build.make:206: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CSector.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CSector.cpp.o] Error 1
CMakeFiles/spheresvr_nightly.dir/build.make:158: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CResourceCalc.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CResourceCalc.cpp.o] Error 1
CMakeFiles/spheresvr_nightly.dir/build.make:230: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CSectorEnviron.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CSectorEnviron.cpp.o] Error 1
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CContainer.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/spheresvr_nightly.dir/build.make:86: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CContainer.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CContainer.cpp.o] Error 1
In file included from /home/escribano/sources/Source2/src/game/../common/../common/../common/sphere_library/CSFile.h:9:0,
                 from /home/escribano/sources/Source2/src/game/../common/../common/CLog.h:10,
                 from /home/escribano/sources/Source2/src/game/../common/CException.h:10,
                 from /home/escribano/sources/Source2/src/game/CPathFinder.cpp:2:
/usr/include/c++/7/cstdio:41:10: fatal error: bits/c++config.h: Arquivo ou diretório não encontrado
 #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/spheresvr_nightly.dir/build.make:134: recipe for target 'CMakeFiles/spheresvr_nightly.dir/game/CPathFinder.cpp.o' failed
make[2]: *** [CMakeFiles/spheresvr_nightly.dir/game/CPathFinder.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/spheresvr_nightly.dir/all' failed
make[1]: *** [CMakeFiles/spheresvr_nightly.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2```

from source-x.

joaoescribano avatar joaoescribano commented on July 19, 2024

So reading the output, it seems that the compiler is trying to enter in "Source2/Source2/" folder, which doesn't exist...
I'm at work right now, so I can't fix it now, but ill try to fix it tonight.

Thanks again!

from source-x.

cbnolok avatar cbnolok commented on July 19, 2024

from source-x.

cbnolok avatar cbnolok commented on July 19, 2024

So, did you succeed?

from source-x.

joaoescribano avatar joaoescribano commented on July 19, 2024

Dudes, sorry for the late answer!

Thanks so much for helping, I've succeeded compiling the code :D thanks to you and another friend of which is a monster on such things.

I just couldn't find any free time to take a closer look at the code :/

Thanks

from source-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.