Jump to content
The Dark Mod Forums

Compilation error on Linux Mint


Recommended Posts

I'm trying to follow the DR compilation instructions, using a Linux Mint system (apparently Mint is different enough from its near relatives to be unable to resolve dependencies for the Debian and Ubuntu .deb files). I installed packages based on the list given for Ubuntu 19.xx / 18.xx / 17.xx, except that apparently libwxgtk3.0-dev is now called libwxgtk3.0-gtk3-dev. I get the following errors during `make`:

Making all in script
make[3]: Entering directory '/media/rfjs/DATA/code/DarkRadiant/plugins/script'
  CXXLD    script.la
/bin/bash: --exec-prefix: command not found
/bin/bash: --includes: command not found
/bin/bash: --libs: command not found
/bin/bash: --cflags: command not found
/bin/bash: --ldflags: command not found
/bin/bash: --extension-suffix: command not found
/bin/bash: --help: command not found
/bin/bash: --configdir: command not found
make[3]: *** [Makefile:617: script.la] Error 127
make[3]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant/plugins/script'
make[2]: *** [Makefile:446: all-recursive] Error 1
make[2]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant/plugins'
make[1]: *** [Makefile:755: all-recursive] Error 1
make[1]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant'
make: *** [Makefile:496: all] Error 2

A bit of Googling suggests those -- strings are options for python-config, so why they're being treated as shell commands has me mystified.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites
Making all in script
make[3]: Entering directory '/media/rfjs/DATA/code/DarkRadiant/plugins/script'
/bin/bash ../../libtool  --tag=CXX   --mode=link g++ -std=c++11 -std=c++17  -g -O2 -DNDEBUG  -Wall -Wno-unused-variable -Werror=return-type  -module -avoid-version -lstdc++fs Usage: /usr/bin/python-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--configdir -L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk3u_gl-3.0 -lwx_gtk3u_stc-3.0 -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -lsigc-2.0  -o script.la -rpath /usr/local/lib/darkradiant/modules ScriptingSystem.lo ScriptCommand.lo ScriptModule.lo ScriptMenu.lo ScriptWindow.lo SceneNodeBuffer.lo PythonModule.lo interfaces/DialogInterface.lo interfaces/EClassInterface.lo interfaces/BrushInterface.lo interfaces/RadiantInterface.lo interfaces/PatchInterface.lo interfaces/SelectionInterface.lo interfaces/MapInterface.lo interfaces/EntityInterface.lo interfaces/MathInterface.lo interfaces/ModelInterface.lo interfaces/CommandSystemInterface.lo interfaces/FileSystemInterface.lo interfaces/GridInterface.lo interfaces/SceneGraphInterface.lo interfaces/ShaderSystemInterface.lo interfaces/SkinInterface.lo interfaces/SelectionSetInterface.lo interfaces/SelectionGroupInterface.lo interfaces/SoundInterface.lo interfaces/GameInterface.lo ../../libs/math/libmath.la ../../libs/wxutil/libwxutil.la 
/bin/bash: --exec-prefix: command not found
/bin/bash: --includes: command not found
/bin/bash: --libs: command not found
/bin/bash: --cflags: command not found
/bin/bash: --ldflags: command not found
/bin/bash: --extension-suffix: command not found
/bin/bash: --help: command not found
/bin/bash: --configdir: command not found
make[3]: *** [Makefile:617: script.la] Error 127
make[3]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant/plugins/script'
make[2]: *** [Makefile:446: all-recursive] Error 1
make[2]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant/plugins'
make[1]: *** [Makefile:755: all-recursive] Error 1
make[1]: Leaving directory '/media/rfjs/DATA/code/DarkRadiant'
make: *** [Makefile:496: all] Error 2

 

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites

Oh, I see the problem. DarkRadiant's configure script is obviously calling a system-wide python-config to get the link parameters for Python, but something is wrong with the arguments which means that the script just returns a usage message rather than compiler flags. The build script is not handling this and just injecting the usage message directly into the linker command line which fails because the usage message is not a set of valid compiler options.

I'm not sure what the root cause is, but you might be able to work around it by providing the relevant configure option to disable building the Python module.

  • Thanks 1
Link to post
Share on other sites

Could this line in config.log be related?

PYTHON_LIBS='Usage: /usr/bin/python-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--configdir'

Digging around a bit I found this:

# Python 3.8 requires the --embed switch to produce working linker flags
        PC_PYTHON_VERIFY_VERSION([>=], [3.8.0],
            [PYTHON_LIBS=`$PYTHON_CONFIG --libs --embed`],
            [PYTHON_LIBS=`$PYTHON_CONFIG --libs`])

I have Python 3.8.2 on my system but --embed doesn't appear in the options list for python-config.

Edit: Further investigation suggests my python-config may be the python2 version. From output of `aptitude search python-dev`:

i  python-dev-is-python2 - symlinks /usr/bin/python-config to the DEPRECATED python2-config

Edit: yes, that seems to be it. From https://launchpad.net/ubuntu/+source/what-is-python/3

Quote

In Ubuntu, all python packages use explicit python3 or python2  interpreter and do not use unversioned /usr/bin/python-config at all. Some
 third-party code may still be python2 based, yet may use  /usr/bin/python-config.
 .
 This is a convenience package which ships a symlink to point  the /usr/bin/python-config script at the current default python2.
 It may improve compatibility with obsolete 3rd-party software,  whilst breaking some modern software.

 

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites

Okay, installing python-is-python3/python-dev-is-python3 let me finish compilation. Although I don't have a script tab or script dropdown, despite not having deliberately disabled script support.

Edit: possibly related lines from darkradiant.log:

 (140103598541440) ModuleLoader: Loading module '/usr/local/lib/darkradiant/modules/script.so'
 (140103598541440) WARNING: Failed to load module /usr/local/lib/darkradiant/modules/script.so:
 (140103598541440) /usr/local/lib/darkradiant/modules/script.so: undefined symbol: _Py_ZeroStruct

 

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites
  • 3 months later...

Having just upgraded to Ubuntu 20.04, I can now reproduce this problem.

As of Git 6a093c45fad6bb69ed4ccd8e76df121313917cfc, I am now explicitly requesting python3-config instead of the unversioned and deprecated python-config, which fixes the compilation error but does not fix the loading of the script module due to the missing _Py_ZeroStruct symbol.

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.

×
×
  • Create New...