[mercury-users] mmc --make and not installed libraries

Ian MacLarty maclarty at csse.unimelb.edu.au
Wed Nov 8 10:42:10 AEDT 2006


On Tue, Nov 07, 2006 at 04:36:10PM +0100, Ondrej Bojar wrote:
> Hi.
> 
> Recently, I started to prefer 'mmc --make' to 'mmake'. However, I am not
> able to transform an older mmake trick for mmc. I want to use custom
> mercury libraries in other mercury programs without the necessity of
> installing the libraries over and over. (In fact, I'm debugging library
> routines by using them in another program.)
> 
> For mmake, the trick was to add a few lines to Mmakefile of the program
> and just compile the library in its place and then compile the program
> in its place:
> 
> NONINSTALLED_LIBRARIES=tools concurrency
> NONINSTALLED_LIB_DIRS=$(HOME)/tools/obomerclib \
>                       $(HOME)/tools/src/concurrency
> NONINSTALLED_LIB_INITS=$(HOME)/tools/obomerclib/tools.init \
>   $(HOME)/tools/src/concurrency/concurrency.init
> 
> # Tell mmake to use the noninstalled libraries:
> empty:=
> space:= $(empty) $(empty)
> VPATH=$(subst $(space),:,$(NONINSTALLED_LIB_DIRS)):$(MMAKE_VPATH)
> MCFLAGS=$(NONINSTALLED_LIB_DIRS:%=-I%) $(EXTRA_MCFLAGS)
> MLFLAGS=$(NONINSTALLED_LIB_DIRS:%=-R%) $(EXTRA_MLFLAGS) \
>         $(NONINSTALLED_LIB_DIRS:%=-L%)
> MLLIBS=$(NONINSTALLED_LIBRARIES:%=-l%) $(EXTRA_MLLIBS)
> C2INITARGS=$(NONINSTALLED_LIB_INITS)
> CFLAGS+= $(NONINSTALLED_LIB_DIRS:%=-I%)
> # End of inclusion of non-installed libraries
> 
> Now, both the library and the main programs are compiled with 'mmc
> --make --use-grade-subdirs'. Unfortunately all my attempts of adding the
> library directory to various search paths of mmc ended with a simple
> message: could not find some_library_module.m source file. I'm not
> exactly sure about the semantics of (g)make VPATH, but it seems to me
> that mmc would need to support a similar concept.
> 

Have you tried generating a Mercury.modules file with mmc -f?
If you do "mmc -f <path to libraries>/*.m <path to sources>/*.m" then a
Mercury.modules file will be generated that maps Mercury module names to
file locations.  Then all you need to do is "mmc --make <target>" and
mmc will use the Mercury.modules file to work out where to find any .m
files it needs.

Ian.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list