Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nitralime

#1
newLISP and the O.S. /
March 16, 2009, 03:01:12 AM
I have performed the same tests with windows XP as client and AIX as server.

The result is the same as before. I don't want to bother you further.

I know that it is very difficult to make a diagnosis remotely.

I will try to solve this puzzle myself if I have more time.

Thank you very much for your kind support!
#2
newLISP and the O.S. /
March 15, 2009, 10:35:41 AM
It is still more confusing if you look at the result of the following simple tests

which I have done with both versions of newlisp 10.0.3 compiled by xlc_r and gcc (the same for 32bit):
-----------------
IBM Compile xlc_r
-----------------
# ./newlisp -L./test_run.log -c -d 12321 &
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 "(+ 2 3)" 1000)
nil
> (net-error)
nil
> (sys-error)
(0 "Error 0")
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-error)
(17 "ERR: Operation timed out")
> (sys-error)
(0 "Error 0")
>
----------------------------------------------------------
# cat test_run.log
Connected to 127.0.0.1 on Sun Mar 15 18:15:38 2009
[cmd]
(+ 2 3)(exit)
[/cmd]
5
Connected to 127.0.0.1 on Sun Mar 15 18:16:03 2009
[cmd]
(abc)(exit)
[/cmd]

------------------
GNU C Compiler gcc
------------------
# ./newlisp -L./test_run.log -c -d 12321 &
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 "(+ 2 3)" 1000)
5
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
>
----------------------------------------------------------
# cat test_run.log
Connected to 127.0.0.1 on Sun Mar 15 18:20:22 2009
[cmd]
(+ 2 3)(exit)
[/cmd]
5
Connected to 127.0.0.1 on Sun Mar 15 18:20:34 2009
[cmd]
(abc)(exit)
[/cmd]
#3
newLISP and the O.S. /
March 15, 2009, 10:00:36 AM
Yes, I got exactly this output
HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE

in my browser window.
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (define s (read-file "test.html"))
"<html>n<head>Hello</head>n<body>nFISCHERS FRITZ FISCHT FRISCHE FISCHEn</body>n</html>n"
> (length s)
86
>

Why do you mean that the result should be 92? Maybe because of "rn" instead of just "n"?

Telnet test leads to
# ./newlisp -c -d 12321 &
[1] 4902916
# telnet localhost 12321
Trying...
Connected to localhost.
Escape character is '^]'.
(abc)


ERR: invalid function : (abc)
(append "fischersrn" "fritzn")

"fischersrnfritzn"

And here is the HEX dump of "test.html"
0x3c0x680x740x6d0x6c0x3e0x0a0x3c0x680x650x61
0x640x3e0x480x650x6c0x6c0x6f0x3c0x2f0x680x65
0x610x640x3e0x0a0x3c0x620x6f0x640x790x3e0x0a
0x460x490x530x430x480x450x520x530x200x460x52
0x490x540x5a0x200x460x490x530x430x480x540x20
0x460x520x490x530x430x480x450x200x460x490x53
0x430x480x450x0a0x3c0x2f0x620x6f0x640x790x3e
0x0a0x3c0x2f0x680x740x6d0x6c0x3e0x0a

As far as I know there is nothing special about LF on AIX. It is 'n' as on any other UNIX derivate.

I have done the same tests with our working version 10.0.3 on my Mac OSX (1.5.6) and everything worked very fine. No "problems" at all!

I'm a little bit confused at this moment. What goes here wrong?!
#4
newLISP and the O.S. /
March 14, 2009, 12:43:33 PM
I have started newlisp as follows
# ./newlisp -L./test_run.log -c -d 12321
And in another terminal done my tests
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-error)
(17 "ERR: Operation timed out")
> (sys-error)
(0 "Error 0")
> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(/ 1 0)" 1000)
nil
> (net-eval "localhost" 12321 {(+ 3 4)} 5000)
7
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 50000)
nil
> (net-eval "localhost" 12321 "(* (* 4 5) (+ 30 45))" 1000)
1500
>

The content of log file:
# cat test_run.log
Connected to 127.0.0.1 on Sat Mar 14 19:53:33 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:53:46 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:54:23 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:54:38 2009
[cmd]
(/ 1 0)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:56:34 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:57:09 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:57:42 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 20:00:24 2009
[cmd]
(* (* 4 5) (+ 30 45))(exit)
[/cmd]
1500

And here is the output of server and client example:
-----------
Server side
-----------
# cd examples
# ../newlisp server

Server started
received:fischers fritz fischt frische fische
received:es hat geklappt!
received:quit

-----------
Client side
-----------
# cd examples
# ../newlisp client localhost

Connected!

input or 'quit' to exit:fischers fritz fischt frische fische

FISCHERS FRITZ FISCHT FRISCHE FISCHE
input or 'quit' to exit:es hat geklappt!

ES HAT GEKLAPPT!
input or 'quit' to exit:quit

bye bye!
input or 'quit' to exit:#

I have created the test.html file with the following content:
<html>
<head>Hello</head>
<body>
FISCHERS FRITZ FISCHT FRISCHE FISCHE
</body>
</html>

and opened the url http://myserver:12321/test.html">http://myserver:12321/test.html in my browser

from another PC in another network and got
HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE
in browser window! Considering only these tests it seems that my newlisp version on AIX should be OK!



Unfortunately the problem that we observed above is still open:-(

I have also check system logs. No trace of any errors which could eventually be related to newlisp!

Show goes on!!
#5
newLISP and the O.S. /
March 14, 2009, 07:44:10 AM
The expression (net-eval "localhost" 12321 "(abc)") causes the problem.

Without a timeout value it will be hanging!! I tried it with different timeout values:
# ./newlisp -c -d 12321 &
[1] 1069264

#./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 10000)
nil
>

It would be reasonable to add a timeout to the expression (net-eval host port "(abc)")

at line 75 in "qa-net" file:
  +74  ; test error reporting
   +75  (if (= (net-eval host port "(abc)") "nERR: invalid function : (abc)n")
   +76          (set 'result2 (println "net-eval error reporting ->OK"))
   +77          (println "net-eval problem with error reporting ->ERROR"))

Any idea why we don't get back the expected error message?



I will also do the other tests that you have mentioned.
#6
newLISP and the O.S. /
March 14, 2009, 06:08:35 AM
The expression (net-eval "localhost" 12321 "(abc)") causes the problem.

Without a timeout value it will be hanging!! I treid it with different timeout values:
# ./newlisp -c -d 12321 &
[1] 1069264

#./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 10000)
nil
>

It would be reasonable to add a timeout to the expression (net-eval host port "(abc)")

at line 75 in "qa-net" file:
  +74  ; test error reporting
   +75  (if (= (net-eval host port "(abc)") "nERR: invalid function : (abc)n")
   +76          (set 'result2 (println "net-eval error reporting ->OK"))
   +77          (println "net-eval problem with error reporting ->ERROR"))

Any idea why we don't get back the expected error message?



I will also do the other tests that you have mentioned.
#7
newLISP and the O.S. /
March 14, 2009, 04:40:37 AM
I'm sorry that I didn't pay due attention to "Server already running ..." message myself.

The port 10001 as SCP configuration port on AIX is already in use. I changed the port

to 12321 in qa-comma, qa-dot and qa-net files and started the qa-net test manually.

It works as expected:
# ./newlisp -c -d 12321 &
[1] 5452018
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "127.0.0.1" 12321 "(+ 3 4)")
7
> (exit)
#

But
#./newlisp qa-net

target URL: http://localhost:12321//tmp/newlisp-10.0.3/qa-junk.txt
host: localhost
port: 12321
path: /tmp/newlisp-10.0.3/qa-junk.txt
Starting server on localhost
waiting for server ...
net-eval normal mode ->OK

is hanging again! Any idea?

By the way what/where is net-eval.c file? Maybe you have meant qa-net?!
#8
newLISP and the O.S. /
March 13, 2009, 09:31:21 AM
Congratulation!

It works now out of the box:-)

Here is the output of all runs:
====================== xlc_r (32bit) =======================
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aixLP64_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
OBJECT_MODE=64 xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5626

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5357676 1069250 4178148 5156980 2875452 4014164 5550282 5541938 2150542 4124856)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5357680 p1:400
pid: 1069254 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

====================== xlc_r (64bit) =======================
# gmake aix64
gmake -f makefile_aixLP64_utf8_xlc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
OBJECT_MODE=64 xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5622

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (4825322 4083744 2887814 4489406 4444260 5156966 761898 4329518 1732730 2363604)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 4825326 p1:400
pid: 4083748 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

======================= gcc (32bit) ========================
gmake aix_gcc
gmake -f makefile_aix_utf8_gcc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
gcc  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5574

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5017634 4001928 4661376 5124250 4825114 4567256 1970358 4096020 4362456 4313180)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5017638 p1:400
pid: 4001932 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

======================= gcc (64bit) ========================
# gmake aix64_gcc
gmake -f makefile_aixLP64_utf8_gcc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
gcc  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -maix64 -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5640

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5541896 4124840 1069242 5357668 4313196 4325506 4284632 4087944 540726 4648974)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5541900 p1:400
pid: 4124844 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

Now I am about to start the more comprehensive test:
# gmake test
./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5992

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed
./newlisp qa-dictionary

N associations: 10000
cells before creating Lex: 80770
aquire from association list: 18 ms
time to aquire one entry: 1.800 μs
time reading and verifying entries ... : 30 ms
time to read and verify one entry: 3.000 μs
time to only read one entry: 2.200 μs
cells after creating Lex: 120783
N symbols in Lex: 10000
save to file: 482 ms
time to delete namespace: 27 ms
time to delete one symbol: 2.700 μs
cells after deleting Lex: 110787
time to load namespace: 59 ms
cells after loading Lex: 120789
time to save Lex2: 436 ms

>>>>> DICTIONARY API TESTED SUCCESSFUL

./newlisp qa-xml

testing: xml-parse and xml-type-tags
true true true true

XML API OK

Testing xml-parse with callback feature
parsed expresson:(NAME "apple"), source:<NAME>apple</NAME>
parsed expresson:(COLOR "red"), source:<COLOR>red</COLOR>
parsed expresson:(PRICE "0.80"), source:<PRICE>0.80</PRICE>
parsed expresson:(NAME "orange"), source:<NAME>orange</NAME>
parsed expresson:(COLOR "orange"), source:<COLOR>orange</COLOR>
parsed expresson:(PRICE "1.00"), source:<PRICE>1.00</PRICE>
parsed expresson:(NAME "banana"), source:<NAME>banana</NAME>
parsed expresson:(COLOR "yellow"), source:<COLOR>yellow</COLOR>
parsed expresson:(PRICE "0.60"), source:<PRICE>0.60</PRICE>


>>>>> XML CALLBACK TESTED SUCCESSFUL

./newlisp qa-setsig

..sig-1 ..sig-2 ..sig-3 ..sig-4 ..sig-5 ..sig-6 ..sig-7 ..sig-8 ..sig-10 ..sig-11 ..sig-12 ..sig-13 ..sig-14 ..sig-15 ..sig-16
sent: (1 2 3 4 5 6 7 8 10 11 12 13 14 15 16)
received: (1 2 3 4 5 6 7 8 10 11 12 13 14 15 16)

>>>>> SIGNAL TESTING SUCCESSFUL

./newlisp qa-net

target URL: http://localhost:10001//tmp/newlisp-10.0.3/qa-junk.txt
host: localhost
port: 10001
path: /tmp/newlisp-10.0.3/qa-junk.txt
Server already running ...
waiting for server ...
net-eval poblem with normal mode ->ERROR

and it is hanging here:-(

Any idea?
#9
newLISP and the O.S. /
March 13, 2009, 06:40:53 AM
I was just curious and performed the qa-cilk test for 32bit version of gcc and xlc.

Here are the results:
------------------------
IBM Compiler xlc (32bit)
------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (4792460 4280556 1069190 4083820 5017818 4001856 4489308 1732826 4178154 4534368)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 4280560 p1:400
pid: 4792464 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

--------------------------
GNU C Compiler gcc (32bit)
--------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_gcc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX newlisp.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-symbol.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-math.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-list.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-liststr.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-string.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-filesys.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-sock.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-import.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-xml.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-web.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-matrix.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-debug.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-utf8.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX pcre.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5210178 3985454 4087876 5427248 2719950 1069220 2875640 5550318 4284462 4792348)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5210182 p1:400
pid: 3985458 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

Does it mean that Cilk API is OK?

The 64bit versions also return the same result.
#10
newLISP and the O.S. /
March 13, 2009, 06:19:24 AM
Thank you for implementing the modifications!

I have tested the new version and it works fine. I have also tried the 64bit version of gcc.

It also works fine. Last time I have forgotten to add the option -DNEWLISP64 to CFLAGS and

this was the reason why I got the segmentation fault! That means that gcc is on a par with xlc!

For the sake of completeness I append the make file that I used for gcc (64bit):
#================== makefile_aixLP64_utf8_gcc (64bit)==========================
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

# use following for UTF-8 support and add nl-utf8.o to the OBJS line
CFLAGS = -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX
CC = gcc

default: $(OBJS)
        $(CC) $(OBJS) -maix64 -lm  -ldl -lrt -lnsl -o newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_aixLP64_utf8_gcc
#
#==============================================================================

And here is the 32bit version for gcc (to facilitate Copy&Paste if necessary):
#==================== makefile_aix_utf8_gcc (32bit)============================
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

# use following for UTF-8 support and add nl-utf8.o to the OBJS line
CFLAGS = -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX
CC = gcc

default: $(OBJS)
        $(CC) $(OBJS) -lm  -ldl -lrt -lnsl -o newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_aix_utf8_gcc
#
#==============================================================================

I would suggest that we modify the Makefile such that both compiler types can be used:
...
aix64:
        gmake -f makefile_aixLP64_utf8_xlc

aix:
        gmake -f makefile_aix_utf8_xlc

aix64_gcc:
        gmake -f makefile_aixLP64_utf8_gcc

aix_gcc:
        gmake -f makefile_aix_utf8_gcc
...

or something like this.

Here is the output of test-map for both gcc and xlc (64bit/32bit):
# gcc -maix64 test-mmap.c -o test-mmap
# ./test-mmap
pagesize: 4096
address:0x0
# xlc -q64 test-mmap.c -o test-mmap
# ./test-mmap
pagesize: 4096
address:0x0
# gcc test-mmap.c -o test-mmap
# ./test-mmap
pagesize: 4096
address:0x30000000
# xlc  test-mmap.c -o test-mmap
# ./test-mmap
pagesize: 4096
address:0x30000000

I agree with you on Cilk API. I find the language features regarding concurrency

and distribution very important from practical point of view (we live in the world

of multicore systems and cocurrency is omnipresent!!)

I have appended the AIX manpage for mmap. Maye it helps!  
             Technical Reference: Base Operating System and Extensions, Volume 1

mmap or mmap64 Subroutine

Purpose

       Maps a file-system object into virtual memory.

Library

       Standard C library (libc.a)

Syntax

       #include <sys/types.h>
       #include <sys/mman.h>

       void *mmap (addr, len, prot, flags, fildes, off)

       void * addr;

       size_t  len;

       int  prot,  flags,  fildes;

       off_t  off;

       void *mmap64 (addr, len, prot, flags, fildes, off)

       void * addr;

       size_t  len;

       int  prot,  flags,  fildes;

       off64_t  off;

Description
       Attention: A file-system object should not be simultaneously mapped using both the mmap
       and shmat subroutines. Unexpected results may occur when references are made beyond the
       end of the object.

       The mmap subroutine creates a new mapped file or anonymous memory region by establishing
       a mapping between a process-address space and a file-system object. Care needs to be
       taken when using the mmap subroutine if the program attempts to map itself. If the page
       containing executing instructions is currently referenced as data through an mmap
       mapping, the program will hang. Use the -H4096 binder option, and that will put the
       executable text on page boundaries. Then reset the file that contains the executable
       material, and view via an mmap mapping.

       A region created by the mmap subroutine cannot be used as the buffer for read or write
       operations that involve a device. Similarly, an mmap region cannot be used as the buffer
       for operations that require either a pin or xmattach operation on the buffer.

       Modifications to a file-system object are seen consistently, whether accessed from a
       mapped file region or from the read or write subroutine.

       Child processes inherit all mapped regions from the parent process when the fork
       subroutine is called. The child process also inherits the same sharing and protection

       attributes for these mapped regions. A successful call to any exec subroutine will unmap
       all mapped regions created with the mmap subroutine.

       The mmap64 subroutine is identical to the mmap subroutine except that the starting
       offset for the file mapping is specified as a 64-bit value. This permits file mappings
       which start beyond OFF_MAX.

       In the large file enabled programming environment, mmap is redefined to be mmap64.

       If the application has requested SPEC1170 compliant behavior then the st_atime field of
       the mapped file is marked for update upon successful completion of the mmap call.

       If the application has requested SPEC1170 compliant behavior then the st_ctime and
       st_mtime fields of a file that is mapped with MAP_SHARED and PROT_WRITE are marked for
       update at the next call to msync subroutine or munmap subroutine if the file has been
       modified.

Parameters

       addr
            Specifies the starting address of the memory region to be mapped. When the
            MAP_FIXED flag is specified, this address must be a multiple of the page size
            returned by the sysconf subroutine using the _SC_PAGE_SIZE value for the Name
            parameter. A region is never placed at address zero, or at an address where it
            would overlap an existing region.
       len
            Specifies the length, in bytes, of the memory region to be mapped. The system
            performs mapping operations over whole pages only. If the len parameter is not a
            multiple of the page size, the system will include in any mapping operation the
            address range between the end of the region and the end of the page containing the
            end of the region.
       prot
            Specifies the access permissions for the mapped region. The sys/mman.h file defines
            the following access options:
              PROT_READ
                   Region can be read.
              PROT_WRITE
                   Region can be written.
              PROT_EXEC
                   Region can be executed.
              PROT_NONE
                   Region cannot be accessed.
            The prot parameter can be the PROT_NONE flag, or any combination of the PROT_READ
            flag, PROT_WRITE flag, and PROT_EXEC flag logically ORed together. If the PROT_NONE
            flag is not specified, access permissions may be granted to the region in addition
            to those explicitly requested. However, write access will not be granted unless the
            PROT_WRITE flag is specified. Note: The operating system generates a SIGSEGV signal
            if a program attempts an access that exceeds the access permission given to a
            memory region. For example, if the PROT_WRITE flag is not specified and a program
            attempts a write access, a SIGSEGV signal results.

            If the region is a mapped file that was mapped with the MAP_SHARED flag, the mmap
            subroutine grants read or execute access permission only if the file descriptor
            used to map the file was opened for reading. It grants write access permission only
            if the file descriptor was opened for writing.

            If the region is a mapped file that was mapped with the MAP_PRIVATE flag, the mmap
            subroutine grants read, write, or execute access permission only if the file
            descriptor used to map the file was opened for reading. If the region is an

            anonymous memory region, the mmap subroutine grants all requested access
            permissions.
       fildes
            Specifies the file descriptor of the file-system object or of the shared memory
            object to be mapped. If the MAP_ANONYMOUS flag is set, the fildes parameter must be
            -1. After the successful completion of the mmap subroutine, the file or the shared
            memory object specified by the fildes parameter can be closed without affecting the
            mapped region or the contents of the mapped file. Each mapped region creates a file
            reference, similar to an open file descriptor, which prevents the file data from
            being deallocated. Note: The mmap subroutine supports the mapping of shared memory
            object and regular files only. An mmap call that specifies a file descriptor for a
            special file fails, returning the ENODEV error code. An example of a file
            descriptor for a special file is one that might be used for mapping either I/O or
            device memory.
       off
            Specifies the file byte offset at which the mapping starts. This offset must be a
            multiple of the page size returned by the sysconf subroutine using the
            _SC_PAGE_SIZE value for the Name parameter.
       flags
            Specifies attributes of the mapped region. Values for the flags parameter are
            constructed by a bitwise-inclusive ORing of values from the following list of
            symbolic names defined in the sys/mman.h file:
              MAP_FILE
                   Specifies the creation of a new mapped file region by mapping the file
                   associated with the fildes file descriptor. The mapped region can extend
                   beyond the end of the file, both at the time when the mmap subroutine is
                   called and while the mapping persists. This situation could occur if a file
                   with no contents was created just before the call to the mmap subroutine, or
                   if a file was later truncated. However, references to whole pages following
                   the end of the file result in the delivery of a SIGBUS signal. Only one of
                   the MAP_FILE and MAP_ANONYMOUS flags must be specified with the mmap
                   subroutine.
              MAP_ANONYMOUS
                   Specifies the creation of a new, anonymous memory region that is initialized
                   to all zeros. This memory region can be shared only with the descendants of
                   the current process. When using this flag, the fildes parameter must be -1.
                   Only one of the MAP_FILE and MAP_ANONYMOUS flags must be specified with the
                   mmap subroutine.
              MAP_ VARIABLE
                   Specifies that the system select an address for the new memory region if the
                   new memory region cannot be mapped at the address specified by the addr
                   parameter, or if the addr parameter is null. Only one of the MAP_VARIABLE
                   and MAP_FIXED flags must be specified with the mmap subroutine.
              MAP_FIXED
                   Specifies that the mapped region be placed exactly at the address specified
                   by the addr parameter. If the application has requested SPEC1170 complaint
                   behavior and the mmap request is successful, the mapping replaces any
                   previous mappings for the process' pages in the specified range. If the
                   application has not requested SPEC1170 compliant behavior and a previous
                   mapping exists in the range then the request fails. Only one of the
                   MAP_VARIABLE and MAP_FIXED flags must be specified with the mmap subroutine.
              MAP_SHARED
                   When the MAP_SHARED flag is set, modifications to the mapped memory region
                   will be visible to other processes that have mapped the same region using
                   this flag. If the region is a mapped file region, modifications to the
                   region will be written to the file.

                   You can specify only one of the MAP_SHARED or MAP_PRIVATE flags with the
                   mmap subroutine. MAP_PRIVATE is the default setting when neither flag is

                   specified unless you request SPEC1170 compliant behavior. In this case, you
                   must choose either MAP_SHARED or MAP_PRIVATE.
              MAP_PRIVATE
                   When the MAP_PRIVATE flag is specified, modifications to the mapped region
                   by the calling process are not visible to other processes that have mapped
                   the same region. If the region is a mapped file region, modifications to the
                   region are not written to the file.

                   If this flag is specified, the initial write reference to an object page
                   creates a private copy of that page and redirects the mapping to the copy.
                   Until then, modifications to the page by processes that have mapped the same
                   region with the MAP_SHARED flag are visible.

                   You can specify only one of the MAP_SHARED or MAP_PRIVATE flags with the
                   mmap subroutine. MAP_PRIVATE is the default setting when neither flag is
                   specified unless you request SPEC1170 compliant behavior. In this case, you
                   must choose either MAP_SHARED or MAP_PRIVATE.
Return Values

       If successful, the mmap subroutine returns the address at which the mapping was placed.
       Otherwise, it returns -1 and sets the errno global variable to indicate the error.

Error Codes

       Under the following conditions, the mmap subroutine fails and sets the errno global
       variable to:
       EACCES
            The file referred to by the fildes parameter is not open for read access, or the
            file is not open for write access and the PROT_WRITE flag was specified for a
            MAP_SHARED mapping operation. Or, the file to be mapped has enforced locking
            enabled and the file is currently locked.
       EAGAIN
            The fildes parameter refers to a device that has already been mapped.
       EBADF
            The fildes parameter is not a valid file descriptor, or the MAP_ANONYMOUS flag was
            set and the fildes parameter is not -1.
       EFBIG
            The mapping requested extends beyond the maximum file size associated with fildes.
       EINVAL
            The flags or prot parameter is invalid, or the addr parameter or off parameter is
            not a multiple of the page size returned by the sysconf subroutine using the
            _SC_PAGE_SIZE value for the Name parameter.
       EINVAL
            The application has requested SPEC1170 compliant behavior and the value of flags is
            invalid (neither MAP_PRIVATE nor MAP_SHARED is set).
       EMFILE
            The application has requested SPEC1170 compliant behavior and the number of mapped
            regions would excedd and implementation-dependent limit (per process or per
            system).
       ENODEV
            The fildes parameter refers to an object that cannot be mapped, such as a terminal.
       ENOMEM
            There is not enough address space to map len bytes, or the application has not
            requested Single UNIX Specification, Version 2 compliant behavior and the MAP_FIXED
            flag was set and part of the address-space range (addr, addr+len) is already
            allocated.
       ENXIO
            The addresses specified by the range (off, off+len) are invalid for the fildes
            parameter.

       EOVERFLOW
            The mapping requested extends beyond the offset maximum for the file description
            associated with fildes.

Related Information

       The exec (exec: execl, execle, execlp, execv, execve, execvp, or exect Subroutine)
       subroutine, fork (fork, f_fork, or vfork Subroutine) subroutine, munmap (munmap
       Subroutine) subroutine, read subroutine, shm_open subroutine, shm_unlink subroutine,
       shmat subroutine, sysconf subroutine, write subroutine.

       The pin kernel service, xmattach kernel service.

       List of Memory Manipulation Services, List of Memory Mapping Services, Understanding
       Memory Mapping in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging
       Programs.
#11
newLISP and the O.S. /
March 12, 2009, 12:55:53 PM
I would change the following line
# makefile for newLISP v. 10.x.x on SOLARIS woth UTF-8 support on Sparc CPU
in both make files to
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
and do the following renaming in order to be consistent with the entry in Makefile
mv makefile_aixLP64_utf8_xlc makefile_aix_utf8_xlcLP64
and then change  
$(OBJS): primes.h protos.h makefile_aixLP64_utf8_xlc
in makefile_aix_utf8_xlcLP64 to
$(OBJS): primes.h protos.h makefile_aix_utf8_xlcLP64
Here is the output of compilation runs that looks pretty good:-)
# gmake aixLP64
gmake -f makefile_aix_utf8_xlcLP64
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
OBJECT_MODE=64 xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'
# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5700

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'
# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5522

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

>>>> share failed ERR: not enough memory in function share
called from user defined function QA:unix-test-share
called from user defined function QA:qa
UTF-8 upper-case: failed
UTF-8 lower-case: failed

Testing contexts as objects and scoping rules ...

total time: 7435

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

>>>> share failed ERR: not enough memory in function share
called from user defined function QA:unix-test-share
called from user defined function QA:qa
UTF-8 upper-case: failed
UTF-8 lower-case: failed

As you see the problem with "share" exists also for xlc_r in 32bit mode.

I would make 64bit the default choice for compilation on AIX for the time being!

Do you have any idea where  we should begin to fix this problem?

How critical is it?
#12
newLISP and the O.S. /
March 12, 2009, 08:46:48 AM
Just for your info
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
"nl-symbol.c", line 131.7: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
"nl-math.c", line 492.13: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-math.c", line 493.16: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-math.c", line 2156.10: 1506-068 (W) Operation between types "struct {...}**" and "int" is not allowed.
"nl-math.c", line 2157.7: 1506-068 (W) Operation between types "int*" and "int" is not allowed.
"nl-math.c", line 2158.7: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-math.c", line 2358.8: 1506-068 (W) Operation between types "double*" and "int" is not allowed.
"nl-math.c", line 2359.7: 1506-068 (W) Operation between types "double*" and "int" is not allowed.
"nl-math.c", line 2360.15: 1506-068 (W) Operation between types "double*" and "int" is not allowed.
"nl-math.c", line 2365.11: 1506-068 (W) Operation between types "double*" and "int" is not allowed.
"nl-math.c", line 2366.11: 1506-068 (W) Operation between types "double*" and "int" is not allowed.
"nl-math.c", line 2398.7: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
"nl-list.c", line 1377.15: 1506-068 (W) Operation between types "unsigned long*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
"nl-filesys.c", line 2012.25: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
"nl-sock.c", line 1947.47: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
"nl-web.c", line 342.10: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-web.c", line 343.6: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-web.c", line 344.7: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-web.c", line 345.6: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
"nl-web.c", line 1274.9: 1506-068 (W) Operation between types "char*" and "int" is not allowed.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
ld: 0711-317 ERROR: Undefined symbol: .alloca
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gmake[2]: *** [default] Error 8
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: *** [aix] Error 2
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'
gmake: *** [default] Error 2
#13
newLISP and the O.S. /
March 12, 2009, 07:03:29 AM
I have upgraded my gcc installation to version 4.2.4.

Compiling with option -maix64 works but by calling ./newlisp qa-dot

I get segmentation fault. The 32bit version compiled by gcc suffers

from the same problem as before. I would say that you should

integrate just the xlc_r version into the upcoming maintenance

release. The gcc version can be provided as an alternative to xlc_r

version supplied by a remark about issues that are still open.



Thank you very much for pointing out URL. I came to this guide

as I have struggled with compiling Python on AIX:-)

Nearly the same problems (and a few more) as here.



It would give me great pleasure to support you in your effort to

improve newLISP (at least with regard to its portability).



I will do it (I mean testing newLISP 10.0.3 on AIX).

I can also test it on Solaris (SPARC) if you don't have access to it.

Where can I get it?
#14
newLISP and the O.S. /
March 11, 2009, 10:14:57 AM
After implementing your suggested modification
recvfrom(s, packet, PLEN, 0, (struct sockaddr *)&from, (socklen_t *)&fromlen)
I get now the following outputs
------------------------
IBM Compiler xlc_r 64bit
------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.2'
gmake -f makefile_aix_utf8
gmake[2]: Entering directory `/tmp/newlisp-10.0.2'
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX newlisp.c
     728  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-symbol.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-math.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-list.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-liststr.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-string.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-filesys.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-sock.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-import.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-xml.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-web.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-matrix.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-debug.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-utf8.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX pcre.c
OBJECT_MODE=64 xlc_r newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.2'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.2'

and
--------------------
GNU C Compiler (gcc)
--------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.2'
gmake -f makefile_aix_utf8
gmake[2]: Entering directory `/tmp/newlisp-10.0.2'
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX newlisp.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-symbol.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-math.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-list.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-liststr.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-string.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-filesys.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-sock.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-import.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-xml.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-web.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-matrix.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-debug.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-utf8.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX pcre.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.2'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.2'

It looks pretty good:-)

The failure of "net-lookup" test was because of an additional name for  "127.0.0.1" in my /etc/hosts file:
127.0.0.1               loopback localhost
One can check it directly:
#./newlisp
newLISP v.10.0.2 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-lookup "localhost")
"127.0.0.1"
> (net-lookup "127.0.0.1")
"loopback"
>

Regarding "UTF-8 upper-case" and "UTF-8 lower-case" tests it seems

that something is wrong with "upper-case" and "lower-case" functions.

Because I'm just a (new)LISP newbie my findings maybe totally wrong!

It seems that these functions act as identity on characters beyond

ASCII range! (I know it doesn't help you. It is just my observation.)

My locale setting:
# locale
LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=

And here is the result of my simple experiment using code fragments from qa-dot file:
# ./newlisp
newLISP v.10.0.2 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (= (length (char 937)) 2)
true
> (set-locale "en_US")
("en_US en_US en_US en_US en_US en_US" ".")
> (set 'unicodelist '(913 914 915 916 937 945 946 947 948 969 32 1040 1041 1042 1043 1044 1072 1073 1074 1075 1076 13 10))
(913 914 915 916 937 945 946 947 948 969 32 1040 1041 1042 1043 1044 1072 1073 1074 1075 1076 13 10)
> (set 'utf8str (join (map char unicodelist)))
"ÎÎÎÎÎ©Î±Î²Î³Î´Ï ÐÐÐÐÐабвгдrn"
> (= (map char (explode (upper-case utf8str))) '(913 914 915 916 937 913 914 915 916 937 32 1040 1041 1042 1043 1044 1040 1041 1042 1043 1044 13 10))
nil
> (map char (explode (upper-case utf8str)))
(913 914 915 916 937 945 946 947 948 969 32 1040 1041 1042 1043 1044 1072 1073 1074 1075 1076 13 10)
>

Do you have any idea?



Regarding your question about IBM Compiler: It is unfortunately neither free nor included by default!
#15
newLISP and the O.S. /
March 11, 2009, 03:33:55 AM
Although there are still some open issues on AIX platform, I would like

to summarize the necessary steps for compiling newLISP on AIX.



1) Depending on your C compiler you should use one of the following make files:


--------------------
GNU C Compiler (gcc)
--------------------
#============================ makefile_aix_utf8 (gcc) ==================================
#
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o


# use following for UTF-8 support and add nl-utf8.o to the OBJS line
CFLAGS = -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX
CC = gcc

default: $(OBJS)
        $(CC) $(OBJS) -lm  -ldl -lrt -lnsl -o newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_aix_utf8
#=====================================================================================


----------------------
IBM C Compiler (xlc_r)
----------------------
#========================= makefile_aix_utf8 (xlc_r) =================================
#
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
#
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o


# use following for UTF-8 support and add nl-utf8.o to the OBJS line
CFLAGS = -c -g -O2 -DSUPPORT_UTF8 -DAIX
CC = xlc_r

default: $(OBJS)
        $(CC) $(OBJS) -lm  -ldl -lrt -lnsl -o newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_aix_utf8
#=====================================================================================


and for 64bit version of newLISP


#======================= makefile_aix_utf8 (xlc_r 64bit) =============================
#
# makefile for newLISP v. 10.x.x on AIX with UTF-8 support on PowerPC CPU
#
#
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o

# use following for UTF-8 support and add nl-utf8.o to the OBJS line
CFLAGS = -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX
CC = xlc_r


default: $(OBJS)
        OBJECT_MODE=64 $(CC) $(OBJS) -lm  -ldl -lrt -lnsl -o newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h makefile_aix_utf8
#=====================================================================================


2) In "newlisp.h" insert the following lines after the line 122.

befor insert:
 +121  #include <sys/timeb.h>
  +122  #include <sys/types.h>
  +123
  +124  #ifndef SOLARIS
  +125  #ifndef _BSD
  +126  #ifndef MAC_OSX
  +127  #include <malloc.h>
  +128  #endif
  +129  #endif
  +130  #else
  +131  #include <alloca.h>
  +132  #endif

after insert:
 +121  #include <sys/timeb.h>
  +122  #include <sys/types.h>
  +123
  +124  #ifdef AIX
  +125  #define vasprintf my_vasprintf
  +126  #endif
  +127
  +128  #ifndef SOLARIS
  +129  #ifndef _BSD
  +130  #ifndef MAC_OSX
  +131  #include <malloc.h>
  +132  #endif
  +133  #endif
  +134  #else
  +135  #include <alloca.h>
  +136  #endif

3) In "newlisp.c" replace
  +69  #ifdef SOLARIS
   +70  int opsys 4
   +71  #endif
   +72
   +73  #ifdef TRU64
   +74  int opsys += 5;
   +75  #endif
   +76
   +77  #ifdef AIX
   +78  int opsys += 6;
   +79  #endif

with
  +69  #ifdef SOLARIS
   +70  #ifdef TRU64
   +71  int opsys = 9;
   +72  #endif
   +73  #ifdef AIX
   +74  int opsys = 10;
   +75  #else
   +76  int opsys = 4;
   +77  #endif
   +78  #endif

4) In "nl-filesystem.c" replace
  +25  #ifdef SOLARIS
   +26  #include <stropts.h>
   +27  #ifndef TRU64
   +28  #define FIONREAD I_NREAD
   +29  #endif
   +30  #endif

with
  +25  #ifdef SOLARIS
   +26  #include <stropts.h>
   +27  #ifndef TRU64
   +28  #ifndef AIX
   +29  #define FIONREAD I_NREAD
   +30  #endif
   +31  #endif
   +32  #endif

5) In "nl-sock.c" replace
  +60  #ifdef SOLARIS
   +61  #include <stropts.h>
   +62  #include <sys/conf.h>
   +63  #include <netinet/in_systm.h>
   +64  #define gethostbyname2(A, B) gethostbyname(A)
   +65  #ifndef TRU64
   +66  #define FIONREAD I_NREAD
   +67  #endif
   +68  #endif

with
  +60  #ifdef SOLARIS
   +61  #include <stropts.h>
   +62  #include <sys/conf.h>
   +63  #include <netinet/in_systm.h>
   +64  #define gethostbyname2(A, B) gethostbyname(A)
   +65  #ifndef TRU64
   +66  #ifndef AIX
   +67  #define FIONREAD I_NREAD
   +68  #endif
   +69  #endif
   +70  #endif

6) In "Makefile" change all occurrences of make to gmake and insert an entry for AIX make file

   after e.g. opensolaris entry:
 +142  opensolaris:
  +143          gmake -f makefile_opensolaris
  +144
  +145  aix:
  +146          gmake -f makefile_aix_utf8
  +147
  +148  mingw:
  +149          gmake -f makefile_mingw

7) in "build" change all occurrences of make to gmake and insert an entry for AIX
  +42          SunOS)
   +43                  echo  Discovered SunOS, making for Sparc CPU:
   +44                  gmake solaris
   +45                  exit
   +46                  ;;
   +47          AIX)
   +48                  echo  Discovered AIX:
   +49                  gmake aix
   +50                  exit
   +51                  ;;
   +52          OSF1)
   +53                  echo Discovered Tru64 Unix, please read doc/TRU64BUILD
   +54                  gmake -f gmakefile_tru64
   +55                  exit
   +56                  ;;

And you see here the output of compilation runs on my machine

(AIX 5.3 CPU type:PowerPC_POWER5 1.9 GHz):


----------------------------
IBM C Compiler (xlc_r 64bit)
----------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.2'
gmake -f makefile_aix_utf8
gmake[2]: Entering directory `/tmp/newlisp-10.0.2'
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX newlisp.c
     728  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-symbol.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-math.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-list.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-liststr.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-string.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-filesys.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-sock.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-import.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-xml.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-web.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-matrix.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-debug.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX nl-utf8.c
xlc_r -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX pcre.c
OBJECT_MODE=64 xlc_r newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.2'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.2'

The environment variable OBJECT_MODE=64 is necessary for 64bit version, otherwise you get the following linking error:
ld: 0711-736 ERROR: Input file newlisp.o:
        XCOFF64 object files are not allowed in 32-bit mode.


# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 8458

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

>>>> net-lookup failed nil
UTF-8 upper-case: failed
UTF-8 lower-case: failed


--------------------
GNU C Compiler (gcc)
--------------------

# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.2'
gmake -f makefile_aix_utf8
gmake[2]: Entering directory `/tmp/newlisp-10.0.2'
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX newlisp.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-symbol.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-math.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-list.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-liststr.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-string.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-filesys.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-sock.c
nl-sock.c: In function 'ping':
nl-sock.c:2060: warning: passing argument 6 of 'nrecvfrom' from incompatible pointer type
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-import.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-xml.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-web.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-matrix.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-debug.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-utf8.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX pcre.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.2'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.2'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5477

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

>>>> net-lookup failed nil
>>>> share failed ERR: not enough memory in function share
called from user defined function QA:unix-test-share
called from user defined function QA:qa
UTF-8 upper-case: failed
UTF-8 lower-case: failed

Testing contexts as objects and scoping rules ...

total time: 7364

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

>>>> net-lookup failed nil
>>>> share failed ERR: not enough memory in function share
called from user defined function QA:unix-test-share
called from user defined function QA:qa
UTF-8 upper-case: failed
UTF-8 lower-case: failed

As you see there are still some failing tests and a compilation warning.

By the way just for your information gcc doesn't accept -m64 on AIX!
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.2'
gmake -f makefile_aix_utf8
gmake[2]: Entering directory `/tmp/newlisp-10.0.2'
gcc -m64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX newlisp.c
cc1: error: invalid option '64'
gmake[2]: *** [newlisp.o] Error 1
gmake[2]: Leaving directory `/tmp/newlisp-10.0.2'
gmake[1]: *** [aix] Error 2
gmake[1]: Leaving directory `/tmp/newlisp-10.0.2'
gmake: *** [default] Error 2