Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Users mailing list

From: Jeff Squyres \(jsquyres\) (jsquyres_at_[hidden])
Date: 2006-06-30 13:34:41


So I think we have some intelligence in DoCommand.pm already to handle
this kind of situation. Specifically, I think you can do:

        configure_arguments = "CFLAGS=-xarch=v8plusa -xO5"

I.e., if you move the first quote to the beginning of the token, I think
it'll work because DoCommand will treat the whole "CFLAGS=-xarch...O5"
as a single token. We could probably improve the parsing algorithm in
DoCommand.pm to be able to handle the embedded " (as in your first
example), but it might be a little messy. Sending in an explicit array
of tokens is also an option.

As a sidenote, I might have told you to do the CFLAGS="..." form. If
so, sorry... :-(
 

> -----Original Message-----
> From: mtt-users-bounces_at_[hidden]
> [mailto:mtt-users-bounces_at_[hidden]] On Behalf Of Ethan Mallove
> Sent: Friday, June 30, 2006 12:42 PM
> To: General user list for the MPI Testing Tool
> Subject: [MTT users] escaping quotes issue in DoCommand.pm
>
> I think there's an issue with escaping quotes either in DoCommand.pm,
> though there's an easy workaround.
>
> The problem is the following .ini param will not work for me
> without a
> minor change to OMPI:
>
> configure_arguments = CFLAGS="-xarch=v8plusa -xO5"
>
> Here's a simple test program that illustrates the issue:
>
> ---
>
> $ perl -I<path_to_your_mtt>/trunk/lib -d ./test_DoCommand
> $ cat test_DoCommand
> #!/usr/bin/perl
>
> use MTT::DoCommand;
>
> # works!
> MTT::DoCommand::Cmd(0, qw{./configure CFLAGS="-g -xarch=v8plusa"
> --enable-picky --enable-debug --disable-mpi-f90});
>
> # doesn't work
> MTT::DoCommand::Cmd(0, "./configure CFLAGS="-g -xarch=v8plusa"
> --enable-picky --enable-debug --disable-mpi-f90"});
>
> ---
>
> Here's the workaround that seems to do the trick:
>
> em162155_at_burl-ct-v440-6-a /workspace/em162155/hpc/mtt/trunk 234> svn
> diff lib/MTT/MPI/Install/OMPI.pm
> Index: lib/MTT/MPI/Install/OMPI.pm
> ===================================================================
> --- lib/MTT/MPI/Install/OMPI.pm (revision 185)
> +++ lib/MTT/MPI/Install/OMPI.pm (working copy)
> @@ -59,7 +59,7 @@
> $ret->{bindir} = "$ret->{installdir}/bin";
> $ret->{libdir} = "$ret->{installdir}/lib";
>
> - $x = MTT::DoCommand::Cmd(1, "$config->{configdir}/configure
> $config->{configure_arguments} --prefix=$ret->{installdir}");
> + $x = MTT::DoCommand::Cmd(1, ("$config->{configdir}/configure",
> $config->{configure_arguments}, "--prefix=$ret->{installdir}"));
> $stdout = $x->{stdout} ? "--- Configure stdout/stderr
> ---\n$x->{stdout}" :
> undef;
> if ($x->{status} != 0) {
>
> ---
>
> I think I would favor a revision to lines 101-133 in
> DoCommand because
> it seems more natural to write DoCommand("foo bar baz"), then
> DoCommand(foo, bar, baz). But I need to think more about how to do it.
>
> -Ethan
> _______________________________________________
> mtt-users mailing list
> mtt-users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-users
>