From c3d3cacf970226a43c7b36038d54df626f3f16c3 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Wed, 28 Sep 2022 10:05:46 -0500 Subject: [PATCH 1/2] doc: Add reportlab install info --- python/INSTALLING_PYTHON_PKGS.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/python/INSTALLING_PYTHON_PKGS.md b/python/INSTALLING_PYTHON_PKGS.md index c17bb87..56fb99d 100644 --- a/python/INSTALLING_PYTHON_PKGS.md +++ b/python/INSTALLING_PYTHON_PKGS.md @@ -26,3 +26,24 @@ You will also need to set the following environment variables for build: If you have issues that you cannot debug, feel free to join the community channels documented [here](http://ibm.biz/ibmioss)! + + +### reportlab + +```bash +CFLAGS="-D_LINUX_SOURCE_COMPAT" pip3.9 install reportlab +``` + +Defining `_LINUX_SOURCE_COMPAT` disables `func_data` from being defined in `/usr/include/sys/timer.h` `func_data` is refrenced in `src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h` and `timer.h` is included indirectly from `Python.h`. + +```c +// /usr/include/sys/timer.h +#ifndef _LINUX_SOURCE_COMPAT +#define func_data t_union.data +#endif +``` + +```c +src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:38:41: error: expected ';', ',' or ')' before '.' token + typedef void (*ArtDestroyNotify) (void *func_data, void *data); +``` From 7517520057916937c5f1b93b56a5406eddaab408 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:22:58 -0500 Subject: [PATCH 2/2] fixup! doc: Add reportlab install info --- python/INSTALLING_PYTHON_PKGS.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/python/INSTALLING_PYTHON_PKGS.md b/python/INSTALLING_PYTHON_PKGS.md index 56fb99d..d3f054d 100644 --- a/python/INSTALLING_PYTHON_PKGS.md +++ b/python/INSTALLING_PYTHON_PKGS.md @@ -30,20 +30,16 @@ documented [here](http://ibm.biz/ibmioss)! ### reportlab -```bash -CFLAGS="-D_LINUX_SOURCE_COMPAT" pip3.9 install reportlab -``` - -Defining `_LINUX_SOURCE_COMPAT` disables `func_data` from being defined in `/usr/include/sys/timer.h` `func_data` is refrenced in `src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h` and `timer.h` is included indirectly from `Python.h`. +When installing reportlab, you may encounter a compile error such as: ```c -// /usr/include/sys/timer.h -#ifndef _LINUX_SOURCE_COMPAT -#define func_data t_union.data -#endif + src/rl_addons/renderPM/libart_lgpl/art_pixbuf.h:38:41: error: expected ';', ',' or ')' before '.' token + typedef void (*ArtDestroyNotify) (void *func_data, void *data); + ^ ``` -```c -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: + +```bash + CFLAGS=-D_LINUX_SOURCE_COMPAT pip3.9 install reportlab ```