Fw: [nhc-users] Problem installing nhc98 1.16 using bootstrap-from-C method

Sorry for the second message here - I should have said I just installed cygwin yesterday and it is v1.3.22-1. Also, I'm running on XP Pro. Thanks! -- Dave ----- Original Message ----- From: David Bakin To: nhc-users@haskell.org Sent: Wednesday, April 09, 2003 9:10 PM Subject: [nhc-users] Problem installing nhc98 1.16 using bootstrap-from-C method I'm having trouble building nhc98 using bootstrap-from-C - the following shows the error I'm getting. It is actually executing in hmake3.config at the following line (the hmakerc add command) N:/nhc98-1.16/script/hmake-config N:/nhc98-1.16/lib/ix86-CYGWIN_NT-5.1/hmakerc add N:/nhc98-1.16/script/nhc98 davidbak@girlsprout /ndrive/nhc98-1.16/src/hmake $ make config sh N:/nhc98-1.16/targets/ix86-CYGWIN_NT-5.1/hmake3.config hmake-config: Starting new config file in N:/nhc98-1.16/lib/ix86-CYGWIN_NT-5.1/hmakerc I/O error: action : openFile ReadMode on file: /cygdrive/c/TEMP\hmakeconfig.tmp gave : ENOENT (No such file or directory) hmake-config: compiler not known: 'N:/nhc98-1.16/script/nhc98' make: *** [config] Error 2 As you can see it thinks hmakeconfig.tmp is not there - and in fact it is not. Though it is a temporary file - I'm wondering if the problem is in RunAndReadStdout.hs where it does a removeFile - and has the comment "file will not be removed until readFile closes it". Actually I don't have the slightest idea if that is the problem or not. Anyhow, any hints on how I can get past this? Thanks! -- Dave

"David Bakin"
I'm having trouble building nhc98 using bootstrap-from-C - the following shows the error I'm getting. It is actually executing in hmake3.config
I/O error: action : openFile ReadMode on file: /cygdrive/c/TEMP\hmakeconfig.tmp gave : ENOENT (No such file or directory)
I believe the problem here is the mixture of directory separators. When compiled by ghc the mix doesn't matter, but it does matter in a pure C-under-cygwin build, which likes to pretend to be Unix as much as possible. In src/hmake/RunAndReadStdout.hs, try changing tmpfile root = ... if windows then (tmp++"\\"++root++".tmp") to then (tmp++"/"++root++".tmp") Then, because you are bootstrapping via C, you will need to re-generate the .hc file from this source before continuing with the build: ( cd src/hmake && ../../script/nhc98 -C RunAndReadStdout.hs ) make Regards, Malcolm

Got it working with that fix - although I couldn't get the nhc98 -C step to
work to compile the fixed .hs file (it complained about not finding
Platform.hi in any of several locations, even after a full successful build
there is still no Platform.hi anywhere - should there be?) so I just
hand-modified the (encoded) string constant in RunAndReadStdout.hc.)
So now I'm free to play with nhc98, thanks!
I have another question though: on the "Building/Installing nhc98" page it
says that if you build using the C compiler only the resulting compiler is
slower. Why? I would have thought the hc files were directly from nhc (or
ghc?) in the first place (and if from ghc then wouldn't the resulting
compiler be faster than an nhc-bootstrapped compiler)? Anyway, now that I
have built from C sources should I bootstrap through the resulting nhc98?
Plus a small correction for the "Installing nhc98 under Windows" page: you
also need cygwin's 'bc' tool which is not installed by default.
-- Dave
----- Original Message -----
From: "Malcolm Wallace"
"David Bakin"
writes: I'm having trouble building nhc98 using bootstrap-from-C - the following shows the error I'm getting. It is actually executing in hmake3.config
I/O error: action : openFile ReadMode on file: /cygdrive/c/TEMP\hmakeconfig.tmp gave : ENOENT (No such file or directory)
I believe the problem here is the mixture of directory separators. When compiled by ghc the mix doesn't matter, but it does matter in a pure C-under-cygwin build, which likes to pretend to be Unix as much as possible.
In src/hmake/RunAndReadStdout.hs, try changing
tmpfile root = ... if windows then (tmp++"\\"++root++".tmp") to then (tmp++"/"++root++".tmp")
Then, because you are bootstrapping via C, you will need to re-generate the .hc file from this source before continuing with the build:
( cd src/hmake && ../../script/nhc98 -C RunAndReadStdout.hs ) make
Regards, Malcolm

"David Bakin"
Got it working with that fix - although I couldn't get the nhc98 -C step to work to compile the fixed .hs file (it complained about not finding Platform.hi in any of several locations, even after a full successful build there is still no Platform.hi anywhere - should there be?)
I now see that RunAndReadStdout imports Platform, so you would have needed to nhc98-compile the latter to generate a .hi file before you could successfully nhc98-compile the former. The .hi files are not needed when bootstrapping via C, but of course the Haskell compiler itself requires them (and generates them).
I have another question though: on the "Building/Installing nhc98" page it says that if you build using the C compiler only the resulting compiler is slower. Why?
The C-bootstrapped compiler is exactly the nhc98 compiler built with itself. Any program built by nhc98 runs on average 4-5x slower than the same program built by ghc - this is the usual tradeoff between space and speed optimisations.
Anyway, now that I have built from C sources should I bootstrap through the resulting nhc98?
I wouldn't recommend it. You will end up with an identical compiler, but spend a lot of time getting there!
Plus a small correction for the "Installing nhc98 under Windows" page: you also need cygwin's 'bc' tool which is not installed by default.
I don't recall using 'bc' anywhere in the build scripts - can you let me know the location where you needed it please? Regards, Malcolm

script/tprofprel line 21
----- Original Message -----
From: "Malcolm Wallace"
Plus a small correction for the "Installing nhc98 under Windows" page:
you
also need cygwin's 'bc' tool which is not installed by default.
I don't recall using 'bc' anywhere in the build scripts - can you let me know the location where you needed it please?
participants (2)
-
David Bakin
-
Malcolm Wallace