Commit 2cc48c10 authored by Mathieu Hemery's avatar Mathieu Hemery

Try to standalonize biochamlib

parent 9f72f4d1
#!/usr/bin/bash
swipl --goal=main --stand_alone=true -o quadratization -c biochamlib_quadratization.pl
swipl --goal=main --stand_alone=true -DSWIPL_SHARED_LIB=OFF --foreign=save\
-o quadratization -c biochamlib_quadratization.pl
......@@ -24,8 +24,40 @@
set_my_option(Option, Value) :-
change_item([], option, Option, option(Option: Value)).
main([Input|_Tail]) :-
% Naming handling
% parse_arguments(+Arguments, -Input, -Method, -Timeout)
%
% Handle the various option of the standalone:
% --method: method used to perform the reduction
% --timeout: timeout for sat call
% --help: print help and quit
% -i: input file
parse_arguments([], none, sat_species, 120).
parse_arguments(['--method', Method| Argv], Input, Method, Timeout) :-
parse_arguments(Argv, Input, _M, Timeout).
parse_arguments(['--timeout', Timeout| Argv], Input, Method, Timeout) :-
parse_arguments(Argv, Input, Method, _T).
parse_arguments(['-i', Input| Argv], Input, Method, Timeout) :-
parse_arguments(Argv, _I, Method, Timeout).
parse_arguments(['--help'| _Argv], _I, _M, _T) :-
print_help.
% print_help
print_help :-
format("help~n", []),
halt.
% main(+argv)
main(Argv) :-
(Argv = [] -> print_help ; true),
% Handling naming and options
parse_arguments(Argv, Input, Method, Timeout),
file_name_extension(InputBase, 'ode', Input),
string_concat(InputBase, '_quad', OutputBase),
file_name_extension(OutputBase, 'ode', Output),
......@@ -40,8 +72,8 @@ main([Input|_Tail]) :-
nb_setval(ode_viewer, inline),
nb_setval(current_models, []),
new_model,
set_my_option(quadratic_reduction, sat_species),
set_my_option(timeout, 120),
set_my_option(quadratic_reduction, Method),
set_my_option(timeout, Timeout),
set_my_option(stats, no),
% Main procedure
read_xpp(Input),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment