I want to install PL/Python on my postgres database. I am using a binary manager on postgres pgenv
. These are the steps I am following to install the procedural language:
I have downloaded the PL/Python source code from the PostgreSQL contrib repository
After connecting to the PL/Python source code directory, i run the commands
make
make install
- I am getting the error:
Makefile:5: ../../../src/Makefile.global: No such file or directory
Makefile:103: /src/Makefile.shlib: No such file or directory
make: *** No rule to make target `/src/Makefile.shlib'. Stop.
Makefile:5: ../../../src/Makefile.global: No such file or directory
Makefile:103: /src/Makefile.shlib: No such file or directory
make: *** No rule to make target `/src/Makefile.shlib'. Stop.
The error occurs because the build process for PL/Python is unable to locate the necessary PostgreSQL source files and makefiles. I have already checked and verified that the pg_config
environment variable is pointing to the correct path.
After looking and referring to the pgenv
docs.
I Created a configuration file named default.conf
inside the .pgenv/config/
directory and added the following line to the default.conf
file to specify the --with-python
option during the build process:
`PGENV_CONFIGURE_OPTIONS=(--with-python)`
Then i ran
`pgenv install 13.4`
Getting the error:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 command.o common.o copy.o crosstabview.o describe.o help.o input.o large_obj.o mainloop.o prompt.o psqlscanslash.o sql_help.o startup.o stringutils.o tab-complete.o variables.o -L../../../src/port -L../../../src/common -L../../../src/fe_utils -lpgfeutils -L../../../src/common -lpgcommon -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -Wl,-dead_strip_dylibs -lpgcommon -lpgport -lz -lreadline -lm -o psql
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C pl all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C plpgsql all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C plpython all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src all
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o plpy_cursorobject.o plpy_cursorobject.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o plpy_elog.o plpy_elog.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_comp.o pl_comp.c
In file included from plpy_cursorobject.c:14:
In file included from In file included from plpy_elog.c./plpy_cursorobject.h::108:
:
In file included from In file included from ./plpy_elog.h./plpy_typeio.h::810:
:
./plpython.h:98:./plpython.h:98:1010:: fatal error: fatal error: 'eval.h' file not found'eval.h' file not found
#include <eval.h>#include <eval.h>
^~~~~~~~ ^~~~~~~~
1 error generated.
make[3]: *** [plpy_elog.o] Error 1
make[3]: *** Waiting for unfinished jobs....
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_exec.o pl_exec.c
1 error generated.
make[3]: *** [plpy_cursorobject.o] Error 1
make[2]: *** [all-plpython-recurse] Error 2
make[2]: *** Waiting for unfinished jobs....
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_funcs.o pl_funcs.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_gram.o pl_gram.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_handler.o pl_handler.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -I. -I. -I../../../../src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c -o pl_scanner.o pl_scanner.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -bundle -multiply_defined suppress -o plpgsql.so pl_comp.o pl_exec.o pl_funcs.o pl_gram.o pl_handler.o pl_scanner.o -L../../../../src/port -L../../../../src/common -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -Wl,-dead_strip_dylibs -bundle_loader ../../../../src/backend/postgres
make[1]: *** [all-pl-recurse] Error 2
make: *** [world-src-recurse] Error 2