Success with Takusen (was: Type problem with simple takusen code)

On 12/12/06, Paul Moore
Should be, but isn't, unfortunately. The Setup.hs file includes some code defining configPG etc, but there's nothing I can see for the user control how it works. Maybe something in the cabal infrastructure handles this, but I've not had time yet to dive into the cabal documentation on the hope of finding something.
Just a brief note to let people on the list know that, with a lot of extremely patient help from Alistair Bayley, I have managed to resolve the issues I was having. The fundamental issue I was hitting was that I was treating GHC as an interpreted system, rather than a compiler/linker. I was therefore not thinking about the errors I was seeing as I would if I hit (say) a C link error. To summarise, the following works fine: To install Takusen, make sure that an Oracle home is in your PATH. You don't need PostgreSQL or sqlite. Your Oracle install can be simply a client build - all you need is oci.dll, not the full OCI development package. runhaskell Setup.hs configure runhaskell Setup.hs build runhaskell Setup.hs install That's it, and it works fine. To build a program, you need to do ghc --make db.hs -o db D:\Oracle\Ora92\bin\oci.dll (put the path to your oci.dll here). This compiles your program, and links it with oci.dll to get the Oracle externals resolved. Runhaskell doesn't seem to work, as it tries to link all the DB backends at runtime, regardless of whether you use them. That really is all there is to it. Arguably, the error messages you get when you mess up bits of this aren't too helpful, but if you've ever seen a C++ compilation fail with compile or link errors, you'll know not to expect much here (or at least you should!) GHC is certainly no worse than that. Once again, thanks to Alistair for his patience. Now I'll go off and reproduce my success on a clean environment just to be sure, and then write up what I've learnt for the Wiki and the Takusen readme. Paul.

To build a program, you need to do
ghc --make db.hs -o db D:\Oracle\Ora92\bin\oci.dll
(put the path to your oci.dll here).
This compiles your program, and links it with oci.dll to get the Oracle externals resolved.
I've been working with Paul on his linking problems, and there's a gotcha for Oracle 10 users. Apparently the folder that contains oci.dll, typically $ORACLE_HOME/bin, can also include hsbase.dll, which has something to do with "Heterogeneous Services". Obviously (this being Windows, where filenames are not case sensitive) this clashes with GHC's HSbase.dll; hence linker errors. I'm not sure exactly what the solution should be; one obvious one is to not include "Heterogeneous Services" in your installation. I'm also not sure if this affects Oracle clients; Paul hinted that he was pointing at a server installation folder, so a standard client installation is likely to be OK. Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************

On 12/20/06, Bayley, Alistair
To build a program, you need to do
ghc --make db.hs -o db D:\Oracle\Ora92\bin\oci.dll
(put the path to your oci.dll here).
This compiles your program, and links it with oci.dll to get the Oracle externals resolved.
I've been working with Paul on his linking problems, and there's a gotcha for Oracle 10 users. Apparently the folder that contains oci.dll, typically $ORACLE_HOME/bin, can also include hsbase.dll, which has something to do with "Heterogeneous Services". Obviously (this being Windows, where filenames are not case sensitive) this clashes with GHC's HSbase.dll; hence linker errors.
To clarify a little - I believe the issue exists on Oracle 8i, 9i and 10g. It's not so much the version as the options you choose when you install the software. As far as I am able to confirm, a default enterprise edition install includes hsbase.dll. A default client install does not. If you do a custom install, then the relevant option is "Heterogeneous Services" - but the simplest way to check is just to look for hsbase.dll in the <oracle home>\bin directory. Alistair - maybe you could add a check in Setup.hs, to see if hsbase.dll is present, and if so, to display a warning? I can sort of see where such a check would occur (in configOracle), but I don't know enough about Cabal to suggest code... Paul.
participants (2)
-
Bayley, Alistair
-
Paul Moore