{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/c2hs/issues/118","labels_url":"https://api.github.com/repos/haskell/c2hs/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/haskell/c2hs/issues/118/comments","events_url":"https://api.github.com/repos/haskell/c2hs/issues/118/events","html_url":"https://github.com/haskell/c2hs/issues/118","id":55912692,"number":118,"title":"build doesn't typecheck","user":{"login":"ocramz","id":5902760,"avatar_url":"https://avatars.githubusercontent.com/u/5902760?v=3","gravatar_id":"","url":"https://api.github.com/users/ocramz","html_url":"https://github.com/ocramz","followers_url":"https://api.github.com/users/ocramz/followers","following_url":"https://api.github.com/users/ocramz/following{/other_user}","gists_url":"https://api.github.com/users/ocramz/gists{/gist_id}","starred_url":"https://api.github.com/users/ocramz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocramz/subscriptions","organizations_url":"https://api.github.com/users/ocramz/orgs","repos_url":"https://api.github.com/users/ocramz/repos","events_url":"https://api.github.com/users/ocramz/events{/privacy}","received_events_url":"https://api.github.com/users/ocramz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-29T15:26:41Z","updated_at":"2015-01-29T16:39:08Z","closed_at":null,"body":"Install command: \r\ncabal install haskell-mpi --extra-lib-dirs=/opt/openmpi-1.5.3/lib/ --extra-include-dirs=/opt/openmpi-1.5.3/include/\r\n\r\n[1 of 6] Compiling C2HS             ( src/C2HS.hs, dist/dist-sandbox-63b7207b/build/C2HS.o )\r\n\r\nsrc/C2HS.hs:165:31:\r\n    Could not deduce (Num b) arising from the literal `0'\r\n    from the context (Enum a, Bits b)\r\n      bound by the type signature for\r\n                 combineBitMasks :: (Enum a, Bits b) => [a] -> b\r\n      at src/C2HS.hs:164:20-47\r\n    Possible fix:\r\n      add (Num b) to the context of\r\n        the type signature for\r\n          combineBitMasks :: (Enum a, Bits b) => [a] -> b\r\n    In the second argument of `foldl', namely `0'\r\n    In the first argument of `(.)', namely `foldl (.|.) 0'\r\n    In the expression: foldl (.|.) 0 . map (fromIntegral . fromEnum)\r\n\r\nsrc/C2HS.hs:171:39:\r\n    Could not deduce (Num a) arising from a use of `fromIntegral'\r\n    from the context (Bits a, Enum b)\r\n      bound by the type signature for\r\n                 containsBitMask :: (Bits a, Enum b) => a -> b -> Bool\r\n      at src/C2HS.hs:170:20-53\r\n    Possible fix:\r\n      add (Num a) to the context of\r\n        the type signature for\r\n          containsBitMask :: (Bits a, Enum b) => a -> b -> Bool\r\n    In the first argument of `(.)', namely `fromIntegral'\r\n    In the expression: fromIntegral . fromEnum\r\n    In the expression: fromIntegral . fromEnum $ bm\r\n\r\n\r\nfollows my ghc --info: \r\n \r\n [(\"Project name\",\"The Glorious Glasgow Haskell Compilation System\")\r\n ,(\"GCC extra via C opts\",\" -fwrapv\")\r\n ,(\"C compiler command\",\"/usr/bin/gcc\")\r\n ,(\"C compiler flags\",\" -fno-stack-protector\")\r\n ,(\"C compiler link flags\",\"\")\r\n ,(\"ld command\",\"/usr/bin/ld\")\r\n ,(\"ld flags\",\"\")\r\n ,(\"ld supports compact unwind\",\"YES\")\r\n ,(\"ld supports build-id\",\"YES\")\r\n ,(\"ld supports filelist\",\"NO\")\r\n ,(\"ld is GNU ld\",\"YES\")\r\n ,(\"ar command\",\"/usr/bin/ar\")\r\n ,(\"ar flags\",\"q\")\r\n ,(\"ar supports at file\",\"YES\")\r\n ,(\"touch command\",\"touch\")\r\n ,(\"dllwrap command\",\"/bin/false\")\r\n ,(\"windres command\",\"/bin/false\")\r\n ,(\"libtool command\",\"libtool\")\r\n ,(\"perl command\",\"/usr/bin/perl\")\r\n ,(\"target os\",\"OSLinux\")\r\n ,(\"target arch\",\"ArchX86_64\")\r\n ,(\"target word size\",\"8\")\r\n ,(\"target has GNU nonexec stack\",\"True\")\r\n ,(\"target has .ident directive\",\"True\")\r\n ,(\"target has subsections via symbols\",\"False\")\r\n ,(\"Unregisterised\",\"NO\")\r\n ,(\"LLVM llc command\",\"llc\")\r\n ,(\"LLVM opt command\",\"opt\")\r\n ,(\"Project version\",\"7.8.2\")\r\n ,(\"Booter version\",\"7.6.3\")\r\n ,(\"Stage\",\"2\")\r\n ,(\"Build platform\",\"x86_64-unknown-linux\")\r\n ,(\"Host platform\",\"x86_64-unknown-linux\")\r\n ,(\"Target platform\",\"x86_64-unknown-linux\")\r\n ,(\"Have interpreter\",\"YES\")\r\n ,(\"Object splitting supported\",\"YES\")\r\n ,(\"Have native code generator\",\"YES\")\r\n ,(\"Support SMP\",\"YES\")\r\n ,(\"Tables next to code\",\"YES\")\r\n ,(\"RTS ways\",\"l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn\")\r\n ,(\"Support dynamic-too\",\"YES\")\r\n ,(\"Support parallel --make\",\"YES\")\r\n ,(\"Dynamic by default\",\"NO\")\r\n ,(\"GHC Dynamic\",\"YES\")\r\n ,(\"Leading underscore\",\"NO\")\r\n ,(\"Debug on\",\"False\")\r\n ,(\"LibDir\",\"/home/mzocca/bin/lib/ghc-7.8.2\")\r\n ,(\"Global Package DB\",\"/home/ocramz/bin/lib/ghc-7.8.2/package.conf.d\")\r\n ]"},"comment":{"url":"https://api.github.com/repos/haskell/c2hs/issues/comments/72057357","html_url":"https://github.com/haskell/c2hs/issues/118#issuecomment-72057357","issue_url":"https://api.github.com/repos/haskell/c2hs/issues/118","id":72057357,"user":{"login":"ian-ross","id":1113720,"avatar_url":"https://avatars.githubusercontent.com/u/1113720?v=3","gravatar_id":"","url":"https://api.github.com/users/ian-ross","html_url":"https://github.com/ian-ross","followers_url":"https://api.github.com/users/ian-ross/followers","following_url":"https://api.github.com/users/ian-ross/following{/other_user}","gists_url":"https://api.github.com/users/ian-ross/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-ross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-ross/subscriptions","organizations_url":"https://api.github.com/users/ian-ross/orgs","repos_url":"https://api.github.com/users/ian-ross/repos","events_url":"https://api.github.com/users/ian-ross/events{/privacy}","received_events_url":"https://api.github.com/users/ian-ross/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T16:39:08Z","updated_at":"2015-01-29T16:39:08Z","body":"@ocramz Not sure I would call this a C2HS bug.  The `haskell-mpi` package hasn't been updated since 2012 -- since then, C2HS has changed considerably: in particular, the `C2HS.hs` file is no longer used at all, and the syntax for function hook definitions has changed so that much of the usage in this package is not valid with recent versions of C2HS (in particular a lot of the stuff in `Control.Parallel.MPI.Internal` is now incompatible with the way that C2HS function hooks work).  You could try using an old (2012-vintage) version of C2HS, but I still think you'd have trouble with using that C2HS.hs with more recent GHC versions.\r\n\r\nFrom a quick skim through the C2HS code, it looks as though it shouldn't be too hard to update this for current versions of C2HS.  If you think that would be useful, I can do it (or you could do it and I could cheer from the sidelines...).  The maintainer of the `haskell-mpi` package is @bjpop who seems pretty active, so hopefully he'd accept a PR to bring the package up to date.\r\n\r\nLet me know what you think: if you really want to use this package, I'll update it (I might have some interest in using MPI with Haskell at some point in the future as well)."}}