installing ghc on Solaris without gcc

2002-04-03 Thread Sven Eric Panitz

after having used ghc on linux and win32 for quite a while now
I am stuck with installing the binary distribution on Solaris.

The Solaris machine does not have a gcc installed. This is correctly
detected by ./configure.

However the eventually installed ghc still calls gcc instead of
just cc.

Eventually I made a symbolic link 
  ln -s cc gcc
just to see if this might work. 

Unfortunately  this gives linker errors:

bash-2.04$ ghc Main.hs
compilation IS NOT required
Undefined   first referenced
 symbol in file
PrelIOBase_heapOverflow_closure (command line)
PrelInt_I16zh_static_info   (command line)
PrelPack_unpackCString_closure  /usr/local/lib/ghc-5.02.2/libHSrts.a(RtsAPI.o)
PrelFloat_Dzh_con_info  /usr/local/lib/ghc-5.02.2/libHSrts.a(RtsAPI.o)
PrelWord_W64zh_con_info /usr/local/lib/ghc-5.02.2/libHSrts.a(RtsAPI.o)
PrelStable_StablePtr_static_info/usr/local/lib/ghc-5.02.2/libHSrts.a(RtsAPI.o)
...


Is ghc supposed to work with cc instead of gcc? If this is so,
what am I doing wrongly?

thanks

Sven Eric

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: Socket library ghc 5.02.1

2001-11-28 Thread Sven Eric Panitz



 From: Sigbjorn Finne [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Date: Tue, 27 Nov 2001 09:30:04 -0800

  
  Conclusion: you're hosed with ghc-5.02.1 and its socket libs under
  Win32. Sorry.
  

 If you don't mind getting your hands a (little) bit dirty, here's a story
 that will work ghc-5.02.1:

 * edit SocketPrim.hi (and SocketPrim.p_hi), to instead of saying 
Socket in its __export section it says Socket{MkSocket}

(you'll find the .hi file in imports/net/ inside your 5.02.1 
tree).

 * compile up the attached NetExtra.hs as follows:

foo$ ghc -c NetExtra.hs -fvia-C -fglasgow-exts 
-package net

 * import and include NetExtra with your socket code, e.g.,



Thanks Danke Mercie, this works (although I did not fully understand,
what I was doing).


Sven Eric

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: Socket library ghc 5.02.1

2001-11-27 Thread Sven Eric Panitz



 From: Sigbjorn Finne [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 References: [EMAIL PROTECTED]
 Date: Mon, 26 Nov 2001 12:30:47 -0800

Sven Eric Panitz [EMAIL PROTECTED] writes:
  
  It seems that the Socket library does still not work
  with ghc 5.02.1.
  I tried the simple test:
  
   main =
   do
   d - connectTo localhost (PortNumber 80)
   hPutStr d GET / HTTP/1.0\n\n
   hFlush d
   c - hGetContents d
   putStr c
  
  On Windows2000 I get the known error:
  
  *** Exception: does not exist
  Action: getProtocolByName
  Reason: no such protocol entry
  

 (You, of course, need to wrap up that code with Socket.withSocketDo
 to start up WinSock first).

 FYI, in case you're planning on doing socket programming with GHC-5.02
 on a Win32 platform, stay away from using the higher-level Socket module,
 since its IO.Handle based view of sockets is just broken. Stick with the
 lower-level SocketPrim interface instead.

 Specifically, stay away from using the following:

* Socket. connectTo
* Socket.accept
* Socket.sendTo
* Socket. recvFrom
* SocketPrim.socketToHandle

 --sigbjorn


Thanks for the help and valuable information. 

I tried the following little test, which stays away from
above functions:

 module Main where
 
 import BSD
 import SocketPrim
 import Socket (withSocketsDo)

 main =  
  Socket.withSocketsDo
   (do
 protNum - getProtocolNumber tcp
 s - socket AF_INET Stream protNum
 hostAddr - inet_addr 157.189.164.68
 let sAddr =  (SockAddrInet (toEnum 8080) hostAddr)
 connect s sAddr
 i - sendTo  s GET / HTTP/1.0\r\n\r\n sAddr
 (str,l,imsAddr) - recvFrom s 1000
 putStr str
   )


But something I seem to be doing wrong.

During evaluation of 'recvFrom s 1000' I get the following
error message (consistently for unix and windows):

  Fail: SocketPrim.hsc:241: Non-exhaustive patterns in case


As the log of the webserver reveals the sendTo works fine.

Any idea what could be my problem?

Sven Eric


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: ghc compiled program crashes

2001-10-30 Thread Sven Eric Panitz


 From: Julian Seward (Intl Vendor) [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 X-OriginalArrivalTime: 30 Oct 2001 09:55:44.0099 (UTC) 
FILETIME=[0A82EB30:01C16129]



 Sven

 | from time to time ghc compiled programs simply crash on
 | my windows2000 without any meaningfull error message. I guess 
 | this has something to do with storage management (I vaguely 
 | remember having read something about errors durcing gc on 
 | this list, but did not find the corresponding posts in the archive).

 ghc-5.02 has a known bug on Win32 only, which causes all
 programs compiled with it to die silently when the heap size
 reaches 128 megabytes.  This is fixed in the upcoming 5.02.1.

 You did not say what version ghc you are using or give any
 other details.  If you tell us more we might be able to help
 more.

 J


Sorry that I was not more specific in my previous mail. Yes, it is
the known bug of heaps larger than 128m on Windows. Simon M. 
helped me to figure that out yesterday evening.

Thanks to both of you

Sven Eric



___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: Socket library

2001-10-25 Thread Sven Eric Panitz



as I have learnt now, there are problems with Sockets and ghc 5.02:

http://haskell.org/pipermail/glasgow-haskell-users/2001-October/001008.html


Unfortunately, I am currently working on WinNT and would not like to
go back and install ghc4.08. Is there an easy way to patch this problem
in my 5.02 installation.

Sven Eric



___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Socket library

2001-10-24 Thread Sven Eric Panitz


I just wanted to play a bit with the Socket library comming
with Haskell. However, whatever I try to do, I get the following
runtime error, eg in ghci:

Socket  connectTo pcsep (PortNumber 80)
*** Exception: does not exist
Action: getProtocolByName
Reason: no such protocol entry


Seems that I am doing something wrong here?

Sven Eric

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



hdirect and ghc 5.02

2001-10-04 Thread Sven Eric Panitz


Just a short question:

is there a ghc 5.02 compatible distribution of hdirect available?

Sven Eric


-- 
__
Sven Eric Panitz Uhlandstr. 12   D-64297 Darmstadt
Software AG   [EMAIL PROTECTED] (+49)6151-92-1426 
---  when I cannot sing my heart, I can only speak my mind ---


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



packages in ghci

2001-09-27 Thread Sven Eric Panitz


I just downloaded the nice installation of ghc 5.02 for windows.

I have just some problem when trying to start ghci with a
package as described in the manual:

 E:\hs\Quipghci -package text
 e:\PROGRA~1\ghc\ghc-5.02\bin\ghc.exe: no input files
 Usage: For basic information, try the `--help' option.
 
 E:\hs\Quip

Adding a Haskell source file as further parameter does not really help:

 E:\hs\Quipghci -package text M.hs
 A' does not existhc-5.02\bin\ghc.exe: file `=
 
 E:\hs\Quip


Any idea, what I am doing wrong?

Sven Eric



-- 
__
Sven Eric Panitz Uhlandstr. 12   D-64297 Darmstadt
Software AG   [EMAIL PROTECTED] (+49)6151-92-1426 
---  when I cannot sing my heart, I can only speak my mind ---


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: Exporting a String

2001-09-27 Thread Sven Eric Panitz


I am no expert in these things, but
as a matter of fact I just did some quite similar and found
the help in the mailing list archive. (at least I did not find
a cookbook for this in the documentation)

My Haskell module:
==

module Mini where
import CString

foreign export stdcall cAppend :: CString - CString - IO CString

cAppend :: CString - CString - IO CString
cAppend cxs cys
 = do
xs - peekCString cxs
ys - peekCString cys
erg - return (xs++ys)
newCString erg


And my C program Main.c calling this function:
==

#include stdio.h
#include Mini_stub.h
#include RtsAPI.h 

extern void __stginit_Mini ( void ); 

int main(void)
{
   char* bogusFlags[1] = { \0 }; 
   char* test;   

   //starting up Haskell runtime
   startupHaskell(0, bogusFlags, __stginit_Mini);

   //calling Haskell function
   test=cAppend(the world, is my oyster); 

   //printing its result
   printf(%s\n, test);

   //say bye bye to Haskell
   shutdownHaskell();

   return 0;
}


and my way to build this thing:
===
ghc -fglasgow-exts -package text -c Mini.hs
gcc -I. -I'e:/Program Files/ghc/ghc-5.02/include' -I'E:\Program 
Files\ghc\ghc-5.02\include\mingw' -c Main.c
ghc -fglasgow-exts -no-hs-main -package text -static Main.o Mini.o Mini_stub.o -o 
Test.exe




Please some expert correct me, if this is not the right way to
do this.

Sven Eric


-- 
__
Sven Eric Panitz Uhlandstr. 12   D-64297 Darmstadt
Software AG   [EMAIL PROTECTED] (+49)6151-92-1426 
---  when I cannot sing my heart, I can only speak my mind ---


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: static linking on cygnus

2000-09-07 Thread Sven Eric Panitz


thanks for the help. yes I used the latest cygwin and with
yesterday evening I installed GHC, 4.08.1 and static linking 
is no problem with that

Sven Eric


 Date: Wed, 6 Sep 2000 11:52:02 +0100 (BST)
 From: Reuben Thomas [EMAIL PROTECTED]
 Sender: [EMAIL PROTECTED]

   [.]

 What's your version of Cygwin? It looks as though you're using Cygwin
 1.1, and the static libraries aren't compatible. You can use the new
 version of GHC, 4.08.1, with Cygwin 1.1.

 -- 
 http://sc3d.org/rrt/ | maxim, n.  wisdom for fools



__
Sven Eric Panitz Uhlandstr. 12
Software AG   [EMAIL PROTECTED] D-64297 Darmstadt
(+49)6151-92-1426 __ half of what I say is meaningless





static linking on cygnus

2000-09-06 Thread Sven Eric Panitz


i am using ghc4.08 on cygnus and wanted to build my project
with the '-static' option. Unfortunately this fails with
the appended message. Any idea what I do wrong?

E:/ghc/ghc-4.08/lib/libHSstd_cbits.a(openFile.o)(.text+0x17f):ghc4632.c: undefined 
reference to `__imp__iob'
E:/ghc/ghc-4.08/lib/libHSrts.a(StgMiscClosures.o)(.text+0x392):ghc29658.c: undefined 
reference to `__imp__iob'
E:/ghc/ghc-4.08/lib/libHSrts.a(StgMiscClosures.o)(.text+0x3ba):ghc29658.c: undefined 
reference to `__imp__iob'
E:/ghc/ghc-4.08/lib/libHSrts.a(StgMiscClosures.o)(.text+0x3e2):ghc29658.c: undefined 
reference to `__imp__iob'
E:/ghc/ghc-4.08/lib/libHSrts.a(StgMiscClosures.o)(.text+0x40a):ghc29658.c: undefined 
reference to `__imp__iob'
E:/ghc/ghc-4.08/lib/libHSrts.a(StgMiscClosures.o)(.text+0x432):ghc29658.c: more 
undefined references to `__imp__iob' follow
collect2: ld returned 1 exit status
make: *** [createDtd] Error 1
bash-2.03$

sven eric
__
Sven Eric Panitz Uhlandstr. 12
Software AG   [EMAIL PROTECTED] D-64297 Darmstadt
(+49)6151-92-1426 __ half of what I say is meaningless