From John.Velman@HSC.com Sat May 12 01:04:51 2001
Received: from slb-smtpout-01.boeing.com (slb-smtpout-01.boeing.com [12.13.237.21])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f4BN4o318918
	for <prolog@swi.psy.uva.nl>; Sat, 12 May 2001 01:04:50 +0200 (MET DST)
Received: from smtp2.hughes.com (smtp2-nat.HUGHES.COM [128.152.20.82])
	by slb-smtpout-01.boeing.com (8.9.2/8.8.5-M2) with ESMTP id QAA06485
	for <prolog@swi.psy.uva.nl>; Fri, 11 May 2001 16:04:44 -0700 (PDT)
From: John.Velman@HSC.com
Received: from ishs01.hsc.com (ishs01.hsc.com [147.20.2.20])
	by smtp2.hughes.com (8.10.2/8.9.1) with ESMTP id f4BN4Hx17037
	for <prolog@swi.psy.uva.nl>; Fri, 11 May 2001 16:04:17 -0700 (PDT)
Received: from es-s25-mta5.hughes.com (es-s25-mta5.HUGHES.COM [147.20.30.24])
	by ishs01.hsc.com (8.10.2/8.9.1) with ESMTP id f4BN4Gg12788
	for <prolog@swi.psy.uva.nl>; Fri, 11 May 2001 16:04:16 -0700 (PDT)
Subject: Re: [SWIPL] compile SWI Prolog on cygwin?
To: prolog@swi.psy.uva.nl
Date: Fri, 11 May 2001 16:04:13 -0700
Message-ID: <OF39431DC3.8A9BC2BE-ON88256A49.007E99B4@hughes.com>
X-MIMETrack: Serialize by Router on MTA00/HUGHES(Release 5.0.5 |September 22, 2000) at
 05/11/2001 04:04:16 PM
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii



Jan,

To follow up -- I did as you suggested, and make
(and make install) completed successfully.

And, works!

I don't think the disadvantage of not having mapped
stacks will bother me for now.  If I ever have time,
:-)   I'll look into this.

Thanks!

John Velman





Jan Wielemaker <jan@swi.psy.uva.nl> on 05/11/2001 01:07:20 AM

To:    John.Velman@hsc.com, prolog@swi.psy.uva.nl
cc:

Subject:  Re: [SWIPL] compile SWI Prolog on cygwin?


On Fri, 11 May 2001, John.Velman@HSC.com wrote:
>I've attempted to compile pl-4.0.4 under cygwin 1.3.1-1
>(the most recent).
>
>Readline gave me a problem, namely, the last part of
>the make output was:
>

>pl-rl.o(.text+0x1c1):pl-rl.c: undefined reference to `rl_event_hook'
>pl-rl.o(.text+0x1ce):pl-rl.c: undefined reference to `rl_event_hook'
>collect2: ld returned 1 exit status
>make: *** [pl] Error 1

This is a hook that allows SWI-Prolog to look for X11 events on behalf
of XPCE.  I don't think that will work.  I've added a test for the
existence of this hook.  See CVS version (get configure, config.h.in and
pl-rl.c)

>ar x `gcc -print-libgcc-file-name` frame.o
>gcc  -o pl -Lrc pl-atom.o pl-wam.o pl-stream.o pl-error.o pl-arith.o
pl-bag.o pl
>-comp.o pl-rc.o pl-dwim.o pl-ext.o pl-file.o pl-flag.o pl-fmt.o pl-funct.o
pl-gc
>.o pl-glob.o pl-itf.o pl-list.o pl-load.o pl-modul.o pl-op.o pl-os.o
pl-prims.o
>pl-pro.o pl-proc.o pl-prof.o pl-read.o pl-rec.o pl-rl.o pl-setup.o
pl-sys.o pl-t
>able.o pl-trace.o pl-util.o pl-wic.o pl-write.o pl-term.o pl-buffer.o
pl-thread.
>o pl-xterm.o pl-feature.o pl-ctype.o pl-main.o pl-extend.o frame.o -lrc
-lncurse
>s -lm
>./pl -O -o pl.prc -b ../boot/init.pl
>[FATAL ERROR:
>        mprotect() failed at 0x502d000 for 16384 bytes: Permission denied
>]

This looks more serious.  Looks a bit the mmap() implementation is a bit
dubious.  You can get away using configure --disable-mapped-stacks, but
that also looses all the benefits of mapped stacks.  If you can call
native Win32 API functions, you could use the Windows stack-management
code.  This requires a little fiddling with preprocessor symbols to get
the right implementation from pl-setup.c.  It contains 3 sets of
functions to manage the stacks.  Default on Unix it wants mmap().  On
Windows it want VirtualAlloc() and if all fails it uses malloc().

P.s. Do a `make clean' before recompiling after re-running configure.

     --- Jan


----------------
* To UNSUBSCRIBE, please use the HTML form at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist

or send mail to prolog-request@swi.psy.uva.nl using the Subject:
"unsubscribe"
(without the quotes) and *no* message body.

** An ARCHIVE of this list is maintained at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/





