Hi Johannes. Notice that the build fails the first time that "ghc-inplace" gets called. Now look back at your configure output and see the line: checking whether we can open files in binary mode... no which should read: checking whether we can open files in binary mode... yes The problem is that when this step goes wrong on Windows, the compiler is built in such a way that it can't read binary files (eg "*.hi") correctly. I'm afraid I can't remember what caused this configuration test to go wrong for me in the past, but I solved it by looking at the file "configure.log", which I suggest you do. I seem to recall that, due to a compiler configuration problem, a header or library was not found, which meant that the test program was doomed to fail. I can't say that this is the only problem you will have, but it is certainly fatal on Windows so: Best of luck! Mike Thomas. -----Original Message----- From: glasgow-haskell-users-admin@haskell.org [mailto:glasgow-haskell-users-admin@haskell.org]On Behalf Of johago@web.de Sent: Sunday, May 18, 2003 2:15 AM To: glasgow-haskell-users@haskell.org Subject: building ghc from source Hi there! I'm trying to build ghc from scratch under Windows XP... which gives me problems, problems, problems... Steps taken: 1. Installed latest ghc (v5.04.3) 2. Installed happy (v1.13) 3. Unpacked current ghc source distribution (ghc-5.04.3-src.tar.bz2) to c:/build/ghc 4. Downloaded the latest Cygwin distribution and installed it to c:/cygwin 5. Got latest MinGW distribution (MinGW-2.0.0-3.exe) and installed it to c:/MinGW 6. Added /cygdrive/c/MinGW/bin to path in /etc/profile 7. Started Cygwin bash 8. Changed directory to /cygdrive/c/build/ghc 9. Entered "./configure --host=i386-unknown-mingw32 --with-gcc=/cygdrive/c/MinGW/bin/gc c". No errors occurred. --- snip --- $ ./configure --host=i386-unknown-mingw32 --with-gcc=/cygdrive/c/MinGW/bin/gcc creating cache ./config.cache *** The top of your build tree is: /cygdrive/c/build/ghc checking host system type... i386-unknown-mingw32 checking target system type... i386-unknown-mingw32 checking build system type... i386-unknown-mingw32 Canonicalised to: i386-unknown-mingw32 checking for ghc... /cygdrive/c/ghc/ghc-5.04.3/bin/ghc checking version of ghc... 5.04.3 checking for nhc... no checking for nhc98... no checking for hbc... no checking whether #! works in shell scripts... yes checking for perl... /bin/perl checking if your perl works in shell scripts... yes checking for gcc... /cygdrive/c/MinGW/bin/gcc checking whether the C compiler (/cygdrive/c/MinGW/bin/gcc ) works... yes checking whether the C compiler (/cygdrive/c/MinGW/bin/gcc ) is a cross-compile r... no checking whether we are using GNU C... yes checking whether /cygdrive/c/MinGW/bin/gcc accepts -g... yes checking whether you have an ok gcc... yes checking how to run the C preprocessor... /cygdrive/c/MinGW/bin/gcc -E checking whether /cygdrive/c/MinGW/bin/gcc accepts -mno-cygwin... yes checking for ok way to do context diffs... diff -C 1 checking for find... /usr/bin/find checking for bison... no checking for byacc... no checking if it is an OK yacc... checking for what... : yacc checking for flex... flex checking for a BSD compatible install... /usr/bin/install -c checking for ar... /cygdrive/c/MinGW/bin/ar checking whether ln -s works... yes checking for sed... /usr/bin/sed checking for time... /usr/bin/time checking for gtar... no checking for tar... /usr/bin/tar checking for gzip... /usr/bin/gzip checking for openjade... no checking for jade... no checking for DocBook CATALOG... no Warning: You will not be able to build the documentation. checking for happy... /cygdrive/c/happy/happy-1.13/bin/happy checking for version of happy... 1.13 checking for haddock... no checking for ANSI C header files... yes checking for Files.h... no checking for arpa/inet.h... no checking for assert.h... yes checking for console.h... no checking for ctype.h... yes checking for dirent.h... yes checking for errno.h... yes checking for fcntl.h... yes checking for float.h... yes checking for ftw.h... no checking for grp.h... no checking for ieee754.h... no checking for inttypes.h... yes checking for limits.h... yes checking for malloc.h... yes checking for memory.h... yes checking for nlist.h... no checking for pascal.h... no checking for pwd.h... no checking for sgtty.h... no checking for siginfo.h... no checking for signal.h... yes checking for stat.h... no checking for stdint.h... yes checking for stdlib.h... yes checking for stddef.h... yes checking for stdarg.h... yes checking for string.h... yes checking for sys/fault.h... no checking for sys/file.h... yes checking for sys/ioctl.h... no checking for sys/limits.h... no checking for sys/mman.h... no checking for sys/param.h... yes checking for sys/procfs.h... no checking for sys/resource.h... no checking for sys/signal.h... no checking for sys/socket.h... no checking for netdb.h... no checking for netinet/in.h... no checking for netinet/tcp.h... no checking for sys/stat.h... yes checking for sys/syscall.h... no checking for sys/time.h... yes checking for sys/timeb.h... yes checking for sys/timers.h... no checking for sys/times.h... no checking for sys/types.h... yes checking for sys/un.h... no checking for sys/utsname.h... no checking for sys/vadvise.h... no checking for sys/wait.h... no checking for termio.h... no checking for termios.h... no checking for time.h... yes checking for types.h... no checking for unistd.h... yes checking for utime.h... no checking for values.h... yes checking for vfork.h... no checking for bfd.h... yes checking for winsock.h... yes checking for pthread.h... no checking for sys/uio.h... no checking for readline/readline.h... no checking for readline/history.h... no checking for dos.h... yes checking for conio.h... yes checking for io.h... yes checking for std.h... no checking for windows.h... yes checking for GL/gl.h... yes checking whether time.h and sys/time.h may both be included... yes checking for dlfcn.h... no checking for dl.h... no checking for alloc.h... no checking for malloc.h... (cached) yes checking for valloc... no checking for regex.h... no checking whether struct tm is in sys/time.h or time.h... time.h checking for tm_zone in struct tm... no checking for tzname... no checking timezone... yes checking type of timezone... time_t checking altzone... no checking for st_blksize in struct stat... no checking whether /cygdrive/c/MinGW/bin/gcc supports long long types... yes checking for msg_accrights in struct msghdr... no checking for msg_control in struct msghdr... no checking size of char... 1 checking size of double... 8 checking size of float... 4 checking size of int... 4 checking size of long... 4 checking size of long long... 8 checking size of short... 2 checking size of unsigned char... 1 checking size of unsigned int... 4 checking size of unsigned long... 4 checking size of unsigned long long... 8 checking size of unsigned short... 2 checking size of void *... 4 checking alignment of char... 1 checking alignment of double... 8 checking alignment of float... 4 checking alignment of int... 4 checking alignment of long... 4 checking alignment of long long... 8 checking alignment of short... 2 checking alignment of unsigned char... 1 checking alignment of unsigned int... 4 checking alignment of unsigned long... 4 checking alignment of unsigned long long... 8 checking alignment of unsigned short... 2 checking alignment of void *... 4 checking Haskell type for char... Int8 checking Haskell type for signed char... Int8 checking Haskell type for unsigned char... Word8 checking Haskell type for short... Int16 checking Haskell type for unsigned short... Word16 checking Haskell type for int... Int32 checking Haskell type for unsigned int... Word32 checking Haskell type for long... Int32 checking Haskell type for unsigned long... Word32 checking Haskell type for long long... Int64 checking Haskell type for unsigned long long... Word64 checking Haskell type for float... Float checking Haskell type for double... Double checking Haskell type for ptrdiff_t... Int32 checking Haskell type for size_t... Word32 checking Haskell type for wchar_t... Word16 checking Haskell type for sig_atomic_t... Int32 checking Haskell type for clock_t... Int32 checking Haskell type for time_t... Int32 checking Haskell type for dev_t... Word32 checking Haskell type for ino_t... Int16 checking Haskell type for mode_t... Word16 checking Haskell type for off_t... Int32 checking Haskell type for pid_t... Int32 checking Haskell type for gid_t... NotReallyAType checking Haskell type for uid_t... NotReallyAType checking Haskell type for cc_t... NotReallyAType checking Haskell type for speed_t... NotReallyAType checking Haskell type for tcflag_t... NotReallyAType checking Haskell type for nlink_t... NotReallyAType checking Haskell type for ssize_t... NotReallyAType checking whether we can open files in binary mode... no checking return type of signal handlers... void checking for strcasecmp... yes checking for _stricmp... yes checking for stricmp... yes checking for strcmpi... yes checking for strcmp... yes checking for realpath... no checking for _fullpath... yes checking for PBHSetVolSync... no checking for macsystem... no checking for fgetpos... yes checking for fsetpos... yes checking for fseek... yes checking for ftell... yes checking for vsnprintf... yes checking for _vsnprintf... yes checking for snprintf... yes checking for _snprintf... yes checking for popen... yes checking for _popen... yes checking for pclose... yes checking for _pclose... yes checking for access... yes checking for ftime... yes checking for getclock... no checking for getpagesize... yes checking for getrusage... no checking for gettimeofday... no checking for mktime... yes checking for mprotect... yes checking for readlink... no checking for setitimer... no checking for stat... yes checking for lstat... no checking for symlink... no checking for sysconf... no checking for timelocal... no checking for times... no checking for vadvise... no checking for vfork... no checking for localtime_r... no checking for gmtime_r... no checking for readdir_r... no checking for __gmpz_fdiv_qr in -lgmp... no checking for __gmpz_fdiv_qr in -lgmp3... no checking for closedir in -lmingwex... yes checking for GNU regex in libc... no checking for xmalloc in -liberty... yes checking for bfd_init in -lbfd... yes checking for tputs in -lncurses... no checking for tputs in -ltermcap... no checking for tputs in -lcurses... no checking for main in -lm... yes checking for library containing glEnd... no checking for library containing gluNewQuadric... no checking for library containing glXWaitX... no checking for library containing glutMainLoop... no checking OpenGL flags... checking OpenGL libs... -lX11 -lXext -lXmu -lXt -lXi -lm dl: not found checking for dlopen in -ldl... no checking for dlopen... no checking for RTLD_NEXT from dlfcn.h... no checking for RTLD_LOCAL from dlfcn.h... no checking for function_atan... yes checking for in_addr_t in netinet/in.h... no checking for gtk-config... no checking for gtk12-config... no configure: warning: GTK+ not usable; need at least version 1.2 checking for working alloca.h... no checking for alloca... yes checking for working const... yes checking prototypes... yes checking whether byte ordering is bigendian... no checking for nlist in -lelf... no checking leading underscore in symbol names... yes checking for end of text section marker... etext checking for end of text section marker declaration... etext asm("etext") checking for end of data section marker... end checking for end of data section marker declaration... end checking if code section appears before data... yes checking for ld... /cygdrive/c/MinGW/bin/ld checking whether ld understands -x... yes updating cache ./config.cache creating ./config.status creating mk/config.mk creating mk/config.h configuring in ghc running /bin/sh ./configure --host=i386-unknown-mingw32 --with-gcc=/cygdrive/c/ MinGW/bin/gcc --cache-file=.././config.cache --srcdir=. loading cache .././config.cache updating cache .././config.cache creating ./config.status creating ghc.spec creating docs/index.html --- snap --- 10. Entered "make". Some warnings were given frequently: --- snip --- Warning: foreign declaration uses deprecated non-standard syntax --- snap --- and --- snip --- Warning: .type pseudo-op used outside of .def/.endef ignored. --- snap --- and --- snip --- Warning: rest of line ignored; first ignored character is `_' --- snap --- Finally there was an error: --- snip --- [...] /bin/sh ./libtool --mode=link /cygdrive/c/MinGW/bin/gcc -g -O2 -o libgmp.la - rpath /usr/local/lib -version-info 4:1:1 assert.lo compat.lo errno.lo memory.lo mp_set_fns.lo mp_clz_tab.lo mp_minv_tab.lo rand.lo randclr.lo randlc.lo randlc2x .lo randraw.lo randsd.lo randsdui.lo version.lo stack-alloc.lo mp_bpl.lo extract -dbl.lo insert-dbl.lo mpz/abs.lo mpz/add.lo mpz/add_ui.lo mpz/addmul_ui.lo mpz/ and.lo mpz/array_init.lo mpz/bin_ui.lo mpz/bin_uiui.lo mpz/cdiv_q.lo mpz/cdiv_q_ ui.lo mpz/cdiv_qr.lo mpz/cdiv_qr_ui.lo mpz/cdiv_r.lo mpz/cdiv_r_ui.lo mpz/cdiv_u i.lo mpz/clear.lo mpz/clrbit.lo mpz/cmp.lo mpz/cmp_si.lo mpz/cmp_ui.lo mpz/cmpab s.lo mpz/cmpabs_ui.lo mpz/com.lo mpz/divexact.lo mpz/dump.lo mpz/fac_ui.lo mpz/f div_q.lo mpz/fdiv_q_2exp.lo mpz/fdiv_q_ui.lo mpz/fdiv_qr.lo mpz/fdiv_qr_ui.lo mp z/fdiv_r.lo mpz/fdiv_r_2exp.lo mpz/fdiv_r_ui.lo mpz/fdiv_ui.lo mpz/fib_ui.lo mpz /fits_sint_p.lo mpz/fits_slong_p.lo mpz/fits_sshort_p.lo mpz/fits_uint_p.lo mpz/ fits_ulong_p.lo mpz/fits_ushort_p.lo mpz/gcd.lo mpz/gcd_ui.lo mpz/gcdext.lo mpz/ get_d.lo mpz/get_si.lo mpz/get_str.lo mpz/get_ui.lo mpz/getlimbn.lo mpz/hamdist. lo mpz/init.lo mpz/inp_raw.lo mpz/inp_str.lo mpz/invert.lo mpz/ior.lo mpz/iset.l o mpz/iset_d.lo mpz/iset_si.lo mpz/iset_str.lo mpz/iset_ui.lo mpz/jacobi.lo mpz/ kronsz.lo mpz/kronuz.lo mpz/kronzs.lo mpz/kronzu.lo mpz/lcm.lo mpz/legendre.lo m pz/mod.lo mpz/mul.lo mpz/mul_2exp.lo mpz/mul_si.lo mpz/mul_ui.lo mpz/neg.lo mpz/ nextprime.lo mpz/out_raw.lo mpz/out_str.lo mpz/perfpow.lo mpz/perfsqr.lo mpz/pop count.lo mpz/pow_ui.lo mpz/powm.lo mpz/powm_ui.lo mpz/pprime_p.lo mpz/random.lo mpz/random2.lo mpz/realloc.lo mpz/remove.lo mpz/root.lo mpz/rrandomb.lo mpz/scan 0.lo mpz/scan1.lo mpz/set.lo mpz/set_d.lo mpz/set_f.lo mpz/set_q.lo mpz/set_si.l o mpz/set_str.lo mpz/set_ui.lo mpz/setbit.lo mpz/size.lo mpz/sizeinbase.lo mpz/s qrt.lo mpz/sqrtrem.lo mpz/sub.lo mpz/sub_ui.lo mpz/swap.lo mpz/tdiv_ui.lo mpz/td iv_q.lo mpz/tdiv_q_2exp.lo mpz/tdiv_q_ui.lo mpz/tdiv_qr.lo mpz/tdiv_qr_ui.lo mpz /tdiv_r.lo mpz/tdiv_r_2exp.lo mpz/tdiv_r_ui.lo mpz/tstbit.lo mpz/ui_pow_ui.lo mp z/urandomb.lo mpz/urandomm.lo mpz/xor.lo mpn/mp_bases.lo mpn/udiv.lo mpn/umul.lo mpn/inlines.lo mpn/add_n.lo mpn/sub_n.lo mpn/mul_1.lo mpn/addmul_1.lo mpn/submu l_1.lo mpn/lshift.lo mpn/rshift.lo mpn/diveby3.lo mpn/divrem.lo mpn/divrem_1.lo mpn/divrem_2.lo mpn/mod_1.lo mpn/mod_1_rs.lo mpn/pre_mod_1.lo mpn/dump.lo mpn/mu l.lo mpn/mul_fft.lo mpn/mul_n.lo mpn/mul_basecase.lo mpn/sqr_basecase.lo mpn/ran dom.lo mpn/random2.lo mpn/sqrtrem.lo mpn/get_str.lo mpn/set_str.lo mpn/scan0.lo mpn/scan1.lo mpn/popcount.lo mpn/hamdist.lo mpn/cmp.lo mpn/perfsqr.lo mpn/bdivmo d.lo mpn/gcd_1.lo mpn/gcd.lo mpn/gcdext.lo mpn/tdiv_qr.lo mpn/bz_divrem_n.lo mpn /sb_divrem_mn.lo mpn/jacbase.lo mpn/copyi.lo mpn/copyd.lo mkdir .libs libtool: link: warning: undefined symbols not allowed in i386-unknown-mingw32 sh ared libraries rm -fr .libs/libgmp.la .libs/libgmp.* .libs/libgmp.* ar cru .libs/libgmp.a assert.o compat.o errno.o memory.o mp_set_fns.o mp_clz_ta b.o mp_minv_tab.o rand.o randclr.o randlc.o randlc2x.o randraw.o randsd.o randsd ui.o version.o stack-alloc.o mp_bpl.o extract-dbl.o insert-dbl.o mpz/abs.o mpz/a dd.o mpz/add_ui.o mpz/addmul_ui.o mpz/and.o mpz/array_init.o mpz/bin_ui.o mpz/bi n_uiui.o mpz/cdiv_q.o mpz/cdiv_q_ui.o mpz/cdiv_qr.o mpz/cdiv_qr_ui.o mpz/cdiv_r. o mpz/cdiv_r_ui.o mpz/cdiv_ui.o mpz/clear.o mpz/clrbit.o mpz/cmp.o mpz/cmp_si.o mpz/cmp_ui.o mpz/cmpabs.o mpz/cmpabs_ui.o mpz/com.o mpz/divexact.o mpz/dump.o mp z/fac_ui.o mpz/fdiv_q.o mpz/fdiv_q_2exp.o mpz/fdiv_q_ui.o mpz/fdiv_qr.o mpz/fdiv _qr_ui.o mpz/fdiv_r.o mpz/fdiv_r_2exp.o mpz/fdiv_r_ui.o mpz/fdiv_ui.o mpz/fib_ui .o mpz/fits_sint_p.o mpz/fits_slong_p.o mpz/fits_sshort_p.o mpz/fits_uint_p.o mp z/fits_ulong_p.o mpz/fits_ushort_p.o mpz/gcd.o mpz/gcd_ui.o mpz/gcdext.o mpz/get _d.o mpz/get_si.o mpz/get_str.o mpz/get_ui.o mpz/getlimbn.o mpz/hamdist.o mpz/in it.o mpz/inp_raw.o mpz/inp_str.o mpz/invert.o mpz/ior.o mpz/iset.o mpz/iset_d.o mpz/iset_si.o mpz/iset_str.o mpz/iset_ui.o mpz/jacobi.o mpz/kronsz.o mpz/kronuz. o mpz/kronzs.o mpz/kronzu.o mpz/lcm.o mpz/legendre.o mpz/mod.o mpz/mul.o mpz/mul _2exp.o mpz/mul_si.o mpz/mul_ui.o mpz/neg.o mpz/nextprime.o mpz/out_raw.o mpz/ou t_str.o mpz/perfpow.o mpz/perfsqr.o mpz/popcount.o mpz/pow_ui.o mpz/powm.o mpz/p owm_ui.o mpz/pprime_p.o mpz/random.o mpz/random2.o mpz/realloc.o mpz/remove.o mp z/root.o mpz/rrandomb.o mpz/scan0.o mpz/scan1.o mpz/set.o mpz/set_d.o mpz/set_f. o mpz/set_q.o mpz/set_si.o mpz/set_str.o mpz/set_ui.o mpz/setbit.o mpz/size.o mp z/sizeinbase.o mpz/sqrt.o mpz/sqrtrem.o mpz/sub.o mpz/sub_ui.o mpz/swap.o mpz/td iv_ui.o mpz/tdiv_q.o mpz/tdiv_q_2exp.o mpz/tdiv_q_ui.o mpz/tdiv_qr.o mpz/tdiv_qr _ui.o mpz/tdiv_r.o mpz/tdiv_r_2exp.o mpz/tdiv_r_ui.o mpz/tstbit.o mpz/ui_pow_ui. o mpz/urandomb.o mpz/urandomm.o mpz/xor.o mpn/mp_bases.o mpn/udiv.o mpn/umul.o m pn/inlines.o mpn/add_n.o mpn/sub_n.o mpn/mul_1.o mpn/addmul_1.o mpn/submul_1.o m pn/lshift.o mpn/rshift.o mpn/diveby3.o mpn/divrem.o mpn/divrem_1.o mpn/divrem_2. o mpn/mod_1.o mpn/mod_1_rs.o mpn/pre_mod_1.o mpn/dump.o mpn/mul.o mpn/mul_fft.o mpn/mul_n.o mpn/mul_basecase.o mpn/sqr_basecase.o mpn/random.o mpn/random2.o mpn /sqrtrem.o mpn/get_str.o mpn/set_str.o mpn/scan0.o mpn/scan1.o mpn/popcount.o mp n/hamdist.o mpn/cmp.o mpn/perfsqr.o mpn/bdivmod.o mpn/gcd_1.o mpn/gcd.o mpn/gcde xt.o mpn/tdiv_qr.o mpn/bz_divrem_n.o mpn/sb_divrem_mn.o mpn/jacbase.o mpn/copyi. o mpn/copyd.o creating libgmp.la (cd .libs && rm -f libgmp.la && ln -s ../libgmp.la libgmp.la) make[5]: Leaving directory `/cygdrive/c/build/ghc/ghc/rts/gmp' make[4]: Leaving directory `/cygdrive/c/build/ghc/ghc/rts/gmp' ../utils/ghc-pkg/ghc-pkg-inplace --update-package <rts.conf.inplace Reading package info from stdin... done. Expanding embedded variables...done. warning: can't find GHCi lib `HSrts.o' Saving old package config file... done. Writing new package config file... done. ../utils/ghc-pkg/ghc-pkg-inplace -f ../driver/package.conf --update-package <rt s.conf.installed Reading package info from stdin... done. Expanding embedded variables...done. warning: can't find GHCi lib `HSrts.o' Saving old package config file... done. Writing new package config file... done. ../../ghc/compiler/ghc-inplace -optc-mno-cygwin -optc-O -optc-Wall -optc-W - optc -Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -o ptc- Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-Wcast-align - optc -I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-fr am e-po inter -O2 -static -package-name rts -O -Rghc-timing -c Adjustor.c -o Adjusto r.o <<ghc: 629196 bytes, 2 GCs, 19832/19832 avg/max bytes residency (1 samples), 5M in use, 0.01 INIT (0.02 elapsed), 0.00 MUT (0.02 elapsed), 0.02 GC (0.03 elapsed ) :ghc>> make[2]: *** [Adjustor.o] Error 1 make[1]: *** [all] Error 1 make[1]: Leaving directory `/cygdrive/c/build/ghc/ghc' make: *** [all] Error 1 --- snap --- Thanks very much for your suggestions in advance Bye, Johannes johago@web.de