Jump to content
Sign in to follow this  
gw1500se

Installation on CentOS 7

Recommended Posts

I am trying to build the alpha version of 0AD on my CentOS 7 system since there seems to be no repository or RPM for that distro. When I try to run 'update-workspaces.sh' I get the following output:

Updating bundled third-party dependencies...

FCollada/FColladaPlugin.cpp
FCollada/FCollada.cpp
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
In file included from FCollada/FCollada.h:49:0,
                 from FCollada/StdAfx.h:13,
                 from FCollada/FCollada.cpp:9:
FCollada/FUtils/FUtils.h:91:25: fatal error: libxml/tree.h: No such file or directory

On CentOS 7 the package containing that is 'libxml-devel' and the 'tree.h' include file is located in /usr/include/gnome-xml/libxml. It is unclear from the build instructions how to deal with this. I cannot add a directory for 'libxml-2.0.pc' since that does not exist on CentOS. Can someone point me to a compatible rpm or explain how to deal with this dependency? TIA.

Share this post


Link to post
Share on other sites

Looking through an online list of packages available for CentOS 7 (such as this one), the package you need is libxml2-devel, which contains the file libxml-2.0.pc (and places it under /usr/lib64/pkgconfig).

(libxml2 is not version 2 of the (deprecated) libxml library. The "Dependencies" section of the Build Instructions does specify libxml2.)

Edit to add: Looking into it a little further, it might not be possible (or very difficult) to compile 0AD on CentOS 7 (or 6) at all, as:

  • CentOS 7's official repos appear to lack the libenet, libgloox, libsodium, miniupnpc, openal, and sdl2 libraries, all of which are required dependencies of 0AD.
    • (Also appears to lack wxwidgets, which is required for Atlas, our map editor.)
  • The minimum version of boost required to compile/run 0AD is version 1.57. CentOS 7 has 1.53.

If you do succeed, we'd love to know how (and so we can add instructions to our wiki).

Edited by s0600204

Share this post


Link to post
Share on other sites

Thanks for the reply. I've made some progress. Indeed it was libxml2-devel that was missing. I am now into the compile phase and get this error:

{standard input}: Assembler messages:
{standard input}:92114: Warning: end of file not at end of a line; newline inserted
{standard input}:92804: Error: no such instruction: `m'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[3]: *** [Unified_cpp_js_src0.o] Error 4
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug/js/src'
make[2]: *** [js/src/target] Error 2
make[2]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug'
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug'
make: *** [default] Error 2
ERROR: SpiderMonkey build failed

This does not seem like a missing pre-req. The source was download and not changed. Is this a bug in the source or do I need a different assembler (GNU assembler version 2.27-28.base.el7_5.1)? Any suggestions?

Edited by gw1500se

Share this post


Link to post
Share on other sites

Which version of GCC is used?

Not sure about 38, but the current SM needs 4.9 IIRC.

(you might need to check SM dependencies too) 

Share this post


Link to post
Share on other sites

Works with (diff distro)

GNU assembler (GNU Binutils) 2.31.1

gcc (GCC) 8.2.1 20180831


Takes very long to compile spidermonkey (Unified_cpp_js_src9)

  • Like 1

Share this post


Link to post
Share on other sites

That is the lastest GCC in the CentOS repository. I'll look to see if I can find something newer externally. It did indeed take a long time compiling before that error popped up.

Share this post


Link to post
Share on other sites

On to the next layer of the onion. I am now using gcc (GCC) 7.3.1 20180303 and get this error:

Unified_cpp_js_src1.cpp
Unified_cpp_js_src10.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[3]: *** [Unified_cpp_js_src0.o] Error 4
make[3]: *** Deleting file `Unified_cpp_js_src0.o'
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug/js/src'
make[2]: *** [js/src/target] Error 2
make[2]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug'
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/home/dap/Downloads/0ad-0.0.23-alpha/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug'
make: *** [default] Error 2
ERROR: SpiderMonkey build failed

Reading up on error 4 the implication is that I have insufficient swap space. My swap is 2GB. Is it really possible that compiling that file really needs more than that or is this error 4 indicating something else?

Edited by gw1500se
Update error 4 meaning

Share this post


Link to post
Share on other sites

I found the problem. For some reason my swap was turned off. Now it compiles successfully and I am doing the 'make'. I had to install a number of 'devel' packages to get the necessary headers but I'm stuck again with this error:

ArchiveBuilder.cpp
In file included from ../../../source/network/scripting/JSInterface_Network.cpp:23:0:
../../../source/lib/external_libraries/libsdl.h:32:18: fatal error: SDL.h: No such file or directory
 # include "SDL.h"
                  ^
compilation terminated.
make[1]: *** [obj/engine_Release/JSInterface_Network.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [engine] Error 2

I have SDL.h installed but it seems it can't find it (/usr/include/SDL/SDL.h). Do I need to add a path somewhere?

Share this post


Link to post
Share on other sites

Please pay attention to the dependencies as stated on our wiki. 0AD depends on sdl2, not sdl (although originating from the same project, they are not interchangeable.)

Also note that, as mentioned above, sdl2 is one of the libraries the official CentOS repositories appears to lack. You may need to build from source.

  • Like 1

Share this post


Link to post
Share on other sites

Interesting and highly unusual for CentOS to be ahead of the curve. Most of the time it is far behind. That is the only version available for SDL2. It cannot be downgraded to an earlier version. I guess I need to abandon this project for now.

Edited by gw1500se

Share this post


Link to post
Share on other sites

I did not. I didn't know I needed to. After running it again, I get something different.

CConsole.cpp
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:40:1: error: one or more PCH files were found, but they were invalid
 #endif
 ^
/usr/include/stdc-predef.h:40:1: error: use -Winvalid-pch for more information
/usr/include/stdc-predef.h:40:1: fatal error: obj/engine_Release/precompiled.h: No such file or directory
compilation terminated.
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:40:1: error: one or more PCH files were found, but they were invalid
 #endif
 ^
/usr/include/stdc-predef.h:40:1: error: use -Winvalid-pch for more information
/usr/include/stdc-predef.h:40:1: fatal error: obj/engine_Release/precompiled.h: No such file or directory
compilation terminated.
make[1]: *** [obj/engine_Release/JSInterface_Network.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [obj/engine_Release/CConsole.o] Error 1
make: *** [engine] Error 2

I tried 'make -Winvalid-pch' but did not get anything different. Did I need to run 'clean-workspaces.sh' first?

Share this post


Link to post
Share on other sites

Thanks. I think that got me further but now I have another error. This seems to be related to sodium.

Preprocessor.cpp
../../../source/ps/ModIo.cpp: In constructor ‘ModIo::ModIo()’:
../../../source/ps/ModIo.cpp:120:113: error: ‘sodium_base64_VARIANT_ORIGINAL’ was not declared in this scope
  if (sodium_base642bin((unsigned char*)&m_pk, sizeof m_pk, pk_str.c_str(), pk_str.size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof m_pk)
                                                                                                                 ^
../../../source/ps/ModIo.cpp:120:143: error: ‘sodium_base642bin’ was not declared in this scope
  if (sodium_base642bin((unsigned char*)&m_pk, sizeof m_pk, pk_str.c_str(), pk_str.size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof m_pk)
                                                                                                                                               ^
In file included from ../../../source/lib/external_libraries/curl.h:50:0,
                 from ../../../source/ps/ModIo.h:26,
                 from ../../../source/ps/ModIo.cpp:25:
../../../source/ps/ModIo.cpp: In member function ‘CURLMcode ModIo::SetupRequest(const string&, bool)’:
../../../source/ps/ModIo.cpp:193:28: error: ‘CURLOPT_XFERINFOFUNCTION’ was not declared in this scope
   curl_easy_setopt(m_Curl, CURLOPT_XFERINFOFUNCTION, DownloadProgressCallback);
                            ^
../../../source/ps/ModIo.cpp:194:28: error: ‘CURLOPT_XFERINFODATA’ was not declared in this scope
   curl_easy_setopt(m_Curl, CURLOPT_XFERINFODATA, (void*)&m_DownloadProgressData);
                            ^
../../../source/ps/ModIo.cpp: In static member function ‘static bool ModIo::ParseSignature(const std::vector<std::basic_string<char> >&, SigStruct&, const PKStruct&, std::string&)’:
../../../source/ps/ModIo.cpp:777:114: error: ‘sodium_base64_VARIANT_ORIGINAL’ was not declared in this scope
   if (sodium_base642bin((unsigned char*)&sig, sizeof sig, msg_sig.c_str(), msg_sig.size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof sig)
                                                                                                                  ^
../../../source/ps/ModIo.cpp:777:144: error: ‘sodium_base642bin’ was not declared in this scope
   if (sodium_base642bin((unsigned char*)&sig, sizeof sig, msg_sig.c_str(), msg_sig.size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof sig)
                                                                                                                                                ^
../../../source/ps/ModIo.cpp:793:121: error: ‘sodium_base64_VARIANT_ORIGINAL’ was not declared in this scope
   if (sodium_base642bin(global_sig, sizeof global_sig, sig_lines[3].c_str(), sig_lines[3].size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof global_sig)
                                                                                                                         ^
../../../source/ps/ModIo.cpp:793:151: error: ‘sodium_base642bin’ was not declared in this scope
   if (sodium_base642bin(global_sig, sizeof global_sig, sig_lines[3].c_str(), sig_lines[3].size(), NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) != 0 || bin_len != sizeof global_sig)
                                                                                                                                                       ^
make[1]: *** [obj/engine_Release/ModIo.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [engine] Error 2

I have libsodium13-devel.x86_64-1.0.5-1.el7 installed.

Share this post


Link to post
Share on other sites

libsodium needs to be at least version 1.0.14. EPEL should have version 1.0.16.

(Annoyingly it also, as you've found out, has version 1.0.5. In this case you'll want libsodium and not libsodium13)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...