[m-users.] Path independence?
jfischer at opturion.com
Fri Jul 26 18:05:01 AEST 2013
On Fri, 26 Jul 2013, Mark Green wrote:
> I recently tried moving a working Mercury install from one machine to
> another and was surprised that the prefix path appears to be
> hard-wired into the built executable so that it will not run when
> placed in another location.
> Is it possible to change or override the compiled-in path? Something
> like a MERCURY_HOME environment variable or just defaulting to the
> directory mmc.exe is in?
The paths are not hard-wired into the executable. They are set by
various shell scripts (or batch files) plus a configuration file.
On Unix-like system the mmc batch file (the actual compiler exectuable
is called mercury_compile), sets the following environment variables:
The former says where to find the mercury_compile executable; the latter
specifies the location of the file Mercury.config whose contents
describe the other details of the installation. You can override these
settings in the environment if you wish.
The mercury.bat file does a similar thing to the mmc script on Windows.
(You'll have to edit that file to change the settings though.)
The Mercury.config files resides in <INSTALL-PREFIX>/lib/mercury/conf.
Some of the setting therein can be overridden in the environment, the
main one of interest being MERCURY_STDLIB_DIR, which tells the compiler
where to find the standard library.
More information about the users