#include "bemodule.h"
#include "error.h"
+#include "lpp.h"
+
#include "lc_opts.h"
#include "lc_opts_enum.h"
-#ifdef WITH_ILP
-
#define DUMP_ILP 1
#define DUMP_SOL 2
static int time_limit = 60;
-static int solve_net = 1;
static int solve_log = 0;
static unsigned dump_flags = 0;
static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_INT ("limit", "time limit for solving in seconds (0 for unlimited)", &time_limit),
- LC_OPT_ENT_BOOL ("net", "solve over the net", &solve_net),
LC_OPT_ENT_BOOL ("log", "show ilp solving log", &solve_log),
LC_OPT_ENT_ENUM_MASK("dump", "dump flags", &dump_var),
LC_OPT_LAST
};
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp)
void be_init_copyilp(void)
{
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lpp_sol_state_t ilp_go(ilp_env_t *ienv)
{
- be_main_env_t *main_env = ienv->co->cenv->birg->main_env;
+ be_options_t *options = be_get_irg_options(ienv->co->irg);
sr_remove(ienv->sr);
if (solve_log)
lpp_set_log(ienv->lp, stdout);
- if (solve_net)
- lpp_solve_net(ienv->lp, main_env->options->ilp_server, main_env->options->ilp_solver);
- else {
-#ifdef LPP_SOLVE_NET
- fprintf(stderr, "can only solve ilp over the net\n");
-#else
- lpp_solve_cplex(ienv->lp);
-#endif
- }
+ lpp_solve(ienv->lp, options->ilp_server, options->ilp_solver);
- be_stat_ev_dbl("co_ilp_objval", ienv->lp->objval);
- be_stat_ev_dbl("co_ilp_best_bound", ienv->lp->best_bound);
- be_stat_ev ("co_ilp_iter", ienv->lp->iterations);
- be_stat_ev_dbl("co_ilp_sol_time", ienv->lp->sol_time);
+ //be_stat_ev_dbl("co_ilp_objval", ienv->lp->objval);
+ //be_stat_ev_dbl("co_ilp_best_bound", ienv->lp->best_bound);
+ be_stat_ev ("co_ilp_iter", lpp_get_iter_cnt(ienv->lp));
+ be_stat_ev_dbl("co_ilp_sol_time", lpp_get_sol_time(ienv->lp));
if (dump_flags & DUMP_ILP) {
char buf[128];
free_lpp(ienv->lp);
free(ienv);
}
-
-#else /* WITH_ILP */
-
-static inline void only_that_you_can_compile_without_WITH_ILP_defined(void)
-{
-}
-
-#endif /* WITH_ILP */