I'm trying to compile ciao using cygwin and gcc 3.2 but when ciaoc runs I get the following
*** --------------------------------------------------------- cd ciaoc && make compiler make[2]: Entering directory `/opt/ciao/src/ciao-1.9p34/ciaoc' cp -f ciaoc /opt/ciao/src/ciao-1.9p34/ciaoc/ciaoc.sta CIAOENGINE=/opt/ciao/src/ciao-1.9p34/bin/Win32i86/ciaoengine CIAOLIB=/opt/ciao/src/ciao-1.9p34 /opt/ciao/src/ciao-1.9p34/ciaoc/ciaoc.sta -s -x ciaoc ERROR: File library(compiler/header) not found - aborting... CIAOENGINE=/opt/ciao/src/ciao-1.9p34/bin/Win32i86/ciaoengine CIAOLIB=/opt/ciao/src/ciao-1.9p34 /opt/ciao/src/ciao-1.9p34/ciaoc/ciaoc -s -x gen_asr
{ERROR: segmentation violation} {ERROR: segmentation violation} {ERROR: segmentation violation} ....
Is it a ciao's problem or a cygwin's???
I am afraid it is Ciao's. Ciao Prolog does not bootstrap straightforwardly on a Windows/Cygwin machine (at the moment). Only the bytecode emulator and ancillary libraries are natively compiled for Windows, and linked statically in a single executable. The rest of the (Prolog/bytecode) code is platform-independent, and does not need to be compiled in the same target architecture as the emulator. We usually provide a Windows binary version in the distribution site; I have just updated it to include snapshots for the current (development) release (1.9p44).
If you want to fiddle around with the sources (lots of fun there!), it is probably better at this moment that you (a) use a Linux/Unix/Mac OS X box, or (b) get to grips with compiling in Windows (and send us the patches!). (a) is probably the easiest, but (b) will make many people happy and it will ensure you a place in our Hall of Fame [this, is, of course an open invitation]. We will of course be happy to collaborate in accomplishing (b).
Good New Year's Eve to everybody!
MCL
_________________________________ Exceptions should be exceptional. ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
Hi - Any and all answers to this are most welcome: is it possible to run ciao prolog in a 'server mode' and support multiple concurrent user access (say, via http clients or sockets)? What are the easiest approaches to accomplish this?
Is there an efficient mechanism for 'active modules' (discussed in the paper by Daniel Cabeza and Manuel Hermenegildo at the Pillow web site)? Its not clear from the Pillow Reference Library Doc how to do this. I would love to find something more efficient than CGI.
Thanks, George ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
George Thomas writes:
Hi - Any and all answers to this are most welcome: is it possible to run ciao prolog in a 'server mode' and support multiple concurrent user access (say, via http clients or sockets)? What are the easiest approaches to accomplish this?
If what you want to send/receive are Prolog calls, the easiest way is to use active modules: you will be able to issue a Prolog call in an executable (a program) so that the call is effectively run by a different executable (an active module). Thus, in short, an active module is a server of Prolog calls. Have a look at library actmods and the corresponding chapter of the manual.
If you want a server of anything other than Prolog calls, you can do it simply with sockets. The following code starts a server on a socket Port:
:- use_module(library('sockets/sockets_io'),[serve_socket/3]).
main([Port]):- atom_codes(Port,Codes), number_codes(N,Codes), bind_socket(N,5,Socket), serve_socket(Socket,server,catcher).
server(Stream):- there_is_a_connection_so_serve_it(Stream).
The communication is open on a Stream, and you simply need to read from and write to the Stream. Library sockets_io is a recent development. It is not in the current distribution of Ciao, but we can send it to you, if you're interested.
To serve requests concurrently all you would need to do is:
:- use_package(hlc).
server(Stream):- there_is_a_connection_so_serve_it(Stream) && .
Have a look at the manual chapter about concurrency and threads.
We are currently developing a library for HTTP service. It is not finalized but it works to some extent. If you are interested, send me email and I will send it to you.
Is there an efficient mechanism for 'active modules' (discussed in the paper by Daniel Cabeza and Manuel Hermenegildo at the Pillow web site)? Its not clear from the Pillow Reference Library Doc how to do this. I would love to find something more efficient than CGI.
Using the abovementioned HTTP server library you could program your own HTTP server, and you won't need CGIs. For example, you could program your server to directly connect to a process instead of starting a CGI.
If you use a standard browser instead then you cannot skip using CGIs, but you can make the CGI very lightweight by making it simply read the input and pass it to an ever-running daemon that will process it. Then you won't need to start the (probably heavyweight) server each time as a CGI. This was the idea in the paper you mention, if I remember well.
The following code can be used as a CGI that will be executed by the browser upon an HTTP POST request. It simply reads input passed along by the browser and writes the answer back. The computation is done by an active module running as daemon:
:- use_package(actmods). :- use_active_module(daemon,[serve_request/2]).
:- use_module(library(file_utils),[stream_to_string/2]). :- use_module(library(strings),[write_string/2]).
main:- stream_to_string(user_input,StringIn), serve_request(StringIn,StringOut), write_string(user_output,StringOut).
The daemon will be written as a normal module:
:- module(daemon,[serve_request/2]).
serve_request(StringIn,StringOut):- ...
The only thing is to compile it with a particular option (see the manual) for active modules. Then it can be run separatedly.
Paco Bueno ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------