begriffs / pg_rational

Precise fractional arithmetic for PostgreSQL
MIT License
238 stars 14 forks source link

Win8 - Make Failure #9

Closed NickEmpetvee closed 2 years ago

NickEmpetvee commented 5 years ago

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
begriffs commented 5 years ago

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.

NickEmpetvee commented 5 years ago

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.
NickEmpetvee commented 5 years ago

Any idea what I might do about this missing header?

begriffs commented 5 years ago

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.

begriffs commented 2 years ago

@NickEmpetvee did you resolve this?

NickEmpetvee commented 2 years ago

@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.