On 15 October 2015 at 14:46, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Dario Beraldi <dario.beraldi@xxxxxxxxx> writes:
> Thanks for your answer. Just checking before I screw things up... About
> "the source tree has to be configured and built twice", does it mean that I
> have to execute again
> ./configure --prefix=$HOME;
> make;
> make install
> And should I enable any particular option in ./configure? I see there is a
> "--with-python" option (not specific to python3 though).
Indeed --- you have not built any version of plpython here. You need
--with-python, and you need to make sure the PYTHON environment variable
is set (else you'll get whatever version is invoked by "python", which is
most likely python2). See the build instructions in the documentation.
Also watch the output from configure, which will show you which python
it selected.
regards, tom lane
Sorry guys... I executed
./configure --prefix=$HOME --with-python PYTHON=/usr/local/bin/python3
make
make install
./configure --prefix=$HOME --with-python PYTHON=/usr/local/bin/python3
make
make install
and it completed fine (see also below output from 'grep -i 'PYTHON' config.log'). Still after restarting postgres I get:
createlang plpython3u sblab
ERROR: could not open extension control file "/data/sblab-home/berald01/share/postgresql/extension/plpython3u.control": No such file or directory
STATEMENT: CREATE EXTENSION "plpython3u";
## From config.log
grep -i 'PYTHON' config.log
$ ./configure --prefix=/Users/berald01 --with-python PYTHON=/usr/local/bin/python3
PATH: /opt/rh/python27/root/usr/bin
configure:5399: checking whether to build Python modules
configure:7499: checking for python
configure:7529: result: /usr/local/bin/python3
configure:7544: checking for Python distutils module
configure:7557: checking Python configuration directory
configure:7562: result: /usr/local/lib/python3.4/config-3.4m
configure:7565: checking Python include directories
configure:7575: result: -I/usr/local/include/python3.4m
configure:7580: checking how to link an embedded Python application
configure:7607: result: -L/usr/local/lib/python3.4/config-3.4m -lpython3.4m -lpthread -ldl -lutil -lm
configure:7612: checking whether Python is compiled with thread support
configure:29636: checking Python.h usability
configure:29653: gcc -c -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/include/python3.4m -D_GNU_SOURCE conftest.c >&5
configure:29678: checking Python.h presence
configure:29693: gcc -E -I/usr/local/include/python3.4m -D_GNU_SOURCE conftest.c
configure:29747: checking for Python.h
ac_cv_header_Python_h=yes
ac_cv_path_PYTHON=/usr/local/bin/python3
PYTHON='/usr/local/bin/python3'
configure_args=' '\''--prefix=/Users/berald01'\'' '\''--with-python'\'' '\''PYTHON=/usr/local/bin/python3'\'''
python_additional_libs='-lpthread -ldl -lutil -lm'
python_enable_shared='0'
python_includespec='-I/usr/local/include/python3.4m'
python_libdir='/usr/local/lib/python3.4/config-3.4m'
python_libspec='-L/usr/local/lib/python3.4/config-3.4m -lpython3.4m'
python_majorversion='3'
python_version='3.4'
with_python='yes'
grep -i 'PYTHON' config.log
$ ./configure --prefix=/Users/berald01 --with-python PYTHON=/usr/local/bin/python3
PATH: /opt/rh/python27/root/usr/bin
configure:5399: checking whether to build Python modules
configure:7499: checking for python
configure:7529: result: /usr/local/bin/python3
configure:7544: checking for Python distutils module
configure:7557: checking Python configuration directory
configure:7562: result: /usr/local/lib/python3.4/config-3.4m
configure:7565: checking Python include directories
configure:7575: result: -I/usr/local/include/python3.4m
configure:7580: checking how to link an embedded Python application
configure:7607: result: -L/usr/local/lib/python3.4/config-3.4m -lpython3.4m -lpthread -ldl -lutil -lm
configure:7612: checking whether Python is compiled with thread support
configure:29636: checking Python.h usability
configure:29653: gcc -c -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/include/python3.4m -D_GNU_SOURCE conftest.c >&5
configure:29678: checking Python.h presence
configure:29693: gcc -E -I/usr/local/include/python3.4m -D_GNU_SOURCE conftest.c
configure:29747: checking for Python.h
ac_cv_header_Python_h=yes
ac_cv_path_PYTHON=/usr/local/bin/python3
PYTHON='/usr/local/bin/python3'
configure_args=' '\''--prefix=/Users/berald01'\'' '\''--with-python'\'' '\''PYTHON=/usr/local/bin/python3'\'''
python_additional_libs='-lpthread -ldl -lutil -lm'
python_enable_shared='0'
python_includespec='-I/usr/local/include/python3.4m'
python_libdir='/usr/local/lib/python3.4/config-3.4m'
python_libspec='-L/usr/local/lib/python3.4/config-3.4m -lpython3.4m'
python_majorversion='3'
python_version='3.4'
with_python='yes'