[Getdp] Compilation Error on archlinux

Alexander Krimm alex at wirew0rm.de
Sun Oct 2 22:43:48 CEST 2016


Hello,

if I compile the latest release (2.9.2) of getdp on my archlinux machine, I have to apply the following patch to the source to get it to compile:

> --- ./Common/Message.cpp
> +++ ./Common/Message.cpp
> @@ -126,7 +126,7 @@
>    std::vector<wchar_t*> wargv(argc ? argc : 1);
>    for(int i = 0; i < argc; i++)
>      wargv[i] = Py_DecodeLocale(argv[i], NULL);
> -  Py_SetProgramName(wargv[0], NULL);
> +  Py_SetProgramName(wargv[0]);
>    Py_InitializeEx(0);
>    PySys_SetArgv(argc, &wargv[0]);

Error message:

> /home/wirew0rm/build/getdp/src/getdp-2.9.2-source/Common/Message.cpp: In static member function ‘static void Message::Initialize(int, char**)’:
> /home/wirew0rm/build/getdp/src/getdp-2.9.2-source/Common/Message.cpp:129:35: error: too many arguments to function ‘void Py_SetProgramName(wchar_t*)’
>    Py_SetProgramName(wargv[0], NULL);
>                                    ^
> In file included from /usr/include/python3.5m/Python.h:116:0,
>                  from /home/wirew0rm/build/getdp/src/getdp-2.9.2-source/Common/Message.cpp:55:
> /usr/include/python3.5m/pylifecycle.h:10:18: note: declared here
>  PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);

The python documentation [1,2] does not mention the second parameter. Is it safe to remove it?
I think I am missing something here as there are linux binaries available for this version that must have been compiled somehow.

To start the build I use the following commands (in an archlinux PKGBUILD script):

>   cd build
>   cmake .. -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr
>   make
>   make bindir="${pkgdir}/usr/bin" \
>        mandir="${pkgdir}/usr/share/man" install

By applying the beforementioned patch I am able to get a working version of getdp, but as I would like to supply the buildscript to the arch user repository I don't want to do changes to the code that I don't fully understand and which might have unintended consequences for other users.


Best regards,

Alexander Krimm


[1] https://docs.python.org/3.5/c-api/init.html#c.Py_SetProgramName
[2] https://docs.python.org/2.7/c-api/init.html#c.Py_SetProgramName


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://onelab.info/pipermail/getdp/attachments/20161003/a4aac1b9/attachment.asc>


More information about the getdp mailing list