Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-28 Thread SevenThunders
SevenThunders wrote: The new behavior is that under certain conditions a certain matrix inner product produces undefined floats, that should not be there. I now have a simple example that I have posted as ticket number 1944 for ghc 6.8.1. The behavior is that if I link

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-26 Thread SevenThunders
Ian Lynagh wrote: Can any of you give us a testcase for this, please? Thanks Ian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe I started to work on this but so far

RE: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-16 Thread SevenThunders
Simon Peyton-Jones wrote: Alberto, SevenThunders, Joel, Glark. This is not good. Thank you for being so polite about it. And thanks for working on a reproducible test case -- without that we are 100% stuck. We did fix one just-possibly-related bug in 6.8 recently, which concerned

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread SevenThunders
Alberto Ruiz-2 wrote: Hello, I have had exactly the same problem with my bindings to GSL, BLAS and LAPACK. The foreign functions (!) randomly (but very frequently) produced NaN with ghc-6.8.1 -O. As usual, I first thought that I had a subtle bug related to the foreign pointers, but

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread SevenThunders
Alberto Ruiz-2 wrote: Hmm, I' sorry... all seems to work well for me if I set -O -fvia-C for building the library and for final program compilation. But I will also try to find a minimum test case. In the meantime I have sent to Ian information to expose the problem with my

[Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread SevenThunders
The good news is that my code compiles without error and much faster under ghc 6.8.1. The bad news is that there appear to be subtle bugs that did not occur when I compiled things under 6.6.1. One issue is that my code is somewhat complex and links into a C library as well. The new behavior is

Re: [Haskell-cafe] Sequencing Operations in a Monad

2007-09-17 Thread SevenThunders
Paul Johnson-2 wrote: SevenThunders wrote: Unfortunately if I wrap my matrix references in the IO monad, then at best computations like S = A + B are themselves IO computations and thus whenever they are 'invoked' the computation ends up getting performed repeatedly contrary to my

Re: [Haskell-cafe] Sequencing Operations in a Monad

2007-09-15 Thread SevenThunders
Dominic Steinitz wrote: If you arrange the types to try to do all the operations inside the IO monad you can't chain together more than 1 binary operation. eg. do S - A + B Z - Q * S vs do S - Q * (A + B) Are there any suggestions for this dilemma? Am I using

[Haskell-cafe] Sequencing Operations in a Monad

2007-09-14 Thread SevenThunders
I have a matrix library written in C and interfaced into Haskell with a lot of additional Haskell support. The C library of course has a lot of side effects and actually ties into the BLAS libraries, thus at the present time, most of the interesting calls are done in the IO monad. I have no

Re: [Haskell-cafe] Sequencing Operations in a Monad

2007-09-14 Thread SevenThunders
Ryan Ingram wrote: As long as the FFI calls don't make destructive updates to existing matrices, you can do what you want. For example, assuming you have: -- adds the second matrix to the first overwrites the first matrixAddIO :: MatrixIO - MatrixIO - IO () -- creates a new copy

Re: [Haskell-cafe] GHC linking problems

2007-08-17 Thread SevenThunders
Did I find a bug cabal? I have attempted to fix the problem Main.c:(.text+0x22): undefined reference to `__stginit_ZCMain' by compiling my Haskell library using the flag -no-hs-main. One would think that this would make sense if the library is to be used by an external C program. However I

Re: [Haskell-cafe] GHC linking problems

2007-08-15 Thread SevenThunders
SevenThunders wrote: I have a large Haskell/C project that needs to be linked against an even larger set of C libraries and object files (OpNet) on a linux box (Fedora Core 7). So far I have been able to link my Haskell libraries to some C test code containing a main function without

[Haskell-cafe] GHC linking problems

2007-08-14 Thread SevenThunders
I have a large Haskell/C project that needs to be linked against an even larger set of C libraries and object files (OpNet) on a linux box (Fedora Core 7). So far I have been able to link my Haskell libraries to some C test code containing a main function without incident. However the link

Re: [Haskell-cafe] Name Decoration and Undefined References

2007-06-30 Thread SevenThunders
Bulat Ziganshin-2 wrote: Hello SevenThunders, Saturday, June 30, 2007, 7:45:57 AM, you wrote: My own code is half Haskell and half C. My build process is rather complex i have the same. initially C code was compiled by gcc but finally i switched to ghc-only compilation. it's also

[Haskell-cafe] Name Decoration and Undefined References

2007-06-29 Thread SevenThunders
I have a very complex project that has to play nice with a lot of C code written by other people. My own code is half Haskell and half C. My build process is rather complex since I generate about 5 different libraries, some of them export Haskell routines. A supreme effort was made to try to

Re: [Haskell-cafe] Name Decoration and Undefined References

2007-06-29 Thread SevenThunders
SevenThunders wrote: perhaps what's contained in foo.hi that informs ghc what names to actually link to. I'm not so sure if this is correct or not. The truth is I have no .hi files in the directory I try to link my test code, and yet it's somehow finding them in the cabal created

[Haskell-cafe] Object Files Become Downloader.Obfuskated

2007-05-09 Thread SevenThunders
I discovered a curious thing after a compiling a medium sized Haskell project using the 64 bit linux Haskell GHC 6.6.1 compiler. Several of the generated object files (.o) show up as containing the virus Downloader.Obfuskated by my AVG anti-virus program when viewing the files from windows xp

[Haskell-cafe] Detect Either Windows or Linux environment

2007-05-04 Thread SevenThunders
Is there a simple way to detect what operating system a given Haskell program is running under? It would help to make some programs that might have to interact with the operating system more portable. I haven't been able to quite figure out a simple way to do this. -- View this message in

Re: [Haskell-cafe] Detect Either Windows or Linux environment

2007-05-04 Thread SevenThunders
Brandon S. Allbery KF8NH wrote: On May 5, 2007, at 0:21 , SevenThunders wrote: Is there a simple way to detect what operating system a given Haskell program is running under? mress:5002 Z$ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC

Re: [Haskell-cafe] Export Haskell Libraries

2007-04-13 Thread SevenThunders
Duncan Coutts wrote: So it's easy if you link the system using ghc. If you want to link it all using gcc instead, yeah, that's a bit harder. You can see most of the flags ghc passes to gcc as they're just in the package configuration for the rts and base packages (ghc-pkg display rts /

Re: [Haskell-cafe] Re: Export Haskell Libraries

2007-04-13 Thread SevenThunders
jasonm wrote: While we're on the topic, does anyone know if there exists a similarly simple solution like the (last) section Using both Python Haskell with ctypes at http://wiki.python.org/moin/PythonVsHaskell that works on Linux to easily link Haskell libraries/functions into Python?

Re: [Haskell-cafe] Re: Export Haskell Libraries

2007-04-13 Thread SevenThunders
Dan Weston wrote: In the GHC docs: http://www.haskell.org/ghc/docs/6.4.1/html/users_guide/sec-ffi-ghc.html#using-own-main There can be multiple calls to hs_init(), but each one should be matched by one (and only one) call to hs_exit()[8]. What exactly happens with nested calls? Is

[Haskell-cafe] Export Haskell Libraries

2007-04-12 Thread SevenThunders
I've finished a good sized Haskell project which I now must expose as a library (along with a lot of C code) to my fellow engineers. I had originally devoped my code on Windows XP and managed to learn how to wrap my Haskell code in a DLL and create an MSVC linkable library stub for the DLL.

Re: [Haskell-cafe] Creating static libraries using GHC

2007-03-16 Thread SevenThunders
Simon Marlow wrote: Tom Hawkins wrote: I have a chunk of Haskell code I would like wrap up and distribute as a library. Is there a way to build a static library (*.a) that includes my code plus the Haskell runtime, which C programs can easily link against? Here is what I have tried so

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread SevenThunders
, namely -fglasgow-exts. Cheers, Spencer Janssen On Tue, 13 Mar 2007 22:20:20 -0700 (PDT) SevenThunders [EMAIL PROTECTED] wrote: I have the pleasure of porting a good sized Haskell application to linux. So far the Haskell code has compiled without incident, however some code that I

[Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-13 Thread SevenThunders
I have the pleasure of porting a good sized Haskell application to linux. So far the Haskell code has compiled without incident, however some code that I hacked to implement a Read instance for Unboxed Arrays does not compile on linux even though it compiles just fine on Windows XP in Haskell

Re: Problem exporting Haskell to C via a DLL in GHC 6.6

2007-02-06 Thread SevenThunders
Brian Hulley wrote: Since Begin would be a function exported by the DLL, Windows would ensure that the DLL was loaded when it is first called from your application if it was not already loaded so there would be no need for an explicit call to LoadLibrary. and then End

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread SevenThunders
Neil Mitchell wrote: The problem is that something like GHC is very complex, with lots of transformations. When transformations are firing other transformations, which in turn fire other transformations, it doesn't take a great deal to disrupt this flow of optimisation and end up with a

Re: [Haskell-cafe] No Derived Read for Unboxed Arrays

2007-01-25 Thread SevenThunders
Neil Mitchell wrote: I found that Read was maybe 30 times slower than the slowest binary serialisation method I could possibly think of. If performance matters to you, and the array is more than a few elements long, switching away from Read/Show should be the first step - before going

Re: [Haskell-cafe] Pure serialisation and compression [Was: No Derived Read for Unboxed Arrays]

2007-01-25 Thread SevenThunders
Donald Bruce Stewart wrote: mattcbro: Faster, and trivial to write! Here's a complete example: ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Thanks for the example.

RE: Memory leak in FFI callback: GHC 6.6

2006-11-03 Thread SevenThunders
Simon Peyton-Jones wrote: Dear SevenThunders (if that is how you like to addressed) Thanks for extracting a small program that exhibits the leak; that is really helpful. We'll look into it. Would you like to create a Trac bug and attach your files? Simon You can call me

Memory leak in FFI callback: GHC 6.6

2006-11-02 Thread SevenThunders
I'm not sure if this is a bug, but it sure seems that way to me. When using the wrapper technique for creating a Haskell callback function it seems that freeHaskellFunPtr is not properly freeing the resource. Here is an example program leaky.hs module Main where import Foreign import

Re: [Haskell-cafe] Finding Memory Leaks

2006-11-02 Thread SevenThunders
SevenThunders wrote: All my code is compiled using the -prof -auto flag and then run using +RTS -hc -RTS. The resulting plots do not show a linear increase in heap usage, although the Windows XP operating system does report such an increase. This is either a bug in GHC or a bug

Re: [Haskell-cafe] Finding Memory Leaks

2006-11-02 Thread SevenThunders
Jason Dagit-2 wrote: Do any memory leaks show up if you compile with -caf-all when you profile? Jason ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe It doesn't seem to

Re: GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

2006-10-24 Thread SevenThunders
Michael Marte wrote: I am still using ghc 6.4.2 for creating my DLL and, as long as the DLL does not open a file, releasing the DLL works fine. I have not yet tried ghc 6.5. Michael I just tried it under GHC 6.6 with the same results. If the DLL is loaded it crashes when it's

Re: GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

2006-10-24 Thread SevenThunders
SevenThunders wrote: I just tried it under GHC 6.6 with the same results. If the DLL is loaded it crashes when it's unloaded even if no Haskell code is actually executed. Here is the promised simple example. This example will cause an exception when the DLL is unloaded

Re: [Haskell-cafe] Haddock Parse Errors

2006-10-06 Thread SevenThunders
Ivan Perez-4 wrote: Matthew Bromberg wrote: I can't help you about the haddock thing but, in my experience, if you forgive that kind of mistakes, many users will write documentation with lots of warnings and say ok, these docs ain't right but, it works for me. I guess this is mostly

Re: [Haskell-cafe] Haddock Parse Errors

2006-10-06 Thread SevenThunders
SevenThunders wrote: -- | compute cos (theta / 2) assuming the branch [-pi, pi] halfcos :: Double - Double halfcos cs = sqrt $ (cs + 1)/2 This produces a parse error parse error in doc string: [haddock.exe: reading EOF! on the h of the halfcos :: Double - Double line

Re: [Haskell-cafe] Haddock Parse Errors

2006-10-06 Thread SevenThunders
David House wrote: On 06/10/06, SevenThunders [EMAIL PROTECTED] wrote: Some of these functions are really annoying to write type declarations for. Maybe I'll get ghci to do it for me and use cut and paste :) Try using type synonyms to bring the beasts to order. -- -David House

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-28 Thread SevenThunders
SevenThunders wrote: I am having some difficulty with creating a dynamic link library using GHC on windows XP. I am having some problems with GHCs stdout when a Haskell program is called from a windows program. As I noted earlier I am calling some Haskell code from C as a bridge

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-27 Thread SevenThunders
Well I tried this statement ghc --mk-dll -fglasgow-exts -fffi -I. --make ExternLib.hs It only compiled the object file, creating ExternLib.o, but it did not create the stub file or attempt to link in the dependent packages. I then went back to this, ghc --mk-dll -fglasgow-exts -fffi -o

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-27 Thread SevenThunders
Jason Dagit wrote: On 9/27/06, SevenThunders [EMAIL PROTECTED] wrote: Does cabal really work on windows? I've never had a problem with cabal on windows. I use it instead of makefiles and I'm reasonably happy with it. Although it's installed I notice that when I try to build my

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-27 Thread SevenThunders
SevenThunders wrote: I am having some difficulty with creating a dynamic link library using GHC on windows XP. I am attempting to follow the example in http://www.haskell.org/ghc/docs/6.4/html/users_guide/win32-dlls.html though I have a binary build of ghc 6.5 My problem (I think

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-27 Thread SevenThunders
SevenThunders wrote: I am having some difficulty with creating a dynamic link library using GHC on windows XP. I need to report some additional strange DLL behavior with ghc.exe unfortunately. Although I solved my linking problems and was able to create a .dll and a MS VC .lib file

Re: [Haskell-cafe] Creating DLLs with GHC

2006-09-27 Thread SevenThunders
SevenThunders wrote: SevenThunders wrote: I am having some difficulty with creating a dynamic link library using GHC on windows XP. I need to report some additional strange DLL behavior with ghc.exe unfortunately. Although I solved my linking problems and was able

Re: [Haskell-cafe] Baffled by Disk IO

2006-07-30 Thread SevenThunders
Yes I do have another test on my path. It is in a utilities directory of unix like commands that have been ported to windows. However I also have a test.exe that was created by ghc that seems to do nothing, even if I type ./test.exe. Thanks for the hint though. -- View this message in

Re: [Haskell-cafe] Baffled by Disk IO

2006-07-30 Thread SevenThunders
Florian Weimer wrote: * SevenThunders: OK it was stupid. Apparently GHC behaves differently according to what the name of the high level source file is. If I renamed test.hc to main.hc everything works the same as GHCi. I probably should actually read the manual some day. Some

Re: [Haskell-cafe] Re[2]: Why Haskell?

2006-07-27 Thread SevenThunders
Sebastian Sylvan-2 wrote: Well, why would you want a huge array of random numbers? In Haskell there are two big ways to gain efficiency, strictness and laziness. In this case I think laziness is a big candidate (the huge array part gives it away). Also there is no reason generating

Re: [Haskell-cafe] Re[2]: Why Haskell?

2006-07-26 Thread SevenThunders
Bulat Ziganshin-2 wrote: Hello Matthew, Sunday, July 23, 2006, 10:35:41 AM, you wrote: sequence $ [ reffill b s | s - [0..(fi temits)-1], b - [0..(fi nc)-1]] Now thats interesting. I can see that this function is more appropriate since I do not need to retrieve data from the

Re: [Haskell-cafe] Why Haskell?

2006-07-24 Thread SevenThunders
Alberto Ruiz-2 wrote: The GSL has been ported to Windows: http://gnuwin32.sourceforge.net/packages/gsl.htm so I think that GSLHaskell could also be adapted to work in Windows... I will try to do it. Alberto On Monday 24 July 2006 02:56, SevenThunders wrote: Jared Updike wrote

Re: [Haskell-cafe] Re[2]: Why Haskell?

2006-07-23 Thread SevenThunders
Bulat Ziganshin-2 wrote: Hello Matthew, Sunday, July 23, 2006, 10:35:41 AM, you wrote: sequence $ [ reffill b s | s - [0..(fi temits)-1], b - [0..(fi nc)-1]] Now thats interesting. I can see that this function is more appropriate since I do not need to retrieve data from the

Re: [Haskell-cafe] Why Haskell?

2006-07-23 Thread SevenThunders
Jared Updike wrote: GSL Haskell bindings: http://dis.um.es/~alberto/GSLHaskell/ http://dis.um.es/~alberto/GSLHaskell/doc/ Specifically for Linary Algebra: http://dis.um.es/~alberto/GSLHaskell/doc/GSL-Base.html You make a good point and the decision was by no means cut and dry.

Re: [Haskell-cafe] Eclipse and Haskell

2006-06-02 Thread SevenThunders
Are there Haskell specific tools for Eclipse? My experience so far has been somewhat negative. I tried to use eclipse with D some time ago, but the plugin kept crashing and Eclipse seems to have kind of a mind of it's own. I think for java development it's highly regarded. Everytime I try one

[Haskell-cafe] Linking to third party libraries in windows

2006-05-25 Thread SevenThunders
Has anyone actually seen ghc link successfully to third party libraries on windows? While I have been able to link to C object code compiled by ghc (and thus gcc by proxy), I have not been able to actually link against any substantial third party library or dll in windows. I am currently

[Haskell-cafe] RE: RE: Troubles with FFI

2006-05-16 Thread SevenThunders
Aarrgh! Are the formatting commands the same? I don't want to have to rewrite the whole thing. That is a bit confusing. -- View this message in context: http://www.nabble.com/Troubles-with-FFI-t1611744.html#a4420902 Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

Re: [Haskell-cafe] RE: Troubles with FFI

2006-05-16 Thread SevenThunders
Thats some good info. It probably should go on that wiki page. All I need now is an unlimited amount of spare time... -- View this message in context: http://www.nabble.com/Troubles-with-FFI-t1611744.html#a4420914 Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

Re: [Haskell-cafe] GNUPlot (Was: Troubles with FFI)

2006-05-16 Thread SevenThunders
Thanks for the gnuplot stuff. I intend to try that out. Perhaps sooner than later. As for lhs2tex, since no windows installer is provided, it might be a bit trickier and my time is very limited. Also after reviewing the manual it seems to still be focused on literate programming more than

[Haskell-cafe] CDouble type coercion

2006-05-14 Thread SevenThunders
I am new to Haskell and found myself in a bind concerning the use of the C types, CDouble in particular. I extract a CDouble via it's pointer from a StorableArray. Since the array must interface with C the elements of the array must be CDouble. Now I'd like to use Text.Printf to format print

Re: [Haskell-cafe] CDouble type coercion

2006-05-14 Thread SevenThunders
Thanks that helps a bit. The realToFrac type coercion works, but ultimately it seems that printf won't play nice. Consider this simple haskell code module Test where import IO -- import Data.Array.Storable import Text.Printf import Foreign.C.Types (CInt, CDouble ) y :: CDouble y =

Re: [Haskell-cafe] CDouble type coercion

2006-05-14 Thread SevenThunders
The rabbit hole goes a bit deeper I'm afraid y :: CDouble y = 5.2 u :: Double u = realToFrac(y) test = do printf %14.7g u gives Compiling Test ( test.hs, interpreted ) test.hs:14:11: No instance for (PrintfType (t t1)) arising from use of `printf' at test.hs:14:11-16