Porting newLISP (AIX)

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

Just for your info

Code: Select all

# 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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

It lost the include of alloca.h. I uploaded a new newlisp-10.0.3.tgz in your place with a changed newlisp.h.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

I would change the following line

Code: Select all

# makefile for newLISP v. 10.x.x on SOLARIS woth UTF-8 support on Sparc CPU
in both make files to

Code: Select all

# 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

Code: Select all

mv makefile_aixLP64_utf8_xlc makefile_aix_utf8_xlcLP64
and then change

Code: Select all

$(OBJS): primes.h protos.h makefile_aixLP64_utf8_xlc
in makefile_aix_utf8_xlcLP64 to

Code: Select all

$(OBJS): primes.h protos.h makefile_aix_utf8_xlcLP64
Here is the output of compilation runs that looks pretty good:-)

Code: Select all

# 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

Code: Select all

# 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?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I changed to this:

Code: Select all

aix64:
    gmake -f makefile_aixLP64_utf8_xlc
in Makefile, as all makefile_xxx put the memory model-id: LP64 after the platform name. I also changed from Sparc to PowerPC in the aix makefiles.

Memory mapping is used in 'share' and in the Cilk multiprocessing API consisting of the functions 'spawn, 'sync' and 'abort'. The Cilk API is an extreme convenient standard for doing multiprocessing. I would love this to work.

To fix this one would have to study the docs/man pages for mmap() and munmap(). The mmap() call takes a load of different flags (modes) which may be platform sensitive and memory-model sensitive. I am pretty confident, that with a little bit of reading and experimentation this can be fixed for xlc_r 32-bit.

Another important parameter in mmap() is the pagesize. In newlisp.c the pagesize is aquired in line 585 with a getpagesize() call.

Here is a little test program to check memory mapping (used for sharing memory) on your machine:

Code: Select all

~> cat test-mmap.c 
#include <stdio>
#include <sys>

int main(int argc, char ** argv)
{
void * address;
int pagesize;

pagesize = getpagesize();

printf("pagesize: %d\n", pagesize);

address = mmap( 0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);

printf("address:0x%X\n", address);
}


~> gcc -m32 test-mmap.c -o test-mmap
~> ./test-mmap 
pagesize: 4096
address:0x8000
~> 
You could try different flags and the xlc_r compiler with 32-bit memory model. I have this test program included in the distribution as util/test-mmap.c

Once mmap() works the Cilk API in newLISP is tested using qa-cilk, it launches 41 processes and gives memory mapping a good workout.

Another newlisp-10.0.3.tgz is in the usual place. The only changes I made are in the makefiles and the new test-mmap.c in util/. Thanks for the help! Looks like we are getting there :)

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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):

Code: Select all

#================== 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):

Code: Select all

#==================== 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:

Code: Select all

...
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):

Code: Select all

# 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!

Code: Select all

              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.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

I was just curious and performed the qa-cilk test for 32bit version of gcc and xlc.
Here are the results:

Code: Select all

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

Code: Select all

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, as it turns out the Cilk API always worked on AIX, only 'share' was affected. As it turns out from your results using test-mmap.c, the mmmap() function was working Ok in all compile flavors. The problem was only with the 'share' function in different portions of the code.

After a fix, 'share' should now work on AIX in all flavors too.

I posted/emailed a new newlisp-10.0.3.tgz in/to the usual places.

Looks like we will have both compilers and 32-bit and 64-bit supported on AIX :-)

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

Congratulation!
It works now out of the box:-)
Here is the output of all runs:

Code: Select all

====================== 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:

Code: Select all

# 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?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Great news. The 'net-eval' fail is probably a timeout issue, it may go away by just repeating the test or executing "./newlisp net-eval" on its own.

Try out manually:

Code: Select all

~/newlisp-10.0.3> ./newlisp -c -d 12345 &
[1] 11283
~/newlisp-10.0.3> ./newlisp
newLISP v.10.0.3 on OSX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "127.0.0.1" 12345 "(+ 3 4)")
7
> 
if this works then the timeouts are too small in 66 and 70 in qa-net

If this does not work try this:

Code: Select all

~/newlisp-10.0.3> ./newlisp -c -d 12345 &
[1] 11301
~/newlisp-10.0.3> telnet 127.0.0.1 12345
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
(symbols) <-- after connecting enter any expression to evaluate
(! != $ $0 $1 $10 $11 $12 ... lots of output ... xml-type-tags zero? | ~)
This checks if server mode works at all using telnet.
Last edited by Lutz on Sat Mar 14, 2009 12:00 pm, edited 2 times in total.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... I am surprised we see:

Code: Select all

Server already running ... 
waiting for server ... 
We should see:

Code: Select all

Starting server on localhost
waiting for server ...
why does it say the server is already running? Perhaps something else on your machine using port 10001, which is the port qa-net uses for newLISP server mode. This makes the client process think there is newLISP already on the server side.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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:

Code: Select all

# ./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

Code: Select all

#./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?!

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, I meant qa-net (now corrected in the post).

The next test is the following (manually):

Code: Select all

> (net-eval "localhost" 4711 "(abc)")
"\nERR: invalid function : (abc)\n"
> 
and in qa-net line 75, the output is checked to be correct. This checks if the servermode can recover the network connection after going through and initialization and resettting routine. You could check this manually by connecting to the server with telnet (as shown earlier) and enter: (abc) and it should come back with a an error message, and another command, e.g. (symbols) should still work.

We basically would have to go through all of qa-net's routines manually to find out what the problem is. I have seen qa-net fail only in the places where (sleep ..) statements are inserted, and only on older slower machines, or when running in VM environments like Virtual Box.

There are also a examples/server and examples/client test programs in the source distribution. Start the server first without parameters, then the client with only: localhost as argument in another peocess. Lines entered in the client will be sent back uppercased by the server. The programs use the port 1111:

Code: Select all

~/newlisp-10.0.3/examples> ./server &
[1] 12998
~/newlisp-10.0.3/examples> 
Server started

~/newlisp-10.0.3/examples> ./client localhost

Connected!

input or 'quit' to exit:sdkjfghsldkjgh
received:sdkjfghsldkjgh

SDKJFGHSLDKJGH
input or 'quit' to exit:
These two programs also do a test of basic networking functions. Practically all of what is in there is also tested in qa-dot already. So I assume, its something peculiar about server mode in qa-net.

Another basic test for server mode would be, to start the server, just like before, but in a directory containing some HTML files. You should then be able to put http://localhost:12345/thePage.html in a web browser and see the page.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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:

Code: Select all

# ./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:

Code: Select all

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

It would be interesting to know if the server still reacts to 'net-eval' with {(+ 3 4)} correctly after you have a 'nil' return.

Also after it returned with 'nil' do a: (net-error) and then a: (sys-error) to see error information from newLISP's own routines and perhaps from AIX when using: (sys-error).

Before that clear 'sys-error' to 0 by doing a: (sys-error 0), to be sure that the system error you get is not from something you did earlier.

When a 'net-xxx' routines returns 'nil' it is always an error condition, which can be checked for with 'net-error'. Sometimes 'sys-error' offers additional OS information.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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:

Code: Select all

# ./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:

Code: Select all

   +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.
Last edited by nitralime on Sat Mar 14, 2009 6:39 pm, edited 1 time in total.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Any idea why we don't get back the expected error message?
Thats the crucial point. A timeout doesn't help here. That's why I want you do do the other tests, confirming the timeout with: (net-error), looking for AIX system error messages and finding out if the server is still reacting after the timeout. I guess it will not be responsive. Is it down? Use the Unix utility ps to see what it is doing. At this moment I have no idea why it doesn't come back with an error message.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

I have started newlisp as follows

Code: Select all

# ./newlisp -L./test_run.log -c -d 12321
And in another terminal done my tests

Code: Select all

# ./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:

Code: Select all

# 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:

Code: Select all

-----------
Server side
-----------
# cd examples
# ../newlisp server

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

Code: Select all

-----------
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:

Code: Select all

<html>
<head>Hello</head>
<body>
FISCHERS FRITZ FISCHT FRISCHE FISCHE
</body>
</html>
and opened the url http://myserver:12321/test.html in my browser
from another PC in another network and got

Code: Select all

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!!

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks for all the testing, the picture is getting clearer now. Adding the sever log was also a good idea. If the last text is literaly, what you see in the browser:

Code: Select all

HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE
then something is eating line-feeds between the server and the client and the browser. The HTTP header should not be visible in the browser and seems to be merged with the content. Only content between body tags should be visible. This could happen if line feeds are removed. What we should see in the browser is just:

Code: Select all

Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE
Also the Content length with 86 is exactly the content-length of "test.html" with line-feeds removed. The header is written by newLISP server, that means that when it reads the file: test.html, it already got it without line-feeds. Try this in newLISP:

Code: Select all

(length (read-file "test.html"))
It should give the file size, in my case 92. The same number you see, should be the number in Content-length.

Also lets try the following:

Code: Select all

~/newlisp-10.0.3> ./newlisp -c -d 12321 &
[1] 14659
~/newlisp-10.0.3> telnet localhost 12321
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
(abc)

ERR: invalid function : (abc)
(append "fischers\r\n" "fritz\n")
"fischers\r\nfritz\n"

Lets check both CR-LF and LF only.

As you, I believe that your AIX compiled version, is generally Ok, except for (1) server mode, where the error message/string disappears. (2) HTTP content arriving at the browser with line-feeds removed. Maybe generally loosing line feeds when reading files?

Probably both things are related! Does AIX use special line feed characters? What does a HEX dump of test.html look like?
Last edited by Lutz on Sun Mar 15, 2009 7:57 pm, edited 1 time in total.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

Yes, I got exactly this output

Code: Select all

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.

Code: Select all

# ./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 FISCHE\n</body>\n</html>\n"
> (length s)
86
>
Why do you mean that the result should be 92? Maybe because of "\r\n" instead of just "\n"?
Telnet test leads to

Code: Select all

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


ERR: invalid function : (abc)
(append "fischers\r\n" "fritz\n")

"fischers\r\nfritz\n"
And here is the HEX dump of "test.html"

Code: Select all

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?!

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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):

Code: Select all

-----------------
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]

Code: Select all

------------------
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]

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, 86 seems to be right. When I copy/pasted the test.html from the forum I got a trailing space after each line, so: 86 + 6 -> 92. But still, the browser should only show "Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE". See your file served by Apache here: http://www.newlisp.org/test.html This is how it appears also on non-AIX systems when served with newLISP server. Somehow on the AIX machine the HTTP header gets merged with the message.

In the hex-dump and telnet session everything is Ok.

This is weird. With neither compiler we see the error message coming back, but with GCC at least we get the "5" back. In both cases the log shows that the "5" has been sent (error messages don't get logged currently, but I will add this).

I wonder if things change if server and client are on different computers?

To get further to the ground of this, one would have to watch the TCP traffic, compile with debug-statements etc.

I guess we have to leave stop our experiments here. If I get hold of an AIX machine one day, I can investigate further. I believe for non-server modes you should be fine with either compile of newLISP.

nitralime
Posts: 21
Joined: Wed Mar 04, 2009 4:04 pm

Post by nitralime »

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!

hugh.jf.chen
Posts: 7
Joined: Sun Aug 11, 2013 3:50 pm

Re: Porting newLISP (AIX)

Post by hugh.jf.chen »

I tried to build newlisp on AIX days ago. I managed to build it successfully after having cleaned up some macro statement in nl_filesystem.c and the result executable, newlisp, runs just fine in the machine where I built newlisp. However,when I copy the executable newlisp to another aix box and try to launch it, it just hung there and doesn't give me the prompt. After I press ctrl+c,it give me a option list with continue,abort,etc and I presss (c)ontinue, then the newlisp prompt just show up. Does any one meet such a problem and have any clue how to fix it?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Porting newLISP (AIX)

Post by Lutz »

What makefile are you using? There are two in the distribution, but I have never used them myself.

If you do a grep AIX *.c *.h, you will see all the changes for AIX already present. We can add your changes for nl-filesys.c.

You also should compile and run newlisp-x.x.x/util/types.c to check conformance of your AIX OS to either the LP64 or ILP32 memory model conventions. The expected results of running the types program can be found in types.c.

hugh.jf.chen
Posts: 7
Joined: Sun Aug 11, 2013 3:50 pm

Re: Porting newLISP (AIX)

Post by hugh.jf.chen »

I've tried the makefiles for gcc and xlc but they both generated the same result. The executale newlisp works fine on the machine I built newlisp but hung on other aix machines.

For the changes to nl_filesys.c,I will give the details once i get access to the machine.

All aix machines are 64 bits and I built it with 64 bit makefile,I just can figure out why this would happen.

Locked