[mercury-users] Building Mercury on Windows

Sergey Khorev sergey.khorev at gmail.com
Mon Feb 7 02:07:03 AEDT 2005


Hi, I'd like to share some experience with building ROTD on latest
Cygwin (1.5.12-1).

1) scripts/ml hangs when trying to demangle (so I've set
demangle=false by hands in ml :)
I guess it arises from poor Cygwin FIFOs. Also I wonder whether latest
Mercury is tested under Cygwin.
Either this is latest Cygwin "feature" or Mercury team uses cross-gcc :)

2) gcc-3.3.x issues internal error during compilation , so I used gcc 3.4.1-1.

3) java grade build fails (unfortunately, I didn't write down Mercury error :(


Also I tried to build Mercury for MinGW (with -mno-cygwin)

1) trace/mercury_trace contains error at line 489:
    jumpaddr = MR_trace_event_internal(cmd, interactive, &event_info);

  Indeed, MR_trace_event_internal accepts four arguments.
I guess it should be something like

*** mercury_trace.c.bak	Fri Jan 28 09:42:54 2005
--- mercury_trace.c	Sat Feb 05 15:25:17 2005
***************
*** 472,478 ****
          }
  
          jumpaddr = MR_trace_event_external(cmd, &event_info);
!     } else {
          MR_Spy_Action       action;         /* ignored */
          MR_Spy_Print_List   print_list;
  
--- 472,485 ----
          }
  
          jumpaddr = MR_trace_event_external(cmd, &event_info);
!     } else
! #endif
!     /*
!     ** We should get here only if MR_trace_handler == MR_TRACE_INTERNAL.
!     ** This is enforced by mercury_wrapper.c.
!     */
! 
!     {
          MR_Spy_Action       action;         /* ignored */
          MR_Spy_Print_List   print_list;
  
***************
*** 480,493 ****
          jumpaddr = MR_trace_event_internal(cmd, interactive, print_list,
              &event_info);
      }
- #else
-     /*
-     ** We should get here only if MR_trace_handler == MR_TRACE_INTERNAL.
-     ** This is enforced by mercury_wrapper.c.
-     */
- 
-     jumpaddr = MR_trace_event_internal(cmd, interactive, &event_info);
- #endif
  
      /*
      ** Whenever the debugger changes the flow of control, e.g. by
--- 487,492 ----


2) Also SIFPROF is not defined and should be removed (of #ifdef'ed)
from boehm_gc/if_not_there.c

3) It seems that instruction in README.MS-Windows is slightly
incorrect, when it says about
replacing mercury_compile.exe. I think that mercury_compile.exe should
be replaced with Cygwin versions
after `make` but before `make install` and then `touched` to prevent
its rebuild. If not replaced, MinGW Mercury
will look for /cygdrive/... files, (transformed into \cygdrive\...).
Or maybe these lines should be cygpath'ed...
Example of a such error:

mmc --generate-dependencies --grade hlc.gc      --config-file /src/mercury-compi
ler-rotd-2005-01-28-mingw/tmp_dir/scripts/Mercury.config.bootstrap --no-mercury-
stdlib-dir -I/src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/library --c-inc
lude-directory /src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/boehm_gc --c-
include-directory /src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/boehm_gc/i
nclude --c-include-directory /src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir
/mps_gc/code --c-include-directory /src/mercury-compiler-rotd-2005-01-28-mingw/t
mp_dir/runtime -L/src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/boehm_gc -L
/src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/mps_gc/code -L/src/mercury-c
ompiler-rotd-2005-01-28-mingw/tmp_dir/runtime -L/src/mercury-compiler-rotd-2005-
01-28-mingw/tmp_dir/library -L/src/mercury-compiler-rotd-2005-01-28-mingw/tmp_di
r/trace -L/src/mercury-compiler-rotd-2005-01-28-mingw/tmp_dir/mdbcomp -L/src/mer
cury-compiler-rotd-2005-01-28-mingw/tmp_dir/browser --no-infer-all --halt-at-war
n --no-warn-inferred-erroneous --strict-sequential --trace minimum --generate-mm
c-deps --transitive-intermodule-optimization --no-warn-smart-recompilation --ena
ble-termination  -R/usr/local/mercury-rotd-2005-01-28-mingw/lib/mercury/lib/hlc.
gc/i686-pc-cygwin -R/usr/local/mercury-rotd-2005-01-28-mingw/lib/mercury/lib/i68
6-pc-cygwin --no-shlib-linker-use-install-name  --no-warn-nothing-exported   mer
_std
Error reading options file `\src\mercury-compiler-rotd-2005-01-28-mingw\tmp_dir\
scripts\Mercury.config.bootstrap'.
For more information, try recompiling with `-E'.

4) configure doesn't detect that hlc.par.gc couldn't be built with MinGW version
(or, maybe, MinGW version should try to use Windows threads rather
than pthreads?)


5) For some strange reason build of hl.gc grade failed in boehm_gc
stage (it didn't find gc.a),
It said that I can remove tmp_dir and restart the installation.
When I removed tmp_dir and `make install` again, all goes OK. But INSTALL
says "you may need to start from scratch again", so is tmp_dir removal safe?
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list