← Back to team overview

dolfin team mailing list archive

Re: parsing parameters

 

On Tuesday 08 December 2009 11:17:17 Andy Ray Terrel wrote:
> On Tue, Dec 8, 2009 at 1:00 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Tue, Dec 08, 2009 at 12:42:20PM -0600, Andy Ray Terrel wrote:
> >> Am I doing something wrong here or is this a bug?
> >>
> >> dolfin/demo/parameters/cpp$ ./demo --foo 1.0
> >>
> >> results in:
> >>
> >> Parsing command-line arguments...
> >> terminate called after throwing an instance of
> >> 'boost::exception_detail::clone_impl<boost::exception_detail::error_info
> >>_injector<boost::program_options::unknown_option>
> >>
> >> >'
> >>
> >>   what():  unknown option foo
> >>
> >>
> >> this is happens on both my mac and ubuntu boxes.
> >>
> >> -- Andy
> >
> > You're doing it all wrong! It should be "bar", not "foo".

This was actually a bug. 

We had not updated the logic for parsing real from the command line. I have 
pushed a fix for your case, (we can now also parse bool ;) ). However 
someone(TM) need to look over the logic for having GMP and not. I do not have 
gmp so my fix might screw things up for those who have.

Johan

> > --
> > Anders
> 
> Shouldn't foo work or is there some other way to specify it on the
> command line.  I have this trouble with all reals.  From the demo:
> 
>  Parameters application_parameters("application_parameters");
> 
>   // Create application parameters
>   application_parameters.add("foo", 1.0);
>   application_parameters.add("bar", 100);
>   application_parameters.add("pc", "amg");
>   // Parse command-line options
>   application_parameters.parse(argc, argv);
> 
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iEYEARECAAYFAkseojgACgkQTuwUCDsYZdGtnACgl0gyt4U1qk5pYLoE/zOCtEuV
> > 2O4An1pAdHfgcoNQeJm6jPUgZ178fox5
> > =aj6q
> > -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp
> 



References