Skip to content
Snippets Groups Projects
Commit 36ec8a3b authored by Peter Frank Perroni's avatar Peter Frank Perroni
Browse files

Updated makefile

parent 81b84b7d
No related branches found
No related tags found
No related merge requests found
.PHONY: all clean
# Compile the C++ code for CSMOn, plus a Python wrapper and a of couple examples.
all: CSMOn CSMOn_wrapper cpp_example
.PHONY: all clean_install clean
all: CSMOn CSMOn_wrapper cpp_example clean_install
CSMOn:
$(MAKE) -C cpp
......@@ -11,7 +13,11 @@ CSMOn_wrapper:
cpp_example: cpp/pso_example.cpp
g++ -o cpp/pso_example cpp/pso_example.cpp cpp/PSO.o cpp/CSMOn.o -Wall -pedantic-errors
clean_install:
$(MAKE) -i -C cpp clean
clean:
$(MAKE) -i -C cpp clean
$(MAKE) -i -C python clean
rm cpp/pso_example
......@@ -31,10 +31,11 @@
/**
* @mainpage Convergence Stabilization Modeling operating in Online Mode
*
* This is an automated method to estimate the best moment to stop swarm
* iterations based on the analysis of the convergence behavior presented
* during optimization, aiming to provide an effective balance between
* saving fitness evaluations and keeping the optimization quality.
* CSMOn ( formely called of C'MOn! ) is an automated method to estimate
* the best moment to stop swarm iterations based on the analysis of the
* convergence behavior presented during optimization, aiming to provide
* an effective balance between saving fitness evaluations and keeping
* the optimization quality.
* The convergence analysis is performed through a sequence of linear
* regressions using exponential and log-like curves.
*
......@@ -66,7 +67,7 @@ typedef struct _point{
}t_point;
/**
* @brief Convergence Stabilization Modeling operating in Online Mode ( formely called of C'MOn! ).
* @brief Convergence Stabilization Modeling operating in Online Mode.
*
* @date 04/Mar/2017
* @author Peter Frank Perroni (pfperroni@gmail.com)
......
# Compile the C++ source code for CSMOn.
FONTS=PSO.cpp CSMOn.cpp
OBJECTS=$(FONTS:.cpp=.o)
FLAGS=-Wall -pedantic-errors
......
......@@ -112,7 +112,7 @@ int main(int argc, char *argv[]){
double fitnessFunction(double *x, int n){
double s = 0;
for(int i=0; i < n; i++){
s += (x[i]+2) * (x[i]+2) - 10 * cos(2 * PI * (x[i]+2));
s += x[i] * x[i] - 10 * cos(2 * PI * x[i]);
}
return 10 * n + s;
}
# Compile the wrapper to call CSMOn from Python.
FONTS=CSMOn_wrapper.cpp
DEPENDENCIES=../cpp/PSO.o ../cpp/CSMOn.o
OBJECTS=$(FONTS:.cpp=.o)
FLAGS=-Wall -pedantic-errors -fPIC
.PHONY: all clean
.PHONY: all clean clean-install
all: CSMOn_wrapper
all: CSMOn_wrapper clean-install
CSMOn_wrapper: $(OBJECTS)
g++ -o $@.so $^ $(DEPENDENCIES) $(FLAGS) -shared
......@@ -13,6 +15,9 @@ CSMOn_wrapper: $(OBJECTS)
%.o: %.cpp
g++ -I../cpp $< -c -o $@ $(FLAGS)
clean-install:
rm $(OBJECTS)
clean:
rm $(OBJECTS) CSMOn.pyc fitnessFunction.pyc
rm $(OBJECTS) CSMOn.pyc fitnessFunction.pyc CSMOn_wrapper.so
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment