diff --git a/eo/src/do/make_checkpoint_assembled.h b/eo/src/do/make_checkpoint_assembled.h index c28cd066..125d46f9 100644 --- a/eo/src/do/make_checkpoint_assembled.h +++ b/eo/src/do/make_checkpoint_assembled.h @@ -30,6 +30,10 @@ #ifndef _make_checkpoint_assembled_h #define _make_checkpoint_assembled_h +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include @@ -143,9 +147,10 @@ eoCheckPoint& do_make_checkpoint_assembled(eoParser& _parser, eoState& _sta eoScalarFitnessStat *fitStat = new eoScalarFitnessStat; _state.storeFunctor(fitStat); checkpoint->add(*fitStat); - // a gnuplot-based monitor for snapshots: needs a dir name - eoGnuplot1DSnapshot *fitSnapshot = new eoGnuplot1DSnapshot(dirName); - _state.storeFunctor(fitSnapshot); +#ifdef HAVE_GNUPLOT + // a gnuplot-based monitor for snapshots: needs a dir name + eoGnuplot1DSnapshot *fitSnapshot = new eoGnuplot1DSnapshot(dirName); + _state.storeFunctor(fitSnapshot); // add any stat that is a vector to it fitSnapshot->add(*fitStat); // and of course add it to the checkpoint @@ -161,7 +166,7 @@ eoCheckPoint& do_make_checkpoint_assembled(eoParser& _parser, eoState& _sta gnumonitors[k]->add(*bestvals[k]); gnumonitors[k]->add(*avgvals[k]); } - +#endif } // WRITE STUFF TO FILE diff --git a/eo/src/moo/eoNSGA_II_Eval.cpp b/eo/src/moo/eoNSGA_II_Eval.cpp index 72916a31..619a102b 100644 --- a/eo/src/moo/eoNSGA_II_Eval.cpp +++ b/eo/src/moo/eoNSGA_II_Eval.cpp @@ -1,3 +1,5 @@ + +#include #include namespace nsga2 { diff --git a/eo/src/moo/eoNSGA_IIa_Eval.cpp b/eo/src/moo/eoNSGA_IIa_Eval.cpp index 5218b101..9e7f337a 100644 --- a/eo/src/moo/eoNSGA_IIa_Eval.cpp +++ b/eo/src/moo/eoNSGA_IIa_Eval.cpp @@ -1,4 +1,5 @@ +#include #include namespace nsga2a { diff --git a/eo/test/t-eoEasyPSO.cpp b/eo/test/t-eoEasyPSO.cpp index 49beab9f..d8abc3e7 100644 --- a/eo/test/t-eoEasyPSO.cpp +++ b/eo/test/t-eoEasyPSO.cpp @@ -24,7 +24,7 @@ double real_value (const Particle & _particle) } -main() +int main() { const unsigned int VEC_SIZE = 2; const unsigned int POP_SIZE = 20; diff --git a/eo/test/t-eoNSGA.cpp b/eo/test/t-eoNSGA.cpp index 5ff1d7ba..1d238618 100644 --- a/eo/test/t-eoNSGA.cpp +++ b/eo/test/t-eoNSGA.cpp @@ -1,4 +1,8 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include @@ -178,6 +182,7 @@ void the_main(int argc, char* argv[]) cp.add(fitness0); cp.add(fitness1); +#ifdef HAVE_GNUPLOT eoGnuplot1DSnapshot snapshot("pareto"); //snapshot.with(eoGnuplot::Points(3)); @@ -185,6 +190,7 @@ void the_main(int argc, char* argv[]) snapshot.add(fitness0); snapshot.add(fitness1); +#endif // the algo eoEasyEA ea(cp, eval, breeder, replace); diff --git a/eo/test/t-eoPBIL.cpp b/eo/test/t-eoPBIL.cpp index b7f39c7b..bc251fe2 100644 --- a/eo/test/t-eoPBIL.cpp +++ b/eo/test/t-eoPBIL.cpp @@ -24,6 +24,10 @@ /** test program for PBIL algorithm */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -34,6 +38,7 @@ #include #include + using namespace std; typedef eoBit Indi; @@ -97,6 +102,7 @@ int main(int argc, char* argv[]) "Output - Graphical"); if (plotDistribParam.value()) { +#ifdef HAVE_GNUPLOT unsigned frequency=1; // frequency of plots updates eoGnuplot1DSnapshot *distribSnapshot = new eoGnuplot1DSnapshot(ptDirNameParam->value(), frequency, "distrib"); @@ -105,6 +111,7 @@ int main(int argc, char* argv[]) distribSnapshot->add(distrib); // and of course add it to the checkpoint checkpoint.add(*distribSnapshot); +#endif } // the algorithm: EDA diff --git a/eo/test/t-eoPareto.cpp b/eo/test/t-eoPareto.cpp index 87bd8e26..559b661e 100644 --- a/eo/test/t-eoPareto.cpp +++ b/eo/test/t-eoPareto.cpp @@ -1,4 +1,8 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + #include //#include @@ -225,6 +229,7 @@ void the_main(int argc, char* argv[]) cp.add(fitness0); cp.add(fitness1); +#ifdef HAVE_GNUPLOT eoGnuplot1DSnapshot snapshot("pareto"); //snapshot.with(eoGnuplot::Points(3)); @@ -232,6 +237,7 @@ void the_main(int argc, char* argv[]) snapshot.add(fitness0); snapshot.add(fitness1); +#endif // the algo eoEasyEA ea(cp, eval, breeder, replace); diff --git a/eo/test/t-eoSecondsElapsedContinue.cpp b/eo/test/t-eoSecondsElapsedContinue.cpp index 687a098f..80b1391b 100644 --- a/eo/test/t-eoSecondsElapsedContinue.cpp +++ b/eo/test/t-eoSecondsElapsedContinue.cpp @@ -1,4 +1,9 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include #include #include #include @@ -12,7 +17,7 @@ int main() { int s = 1; eoSecondsElapsedContinue cnt(1); - time_t start_time = time(0); + time_t start_time = time(0); while (cnt(pop)) {}