Win8 - Make Failure
NickEmpetvee opened this issue · 6 comments
The make is failing. I'm on PostgreSQL 10, Win81.
The make / make install output is below:
C:\mcdev\PostgreSQL\pg_rational>make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.cprocess_begin: CreateProcess(NULL, gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.c, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [pg_rational.o] Error 2
C:\mcdev\PostgreSQL\pg_rational>make install
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.c
process_begin: CreateProcess(NULL, gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.c, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [pg_rational.o] Error 2
I suspect that gcc may not be in your $PATH, or at least not in the path within the process that CreateProcess spawns. Try using Make's debug flag to get more information. On many platforms it is make -d
.
That got me one step further. Make
now tells me that there's a missing header file. I'm using mingw's GCC. Output below.
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.cCreateProcess(C:\download\mingw\bin\gcc.exe,gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -DMS_WIN64 -I/opt/pgbin-build/pgbin/shared/win64/include -std=c99 -Wextra -Wpedantic -I. -I./ -IC:/POSTGR~1/pg10/include/POSTGR~1/server -IC:/POSTGR~1/pg10/include/POSTGR~1/internal -I./src/include/port/win32 -DEXEC_BACKEND -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/ssl/include -IC:/POSTGR~1/pg10/include/POSTGR~1/server/port/win32 -c -o pg_rational.o pg_rational.c,...)
Putting child 0x01fd67e8 (pg_rational.o) PID 33349512 on the chain.
Live child 0x01fd67e8 (pg_rational.o) PID 33349512
In file included from C:/POSTGR~1/pg10/include/POSTGR~1/server/postgres.h:47:0,
from pg_rational.c:1:
C:/POSTGR~1/pg10/include/POSTGR~1/server/c.h:71:21: fatal error: crtdefs.h: No such file or directory
#include <crtdefs.h>
^
compilation terminated.
Reaping losing child 0x01fd67e8 PID 33349512
make: *** [pg_rational.o] Error 1
Removing child 0x01fd67e8 PID 33349512 from chain.
Any idea what I might do about this missing header?
Hm, maybe search your system to find if crtdefs.h exists anywhere. If you find it, add the path of the header's containing directory to the Makefile:
PG_CPPFLAGS = -std=c99 -Wextra -Wpedantic -IC:/path/to/dir
If you can't find that header anywhere perhaps your compiler is not installed correctly.
@NickEmpetvee did you resolve this?
@begriffs At this point I don't recall. It's been a while. I switched to Win10, and leveraged this approach to get user-specified ordering: https://wiki.postgresql.org/wiki/User-specified_ordering_with_fractions. Haven't had to revisit it.