* George Bosilca wrote on Wed, Jan 18, 2006 at 10:39:48PM CET:
> I have some troubles on windows getting the correct path for the ompi
> installation directory as well as all tools used inside. We need this
> path in order to be able to use the wrappers compilers, to load the
> shared libraries and so on. I dig on the web and I come up with a
> solution. If involve replacing the path define (it's always a define
> for us) with a shell command. Depending on the OS this shell command
> will do the magic to setup correctly the path. Here is an example:
> Actual code:
> Patched code:
> -DOMPI_PKGLIBDIR=\""`@PATH_CONVERTOR@ '$(pkglibdir)'`\""
> On all UNIX flavors the PATH_CONVERTOR will be set to echo. On cygwin
> will be set to "cygpath -m" so we will get the correct windows path.
> I'm still looking on how to set it correctly on mingw.
You might want to try
cmd.exe //c $program_to_execute "$@"
which will cause the mingw runtime to do path translation on all
arguments. Watch out, though, this will generate backslashes,
similar to 'cygpath -w' but unlike 'cygpath -m'.
Likely, some other OpenMPI macros will need to be adjusted for this.
Within Libtool, we mostly use this idiom to detect absolute path names:
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) $commands_for_absolute_paths ;;
*) $other_commands ;;
(The nontrivial bit here is that using [/\\] instead of [\\/] is not
portable due to buggy shells.)
These threads may also be important to you (esp. for paths that do not
Also note that Automake has $(CYGPATH_W), which may be useful for you.
> I attached the patch to this email. If you know or can find a
> simplest way I will be happy to hear about. As usual all comments are
> welcome :)
| + -DOMPI_PREFIX=\""`@PATH_CONVERTOR@ '$(prefix)'`\"" \
Since you already AC_SUBST([PATH_CONVERTOR]), you can write
-DOMPI_PREFIX=\""`$(PATH_CONVERTOR) '$(prefix)'`\"" \
here. Instead of changing all paths in the Makefiles only, you could
try to do the translation at configure time already. A related thing
you will encounter is that users will pass translated paths already
(rather, some automatism will cause translated paths to be passed),
so macros should probably be aware of that anyway.