Potential GiGi replacements: Godot

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#31 Post by o01eg »

CMake project needs some preparation:

Code: Select all

          cp ..\bin\* .
          mkdir build
          pushd build
          cmake -G "Visual Studio 16 2019" -T v141 -A Win32 -DBUILD_TESTING=On ..
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#32 Post by Geoff the Medio »

Code: Select all

C:\Users\g_top\Desktop\FOSDK11\FreeOrionAlt>cp ..\bin\* .
cp: cannot stat '..bin*': No such file or directory
Where is the "bin" directory supposed to be?

What is the "pushd" for?

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#33 Post by o01eg »

pushd is to go into build directory and bin should be appeared after unpacking SDK.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#34 Post by Geoff the Medio »

o01eg wrote: Fri Apr 16, 2021 8:01 am pushd is to go into build directory
So the same as cd build?
bin should be appeared after unpacking SDK.
There is a bin directory in the SDK itself, but it's gone after running bootstrap. Then all the .dll and similar files are moved into the source directory...

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#35 Post by o01eg »

Geoff the Medio wrote: Fri Apr 16, 2021 8:06 am
o01eg wrote: Fri Apr 16, 2021 8:01 am pushd is to go into build directory
So the same as cd build?
Yes but also returns back on command popd.
Geoff the Medio wrote: Fri Apr 16, 2021 8:06 am
bin should be appeared after unpacking SDK.
There is a bin directory in the SDK itself, but it's gone after running bootstrap. Then all the .dll and similar files are moved into the source directory...
I don't call bootstrap for CMake project.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#36 Post by Geoff the Medio »

o01eg wrote: Fri Apr 16, 2021 2:11 am CMake project needs some preparation:

Code: Select all

          cp ..\bin\* .
          mkdir build
          pushd build
          cmake -G "Visual Studio 16 2019" -T v141 -A Win32 -DBUILD_TESTING=On ..
Where am I supposed to run those commands? In ./cmake? It still doesn't work from there, even with a freshly unpacked SDK.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#37 Post by o01eg »

Geoff the Medio wrote: Fri Apr 16, 2021 10:11 am
o01eg wrote: Fri Apr 16, 2021 2:11 am CMake project needs some preparation:

Code: Select all

          cp ..\bin\* .
          mkdir build
          pushd build
          cmake -G "Visual Studio 16 2019" -T v141 -A Win32 -DBUILD_TESTING=On ..
Where am I supposed to run those commands? In ./cmake?
N, it should work from the project root.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#38 Post by Geoff the Medio »

o01eg wrote: Fri Apr 16, 2021 10:12 am N, it should work from the project root.
What is "the project root"? The SDK root directory? That contains bin directly, so I don't see how ..\bin\* will work.

Regardless, if I'm in the SDK room, and pushd build then call the cmake command, it fails because there's no CMakeLists.txt in the SDK root. Am I supposed to manually check out the FreeOrion respository first? If so, how / where, if not using bootstrap.bat?

If I instead try from within the FreeOrion directory (the git root directory for the repository, which contains CMakeLists.txt, which is after running bootstrap.bat and then copying the full contents of the SDK bin directory into the FreeOrion directory (for whatever bootstrap.bat misses that your cp command is supposed to copy), then I still get

Code: Select all

CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at
  least version "3.5")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.20/Modules/FindPythonInterp.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:231 (find_package)

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#39 Post by o01eg »

Geoff the Medio wrote: Fri Apr 16, 2021 10:15 am
o01eg wrote: Fri Apr 16, 2021 10:12 am N, it should work from the project root.
What is "the project root"? The SDK root directory? That contains bin directly, so I don't see how ..\bin\* will work.
I mean FreeOrion project which is suppose to be place in SDK dir.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#40 Post by Geoff the Medio »

o01eg wrote: Fri Apr 16, 2021 10:34 am
Geoff the Medio wrote: Fri Apr 16, 2021 10:15 amWhat is "the project root"? The SDK root directory? That contains bin directly, so I don't see how ..\bin\* will work.
I mean FreeOrion project which is suppose to be place in SDK dir.
So if starting from a fresh SDK unpack, I first need to manually check out FreeOrion master, then cd into that directory, which is located in the same SDK root directory as bin...

I had to manually do the copy from bin since that command fails as above.

After that, the mkdir build and pushd build and cmake call worked. Not sure why that works when doing it in an existing SDK (after bootstrapping) doesn't...

After that, the cmake --build . --config "Release" -- /maxcpucount call starts up. It's seeminly only using a single CPU core and only doing a single project build at a time. That definitely needs fixing, as it changes a ~4 min build into probably a ~40 min build...

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#41 Post by o01eg »

Also apply some CMake fixes from: https://github.com/freeorion/freeorion/pull/3409
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#42 Post by Geoff the Medio »

o01eg wrote: Fri Apr 16, 2021 10:51 am Also apply some CMake fixes from: https://github.com/freeorion/freeorion/pull/3409
Yes, I did that:

Code: Select all

 CMakeLists.txt | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e22f6a07..84e55ff8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -402,18 +402,12 @@ target_link_libraries(freeorioncommon
         ${ANDROID_LIBRARY}
         ${LOG_LIBRARY}
     PRIVATE
+        # boost::uuid requires the bcrypt Windows API on Windows since boost 1.67
+        # see https://github.com/boostorg/uuid/issues/68
+        $<$<AND:$<PLATFORM_ID:Windows>,$<VERSION_GREATER:${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION},1.66>>:bcrypt>    
         ${CORE_FOUNDATION_LIBRARY}
 )
 
-if(WIN32 AND ${Boost_VERSION} GREATER 106699) # boost >= 1.67
-    # fix https://github.com/boostorg/uuid/issues/68
-    find_library(BCRYPT_LIBRARY bcrypt)
-    target_link_libraries(freeorioncommon
-        PRIVATE
-            ${BCRYPT_LIBRARY}
-    )
-endif()
-
 if(CMAKE_SYSTEM_NAME MATCHES "Haiku")
 	target_link_libraries(freeorioncommon PUBLIC network)
 endif()

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#43 Post by o01eg »

Parallel compilation requires -DCMAKE_C_FLAGS=/MP -DCMAKE_CXX_FLAGS=/MP in cmake arguments.

Also apply changes for util/OrderSet.h and BOOST_ALL_NO_LIB in CMakeLists.txt
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Potential GiGi replacements: Godot

#44 Post by Geoff the Medio »

I get

Code: Select all

c:\users\g_top\desktop\fosdk11_godot\freeorion\universe\UnlockableItem.h(10): error C2679: binary '>>': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) [C:\Users\g_top\Desktop\FOSDK11_Godot\FreeOrion\build\freeorioncommon.vcxproj]
... Trying again, might not have saved all CMakeLists.txt changes...

Now have applied

Code: Select all

 CMakeLists.txt  | 13 ++++---------
 util/OrderSet.h |  1 +
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e22f6a07..8936757bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -402,18 +402,12 @@ target_link_libraries(freeorioncommon
         ${ANDROID_LIBRARY}
         ${LOG_LIBRARY}
     PRIVATE
+        # boost::uuid requires the bcrypt Windows API on Windows since boost 1.67
+        # see https://github.com/boostorg/uuid/issues/68
+        $<$<AND:$<PLATFORM_ID:Windows>,$<VERSION_GREATER:${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION},1.66>>:bcrypt>    
         ${CORE_FOUNDATION_LIBRARY}
 )
 
-if(WIN32 AND ${Boost_VERSION} GREATER 106699) # boost >= 1.67
-    # fix https://github.com/boostorg/uuid/issues/68
-    find_library(BCRYPT_LIBRARY bcrypt)
-    target_link_libraries(freeorioncommon
-        PRIVATE
-            ${BCRYPT_LIBRARY}
-    )
-endif()
-
 if(CMAKE_SYSTEM_NAME MATCHES "Haiku")
 	target_link_libraries(freeorioncommon PUBLIC network)
 endif()
@@ -462,6 +456,7 @@ target_compile_options(freeorionparseobj
 
 target_compile_definitions(freeorionparseobj
     PUBLIC
+        BOOST_ALL_NO_LIB
         $<$<NOT:$<PLATFORM_ID:Android>>:BOOST_ALL_DYN_LINK>
     PRIVATE
         -DNDEBUG
diff --git a/util/OrderSet.h b/util/OrderSet.h
index bb58b4555..1fdf4746f 100644
--- a/util/OrderSet.h
+++ b/util/OrderSet.h
@@ -10,6 +10,7 @@
 #include <map>
 #include <memory>
 #include <set>
+#include <string>
 
 class Order;
 
But still getting

Code: Select all

universe\UnlockableItem.h(10): error C2679: binary '>>': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#45 Post by o01eg »

Something missing in util/Enum.h but not sure.

Could you try to add includes here for <string>?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply