pikelang / Pike

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.
http://pike.lysator.liu.se/
Other
194 stars 34 forks source link

Fails to compile on macOS #38

Closed mohd-akram closed 7 months ago

mohd-akram commented 2 years ago

I get this error when trying to compile:

#### Making dynamic: modules/Gz
Compiling modules/Gz/zlibmod.c
Compiling svalue.c
/Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz/zlibmod.c:1235:5: error: implicit declaration of function 'pop_n_elems' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pop_n_elems(args);
    ^
/Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz/zlibmod.c:1239:5: error: implicit declaration of function 'push_int' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    push_int(
    ^
/Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz/zlibmod.c:1249:5: error: implicit declaration of function 'pop_n_elems' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pop_n_elems(args);
    ^
/Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz/zlibmod.c:1251:5: error: implicit declaration of function 'push_int' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    push_int(
    ^
4 errors generated.
Compilation command was:
/Users/user/Downloads/Pike-v8.0.1738/build/darwin-21.6.0-x86_64/smartlink gcc -I. -I/Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz -I/Users/user/Downloads/Pike-v8.0.1738/build/darwin-21.6.0-x86_64 -I/Users/user/Downloads/Pike-v8.0.1738/src   -I/opt/local/include -I/usr/local/include -I/opt/pkg/include -DHAVE_CONFIG_H  -g -ggdb -m64  -mrdrnd -fvisibility=hidden -O3 -pipe -W -Wall -Wno-unused -Wcomment -Wformat -Wformat-security -Wimplicit-function-declaration -Wmultichar -Wunused-function -Wswitch -Wuninitialized -Wpointer-arith -Wchar-subscripts -Wno-long-long -Wdeclaration-after-statement  -fPIC -DDYNAMIC_MODULE -c /Users/user/Downloads/Pike-v8.0.1738/src/modules/Gz/zlibmod.c -o zlibmod.o
make[6]: *** [zlibmod.o] Error 1
grubba commented 10 months ago

Looks like configure did not find zlib.h.

mohd-akram commented 7 months ago

I looked into this more, the problem seems to be the failing gz_test.c during the configure stage. It prints inflate should report DATA_ERROR. I'm on macOS Sonoma 14.3 (Intel). I compiled and ran the test file manually as well, and this happens with the system zlib (v1.2.12), as well as zlib from MacPorts (v1.3.1).

mohd-akram commented 7 months ago

Looks like this was changed in the upstream example code. The gz_test.c file is currently ancient and should be updated to match the upstream example.

grubba commented 7 months ago

This looks like an issue that was fixed for Pike 8.0 in cea2e25e7cf493a94b736accc3a2e20d1eb861b7, in which case it is fixed in Pike 8.0.1760 or later.

grubba commented 7 months ago

FYI: More recent releases of Pike 8.0 than 8.0.1738 are available from https://pike.lysator.liu.se/download/pub/pike/alpha/ .