Skip to content

Conversation

@abmusse
Copy link
Member

@abmusse abmusse commented Sep 28, 2022

pip installing reportlab with python3.9 fails building _renderPM extension.

    In file included from /usr/include/sys/thread.h:41:0,
                     from /usr/include/sys/ptrace.h:28,
                     from /usr/include/sys/proc.h:42,
                     from /usr/include/sys/pri.h:43,
                     from /usr/include/sys/sched.h:38,
                     from /usr/include/sched.h:51,
                     from /usr/include/pthread.h:67,
                     from /QOpenSys/pkgs/include/python3.9/pythread.h:128,
                     from /QOpenSys/pkgs/include/python3.9/Python.h:131,
                     from src/rl_addons/renderPM/_renderPM.c:1:
    src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:38:41: error: expected ';', ',' or ')' before '.' token
     typedef void (*ArtDestroyNotify) (void *func_data, void *data);
                                             ^
    In file included from src/rl_addons/renderPM/libart_lgpl/libart.h:11:0,
                     from src/rl_addons/renderPM/_renderPM.c:11:
    src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:63:3: error: unknown type name 'ArtDestroyNotify'
       ArtDestroyNotify destroy;
       ^~~~~~~~~~~~~~~~
    src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:83:26: error: unknown type name 'ArtDestroyNotify'
            void *dfunc_data, ArtDestroyNotify dfunc);
                              ^~~~~~~~~~~~~~~~
    src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:87:27: error: unknown type name 'ArtDestroyNotify'
             void *dfunc_data, ArtDestroyNotify dfunc);

Workaround to resolve the build failure is to define _LINUX_SOURCE_COMPAT.

@abmusse abmusse requested review from ThePrez and kadler September 28, 2022 15:09
@kadler
Copy link
Member

kadler commented Sep 28, 2022

I think your changes have good info, but most users don't need to know or care about that level of detail. Instead something like this would be more useful to them:

When installing reportlab, you may encounter a compile error such as

   src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:38:41: error: expected ';', ',' or ')' before '.' token
    typedef void (*ArtDestroyNotify) (void *func_data, void *data);
                                            ^

This is due to a conflict in the reportlab source code and the AIX header files. As a workaround, you can define _LINUX_SOURCE_COMPAT to prevent the conflicting definition:

CFLAGS=-D_LINUX_SOURCE_COMPAT pip3 install reportlab`

@abmusse
Copy link
Member Author

abmusse commented Sep 28, 2022

I think your changes have good info, but most users don't need to know or care about that level of detail. Instead something like this would be more useful to them:

When installing reportlab, you may encounter a compile error such as

   src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:38:41: error: expected ';', ',' or ')' before '.' token
    typedef void (*ArtDestroyNotify) (void *func_data, void *data);
                                            ^

This is due to a conflict in the reportlab source code and the AIX header files. As a workaround, you can define _LINUX_SOURCE_COMPAT to prevent the conflicting definition:

CFLAGS=-D_LINUX_SOURCE_COMPAT pip3 install reportlab`

Thanks for cutting it down. I will make the suggested change!

@vint7k
Copy link

vint7k commented Nov 25, 2023

Uploading reportlab.png…
It appears to me that I am facing the same issue while installing the reportlab package on IBM i V7R3.

could you please suggest CFLAGS=-D_LINUX_SOURCE_COMPAT pip3 install reportlab` if this worked in resolving the issue during the wheel build of reportlab.

We are using python3.9 and pillow version 8.3.1 default from IBM i repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants