Linux Dockerfile?

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Linux Dockerfile?

#1 Post by human2 »

I see some forum posts (viewtopic.php?p=94965#p94965) mentioning a Dockerfile to build FO on Linux.

I found it here https://github.com/freeorion/freeorion- ... Dockerfile.

I use Linux via a VM and I've never built anything on it. I've been learning Docker and since I'm basically creating a build environment from scratch anyway, maybe it would be to my advantage to update the Dockerfile to build FO. Does anyone have any recommendations?

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

Re: Linux Dockerfile?

#2 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 6:22 am I see some forum posts (viewtopic.php?p=94965#p94965) mentioning a Dockerfile to build FO on Linux.

I found it here https://github.com/freeorion/freeorion- ... Dockerfile.

I use Linux via a VM and I've never built anything on it. I've been learning Docker and since I'm basically creating a build environment from scratch anyway, maybe it would be to my advantage to update the Dockerfile to build FO. Does anyone have any recommendations?
What target platform you are going to build FreeOrion?
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
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#3 Post by human2 »

Linux and macOS. I've got a thread about my macOS build adventures here viewtopic.php?f=24&t=11962&p=105492#p105492.

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

Re: Linux Dockerfile?

#4 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 1:45 pm Linux and macOS. I've got a thread about my macOS build adventures here viewtopic.php?f=24&t=11962&p=105492#p105492.
I'm using docker to build packages for Ubuntu from Debian. Dockerfile is based on the one you mentioned.
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
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#5 Post by human2 »

Ok, I tried to build using that old Dockerfile and I get this error after running cmake ../freeorion.

Code: Select all

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonInterp: Found unsuitable version "3.6.9", but required
  is at least "3.9" (found /usr/bin/python3)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindPythonInterp.cmake:152 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:231 (find_package)
I updated the Dockerfile to pull from "focal-20210217" instead of "bionic-20190307" and that didn't go so well. I could try to debug this but I am hoping you can share your Dockerfile instead.

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

Re: Linux Dockerfile?

#6 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 3:09 pm Ok, I tried to build using that old Dockerfile and I get this error after running cmake ../freeorion.

Code: Select all

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonInterp: Found unsuitable version "3.6.9", but required
  is at least "3.9" (found /usr/bin/python3)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindPythonInterp.cmake:152 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:231 (find_package)
I updated the Dockerfile to pull from "focal-20210217" instead of "bionic-20190307" and that didn't go so well. I could try to debug this but I am hoping you can share your Dockerfile instead.
I still build with bionic because FreeOrion minimum python version is 3.5.
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
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#7 Post by human2 »

Ugh. I know what I did. I changed the python required version in the CMakeLists.txt because I couldn't get the macOS version to build using the old Python. I fixed it and it worked. I'm running make now.

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#8 Post by human2 »

Hm. It failed.

Code: Select all

[ 43%] Building C object CMakeFiles/freeorioncommon.dir/util/binreloc.c.o
[ 43%] Linking CXX shared library libfreeorioncommon.so
[ 43%] Built target freeorioncommon
Scanning dependencies of target freeorionparseobj
[ 43%] Building CXX object CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
CMakeFiles/freeorionparseobj.dir/build.make:62: recipe for target 'CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o' failed
make[2]: *** [CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o] Error 4
CMakeFiles/Makefile2:250: recipe for target 'CMakeFiles/freeorionparseobj.dir/all' failed
make[1]: *** [CMakeFiles/freeorionparseobj.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

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

Re: Linux Dockerfile?

#9 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 4:35 pm Hm. It failed.

Code: Select all

[ 43%] Building C object CMakeFiles/freeorioncommon.dir/util/binreloc.c.o
[ 43%] Linking CXX shared library libfreeorioncommon.so
[ 43%] Built target freeorioncommon
Scanning dependencies of target freeorionparseobj
[ 43%] Building CXX object CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
CMakeFiles/freeorionparseobj.dir/build.make:62: recipe for target 'CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o' failed
make[2]: *** [CMakeFiles/freeorionparseobj.dir/parse/ArithmeticRules.cpp.o] Error 4
CMakeFiles/Makefile2:250: recipe for target 'CMakeFiles/freeorionparseobj.dir/all' failed
make[1]: *** [CMakeFiles/freeorionparseobj.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
Looks like not enough memory to build highly boosted c++ code )

What are available memory or memory limits?
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: Linux Dockerfile?

#10 Post by Geoff the Medio »

Consider also only single non-parallel building for Parsers.

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#11 Post by human2 »

o01eg wrote: Wed Mar 17, 2021 4:45 pm What are available memory or memory limits?
My Docker was assigned 2 GB. I upped it to 4 GB and will try again.
Geoff the Medio wrote: Wed Mar 17, 2021 4:47 pm Consider also only single non-parallel building for Parsers.
I have no idea how to change that.

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

Re: Linux Dockerfile?

#12 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 5:24 pm
Geoff the Medio wrote: Wed Mar 17, 2021 4:47 pm Consider also only single non-parallel building for Parsers.
I have no idea how to change that.
Call build command with -j1
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
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Linux Dockerfile?

#13 Post by human2 »

It built!

I'm trying to run this on Lubuntu 20.04. I've been able to install sdl, openal, but it's trying to load libboost_locale.so.1.62.0 and the oldest version on apt is libboost_locale.so.1.67.0. I don't know what to do about this.

Code: Select all

./freeorion: error while loading shared libraries: libboost_locale.so.1.62.0: cannot open shared object file: No such file or directory

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

Re: Linux Dockerfile?

#14 Post by o01eg »

human2 wrote: Wed Mar 17, 2021 7:47 pm It built!

I'm trying to run this on Lubuntu 20.04. I've been able to install sdl, openal, but it's trying to load libboost_locale.so.1.62.0 and the oldest version on apt is libboost_locale.so.1.67.0. I don't know what to do about this.

Code: Select all

./freeorion: error while loading shared libraries: libboost_locale.so.1.62.0: cannot open shared object file: No such file or directory
You should use same ubuntu version to build it. Bionic from Dockerfile is 18.04 so it isn't compatible with 20.04
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

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

Re: Linux Dockerfile?

#15 Post by o01eg »

Which version of FreeOrion are you trying to build? You can use my PPA branches to build deb packages then install freeorion package in OS.
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