Hi Fuad,

> making a parallel version on ghc-2.08 breaks under irix6.2 with the

Yes, there are several #ifndef __PARALLEL_HASKELL__ lines missing in the
libraries of ghc-2.08. In general, all references to ForeignObjs have to be
ifdefed out in a parallel aka GUM (_mp) setup, but they can be left in
place for a simulated parallel aka GranSim (_mg) setup. Patches for getting
the ifdefs in place are appended.  Most of the files are in ghc/lib/* but
there is also one in hslibs/ghc

HtH!

  Hans Wolfgang


Index: PackBase.lhs
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/ghc/lib/ghc/PackBase.lhs,v
retrieving revision 1.2
diff -r1.2 PackBase.lhs
36a37
> #ifndef __PARALLEL_HASKELL__
40a42
> #endif
123a126
> #ifndef __PARALLEL_HASKELL__
149a153
> #endif

Index: IOHandle.lhs
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/ghc/lib/ghc/IOHandle.lhs,v
retrieving revision 1.8
diff -r1.8 IOHandle.lhs
28a29
> import Foreign  ( Addr, 
30c31
< import Foreign  ( ForeignObj, Addr, makeForeignObj, writeForeignObj )
---
>                   ForeignObj, makeForeignObj, writeForeignObj 
31a33
>                 )

*** Foreign.lhs.~1~     Wed Jul 30 14:40:47 1997
--- Foreign.lhs Wed Oct  8 18:41:25 1997
***************
*** 9,15 ****
--- 9,17 ----
  
  module Foreign (
        module Foreign,
+ #ifndef __PARALLEL_HASKELL__
        ForeignObj(..),
+ #endif
        Addr(..), Word(..)
     ) where
  
***************
*** 72,77 ****
--- 74,80 ----
  %*********************************************************
  
  \begin{code}
+ #ifndef __PARALLEL_HASKELL__
  --Defined in PrelBase: data ForeignObj = ForeignObj ForeignObj#
  data ForeignObj = ForeignObj ForeignObj#   -- another one
  
***************
*** 100,105 ****
--- 103,109 ----
  instance Eq ForeignObj where 
      p == q = eqForeignObj p q
      p /= q = not (eqForeignObj p q)
+ #endif /* !__PARALLEL_HASKELL__ */
  \end{code}
  
  
Index: IO.lhs
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/ghc/lib/required/IO.lhs,v
retrieving revision 1.10
diff -r1.10 IO.lhs
44c44,49
< import Foreign          ( ForeignObj, Addr, makeForeignObj, writeForeignObj )
---
> import Foreign  ( Addr, 
> #ifndef __PARALLEL_HASKELL__
>                   ForeignObj, makeForeignObj, writeForeignObj 
> #endif
>                 )
> 

Index: Parallel.lhs
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/ghc/lib/concurrent/Parallel.lhs,v
retrieving revision 1.2
diff -r1.2 Parallel.lhs
9c9
<       , parGlobal, parLocal, parAt, parAtForNow     
---
>       , parGlobal, parLocal, parAt, parAtAbs, parAtRel, parAtForNow     
18c18
< import GHC      ( parGlobal#, parLocal#, parAt#, parAtForNow# )
---
> import GHC      ( parGlobal#, parLocal#, parAt#, parAtAbs#, parAtRel#, parAtForNow# )
20a21,25
> {-# INLINE parLocal #-}
> {-# INLINE parAt #-}
> {-# INLINE parAtAbs #-}
> {-# INLINE parAtRel #-}
> {-# INLINE parAtForNow #-}
23a29,30
> parAtAbs    :: Int -> Int -> Int -> Int -> Int -> a -> b -> b
> parAtRel    :: Int -> Int -> Int -> Int -> Int -> a -> b -> b
29a37,38
> parAtAbs    (I# w) (I# g) (I# s) (I# p) (I# q) x y = case (parAtAbs#  x q w g s p y) 
>of { 0# -> parError; _ -> y }
> parAtRel    (I# w) (I# g) (I# s) (I# p) (I# q) x y = case (parAtRel#  x q w g s p y) 
>of { 0# -> parError; _ -> y }

Index: GHC.hi-boot
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/ghc/lib/ghc/GHC.hi-boot,v
retrieving revision 1.6
diff -r1.6 GHC.hi-boot
29a30,31
>   parAtAbs#
>   parAtRel#

Index: SocketPrim.lhs
===================================================================
RCS file: /local/fp/src/cvsroot/fptools/hslibs/ghc/src/SocketPrim.lhs,v
retrieving revision 1.9
diff -r1.9 SocketPrim.lhs
1082a1083
> #ifndef __PARALLEL_HASKELL__
1103a1105,1108
> #else
> socketToHandle (MkSocket s family stype protocol status) m =
>   error "socketToHandle not implemented in a parallel setup"
> #endif
1104a1110
> 

Reply via email to