Bug 11417 - AIX: "Could not find the python development headers"
Summary: AIX: "Could not find the python development headers"
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.2.3
Hardware: PPC AIX
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-28 12:04 UTC by flynn8765
Modified: 2018-12-21 13:29 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description flynn8765 2015-07-28 12:04:41 UTC
AIX Version: 6100-08-01-1245
XLC Version: 13.1.0.3 

Python: 
python-libs-2.7.5-1
python-2.7.5-1
python-devel-2.7.5-1
python-tools-2.7.5-1

my build script:

!/bin/ksh

#export LIBPATH="/usr/local/samba4/dev:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib"
export PATH="$PATH"
export  OBJECT_MODE=64
export CC="/opt/IBM/xlC/13.1.0/bin/xlc_r"
export CFLAGS="-q64 -qsmp -qmaxmem=-1 -qlanglvl=extc99 -qcpluscmt -DNDEBUG -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include -I/opt/freeware/include/python2.7 -Wl,-bmaxdata:0x80000000 -Wl,-b64 -Wl,-blibpath:/usr/local/samba4/dev:/usr/lib:/lib -Wl,-bnoipath -Wl,-bexpall -Wl,-b64 -ma -w"
export CXX="/opt/IBM/xlC/13.1.0/bin/xlC_r"
export CXXFLAGS=$CFLAGS
export LDFLAGS="-blibpath:/usr/local/samba4/dev:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -Wl,-b64 -Wl,-bexpall -Wl,-bnoipath"


./configure --prefix=/usr/local/samba4 --with-configdir=/etc --with-pam --without-gettext --bundled-libraries=ALL --includedir=/opt/freeware/include/python2.7

gmake

ends in the following error...

...

PERL_ARCH_INSTALL_DIR:                                                            : '${LIBDIR}/perl5'
PERL_LIB_INSTALL_DIR:                                                             : '${DATADIR}/perl5'
PERL_INC:                                                                         : ['/usr/opt/perl5/lib/5.8.8/aix-thread-multi', '/usr/opt/perl5/lib/5.8.8', '/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi', '/usr/opt/perl5/lib/site_perl/5.8.8', '/usr/opt/perl5/lib/site_perl']
Checking for program xsltproc                                                     : not found
Checking for program python                                                       : /usr/bin/python
Checking for program python                                                       : /usr/bin/python
Checking for program python                                                       : /usr/bin/python
Checking for Python version >= 2.5.0                                              : ok 2.7.5
Checking for library python2.7                                                    : not found
Checking for library python2.7                                                    : not found
Checking for library python27                                                     : not found
Checking for program python2.7-config                                             : /usr/bin/python2.7-config
Checking for custom code                                                          : Could not find the python development headers
/usr/local/src/samba-4.2.3/wscript:99: error: the configuration failed (see '/usr/local/src/samba-4.2.3/bin/config.log')
WAF_MAKE=1 python ./buildtools/bin/waf build
Project not configured (run 'waf configure' first)
Makefile:8: recipe for target 'all' failed
gmake: *** [all] Error 1


it tried adding the python include dir to the configure command (--includedir=), but was also not recognized.

tail of config.log

...
Checking for program python2.7-config
  find program=['python2.7-config'] paths=[] var='PYTHON_CONFIG'
  -> '/usr/bin/python2.7-config'
Include path for Python extensions (found via python-config --includes): ['/opt/freeware/include/python2.7']

---------------------------------------------------------------------------------
Checking for custom code
==>

#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
        void Py_Initialize(void);
        void Py_Finalize(void);
#ifdef __cplusplus
}
#endif
int main()
{
   Py_Initialize();
   Py_Finalize();
   return 0;
}

<==
[1/2] Compiling test.c
['/opt/IBM/xlC/13.1.0/bin/xlc_r', '-q64', '-qsmp', '-qmaxmem=-1', '-qlanglvl=extc99', '-qcpluscmt', '-DNDEBUG', '-DSYSV', '-D_AIX', '-D_AIX32', '-D_AIX41', '-D_AIX43', '-D_AIX51', '-D_AIX52', '-D_AIX53', '-D_AIX61', '-D_AIX71', '-D_ALL_SOURCE', '-DFUNCPROTO=15', '-O2', '-I/opt/freeware/include', '-I/opt/freeware/include/python2.7', '-Wl,-bmaxdata:0x80000000', '-Wl,-b64', '-Wl,-blibpath:/usr/local/samba4/dev:/usr/lib:/lib', '-Wl,-bnoipath', '-Wl,-bexpall', '-Wl,-b64', '-ma', '-w', '-I/usr/local/include', '-I/opt/freeware/include/python2.7', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '-D_ALL_SOURCE=1', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '../test.c', '-c', '-o', 'default/test_1.o']
[2/2] Linking default/testprog
ld: 0711-317 ERROR: Undefined symbol: .Py_Initialize
ld: 0711-317 ERROR: Undefined symbol: .Py_Finalize
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
['/opt/IBM/xlC/13.1.0/bin/xlc_r', 'default/test_1.o', '-o', '/usr/local/src/samba-4.2.3/bin/.conf_check_0/testbuild/default/testprog', '-Wl,-brtl', '-L/usr/local/lib', '-L/opt/freeware/lib', '-lm', '-ldl', '-blibpath:/usr/local/samba4/dev:/usr/lib:/lib', '-Wl,-bmaxdata:0x80000000', '-Wl,-b64', '-Wl,-bexpall', '-Wl,-bnoipath']
command returned 'Build failed:  -> task failed (err #8): \n\t{task: cc_link test_1.o -> testprog}'Could not find the python development headers

any hints?
Comment 1 Guillaume Xavier Taillon (mail address dead) 2016-01-20 22:39:35 UTC
AIX Version: 7100-03-05-1524
XLC Version: 13.01.0003.0000
Samba Version: 4.3.4
Python Version: 2.7.11

Hi, It seems like we were facing the same problem.

...
command returned 'Build failed:  -> task failed (err #1): \n\t{task: cc test.c -> test_1.o}'Could not find the python development headers
...

By looking at the check that failed (samba/third_party/waf/wafadmin/Tools/python.py:270-307), I found that something was going wrong while invoking python-config, for some reason the file did exist but was empty. Fortunately, the check can fall back to something else so (re)moving python-config fixes the problem (at least it did for me).
Comment 2 Peter (mail address dead) 2016-05-04 16:20:34 UTC
The described problem only occurs when using the prerequisite RPMs from perzl. Using the RPMs from bull the configure step finishes successfully.

After commenting out lines 270-307 configure finishes successfully with RPMs from perzl as well.
However the next step - make - aborts at a very early stage with:
-----------------------------------
# make
        WAF_MAKE=1  ./buildtools/bin/waf build
Waf: Entering directory `/source/samba/samba-4.4.3/bin'
    Selected embedded Heimdal build
Checking project rules ...
ERROR: grouping library target pytalloc-util not declared in samba_python

make: 1254-004 The error code from the last command is 1.


Stop.
-----------------------------------
This same error at "make" also occurs when using bull rpms after commenting out lines 270-307.
Comment 3 Björn Jacke 2018-12-21 13:29:48 UTC
this is a lical oython installation issue. samba uses pathon-config to ask for the right compile options. they need to work then.