diff --git a/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt b/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt new file mode 100644 index 000000000..a5e5283f5 --- /dev/null +++ b/utilities/tags/mySimpleApplication-1.0/CMakeLists.txt @@ -0,0 +1,72 @@ + +###################################################################################### +### 0) Include the install configuration file where are defined the main variables +###################################################################################### + +INCLUDE(${CMAKE_SOURCE_DIR}/install.cmake) + +###################################################################################### + + +###################################################################################### +### 1) Set your application properties +###################################################################################### + +# Define your project name +PROJECT(mySimpleApplication) + +###################################################################################### + + +###################################################################################### +### 2) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src + ${PARADISEO_MO_SRC_DIR}/src + ${PARADISEO_MOEO_SRC_DIR}/src + ${PARADISEO_PEO_SRC_DIR}/src) + +###################################################################################### + + +###################################################################################### +### 3) Specify where CMake can find the libraries +###################################################################################### + +# Link with the EO library directory, only if you need it +LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) + +# Link with the MOEO library directory, only if you need it +LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) + +# Link with the PEO library directory, only if you need it +LINK_DIRECTORIES(${PARADISEO_PEO_BIN_DIR}/lib) + +###################################################################################### + + + +###################################################################################### +### 4) Define your target: just an executable here +###################################################################################### + +ADD_EXECUTABLE(mySimpleApplication mySimpleApplication.cpp) + +###################################################################################### + + +###################################################################################### +### 5) Link the librairies for your executable +###################################################################################### + +# Only if you need to link libraries +TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) + +###################################################################################### + + + + + + diff --git a/utilities/tags/mySimpleApplication-1.0/README b/utilities/tags/mySimpleApplication-1.0/README new file mode 100644 index 000000000..e00f6313c --- /dev/null +++ b/utilities/tags/mySimpleApplication-1.0/README @@ -0,0 +1,82 @@ +========================================================================================== + INFORMATION +========================================================================================== + +PARADISEO (PARallel and DIStributed Evolving Objects) is a white-box object-oriented +framework dedicated to the flexible design of metaheursitics. + +This package is especially designed to help anyone who uses ParadisEO to build his +own application. + + +========================================================================================== + RELEASE +========================================================================================== + +The current release of the "mySimpleApplication" package is 1.0. + + +========================================================================================== + WEBSITE +========================================================================================== + +Please visit our website at http://paradiseo.gforge.inria.fr. + + +========================================================================================== + BUGS +========================================================================================== + +You can find the ParadisEO's bug tracker at: + + http://gforge.inria.fr/tracker/?atid=663&group_id=145&func=browse + + +========================================================================================== + CONTACT +========================================================================================== + +For any question or for help, please write us at: paradiseo-help@lists.gforge.inria.fr. + + +========================================================================================== + DEPENDENCIES +========================================================================================== + +ParadisEO uses EO, a templates-based, ANSI-C++ compliant evolutionary computation library. +It contains classes for almost any kind of evolutionary computation you might come up to - at +least for the ones we could think of. +EO Website: + http://eodev.sourceforge.net/. +EO is distributed under the GNU Lesser General Public License: + http://www.gnu.org/copyleft/lesser.html + + +========================================================================================== + LICENSE +========================================================================================== + + ParadisEO is governed by the CeCILL license under French law and + abiding by the rules of distribution of free software. You can use, + modify and/ or redistribute the software under the terms of the CeCILL + license as circulated by CEA, CNRS and INRIA at the following URL + "http://www.cecill.info". + + As a counterpart to the access to the source code and rights to copy, + modify and redistribute granted by the license, users are provided only + with a limited warranty and the software's author, the holder of the + economic rights, and the successive licensors have only limited liability. + + In this respect, the user's attention is drawn to the risks associated + with loading, using, modifying and/or developing or reproducing the + software by the user in light of its specific status of free software, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + requirements in conditions enabling the security of their systems and/or + data to be ensured and, more generally, to use and operate it in the + same conditions as regards security. + The fact that you are presently reading this means that you have had + knowledge of the CeCILL license and that you accept its terms. + diff --git a/utilities/tags/mySimpleApplication-1.0/index.html b/utilities/tags/mySimpleApplication-1.0/index.html new file mode 100644 index 000000000..5734b244f --- /dev/null +++ b/utilities/tags/mySimpleApplication-1.0/index.html @@ -0,0 +1,320 @@ + + + + + + + + Build My Simple Application + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ +
+

Build a simple application using ParadisEO

+

Introduction

+

There are many steps required to produce a ParadisEO-based program. As ParadisEO is a C++ library, any "main" file containing the basic instructions of your program is expected to be first compiled. The way the program should be compiled depends on the environment. For example on Unix platforms, some "Makefiles" allow an automatic compilation of a C++ source file and the generation of the "makefiles" themselves is achieved by CMake. CMake manages the software compilation process and it can be used with several generators: +

+
  • Visual Studio 8 2005 (Win32 + Win64) projects +
  • Visual Studio 7 .NET 2003 projects +
  • Visual Studio 7 and 6 projects +
  • NMake Makefiles +
  • MinGW Makefiles +
  • Borland Makefiles +
  • KDevelop projects +
  • Unix Makefiles +
  • Xcode Projects +
  • MSYS Makefiles +
  • WMake Makefiles +

A package containing all the required files has been developped for any user who wants to build his own application easily. In this case, we suppose this application to be only made of a "main.cpp" file (no specific components). The content of the package is pre-filled so that a user has just to paste his algorithm in the cpp-file and change one variable. +

+

"mySimpleApplication" package's content

+

The package contains the following files: +

+
  • install.cmake: Contains variables that specify where ParadisEO has been installed. +
  • mySimpleApplication.cpp : A C++ main containing the algorithm +
  • README: Contains basic information +
  • CMakeLists.txt: The only CMake configuration file +
  • index.html: The content of the current web-page +

It can be downloaded from here. +

+

Adapt the package

+

Here, we give the steps to custom the package for any application. +

+

Note: For further help about CMake, see the CMake documentation. +

+


+

+

Step 1 : Develop your algorithm

+
+

You just have to edit the mySimpleApplication.cpp and implement your code. +

+
+
  1. include <iostream> +

/// #include < file > +

+

/// Use functions from namespace std ? +
using namespace std; +

+

int main(int argc, char **argv) +
{ +

	/// Your code ...
+	cout << "I'm a simple application linked with ParadisEO" << endl ;	
+
+    return 1;
+

}' +

+


+

+

Step 2 : Change the ParadisEO-path in "install.cmake"

+
+

When ParadisEO has been configured in the standard way (the global package containing all the modules has been installed), just replace "myDirectory" by the absolute path to ParadisEO the section n°1: +

+
+
SET(PARADISEO_DIR "myDirectory" CACHE PATH "ParadisEO directory" FORCE) +
+

... replaced (for example) by: +

+
+
SET(PARADISEO_DIR "/home/john/paradiseo-ix86-1.0" CACHE PATH "ParadisEO directory" FORCE) +
+

If you have simply installed ParadisEO using the provided install script, go to the next step. +

+

Advanced configuration:
+
If the modules of ParadisEO have been deployed separately, the path to each module (EO, MO, MOEO and PEO) can also be specified. Here's an example for EO, PARADISEO_EO_SRC_DIR refers to the EO sources, PARADISEO_EO_BIN_DIR is the directory where EO has been compiled. +

+
+
SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH +
"ParadisEO-EO source directory" FORCE) +
SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR/paradiseo-eo/build" CACHE PATH +
"ParadisEO-EO binary directory" FORCE) +
+

A third section is added to automatically set the flags required when using the package under Visual Studio 8. It has no effect for all the other cases. +

+


+

+

Step 3 : Adapt the CMakeLists.txt

+
+
  • Give your project name in the section n°1 : +
+
PROJECT(mySimpleApplication) +
+
  • Specify the source directories to include +
+
INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src +
${PARADISEO_MO_SRC_DIR}/src +
${PARADISEO_MOEO_SRC_DIR}/src +
${PARADISEO_PEO_SRC_DIR}/src) +
+

For example, if you only use ParadisEO-EO sources, just set: +

+
INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src +
+
  • Specify where are the libraries (for the linker) +
+
LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) +
LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) +
LINK_DIRECTORIES(${PARADISEO_PEO_BIN_DIR}/lib) +
+

For example, if you only use ParadisEO-EO and ParadisEO-MOEO libraries, just set: +

+
LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) +
LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) +
+
  • Define your executable: give the executable name + the name of the cpp file +
+
ADD_EXECUTABLE(mySimpleApplication mySimpleApplication.cpp) +
+

Important: If you change the name of the cpp file "mySimpleApplication.cpp", don't forget to give the right name for the ADD_EXECUTABLE command. +

+
  • Specify the libraries that should be linked to build your executable (for example, for Unix Makefiles, the option used to give the linked libraries is "-L < a path to the lib>") +
+
TARGET_LINK_LIBRARIES(mySimpleApplication lib1 lib2 ...) +
+

An example using the "eo" and "eoutils" of ParadisEO-EO is: +

+
TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) +
+

Important: If you change the name of the executable (see a few lines above), don't forget to replace "mySimpleApplication " by the right name in: +

+
+
TARGET_LINK_LIBRARIES(mySimpleApplication eo eoutils) +
+


+

+

Step 4 : Launch the build process and compile

+
+

There are two ways to build and compile your program: +

- Compile it in the source directory, that means where your main cpp file is +
- Compile it somewhere else in order to have on one hand the source files, on the other the rest (makefiles of configuration file, ".o" files, the executable itself). This way is called out-source-build and is highly recommended. +

Moreover, you should know in advance the kind of generator you want CMake to use. +

+

For an "out-source-build", let's suppose your application's source file is located in /home/john/mySimpleApplication and you want to build it in /home/john/work/result for Visual Studio 8 2005 : +

+

From any directory, simply run (from a terminal/console) +

+
cmake /home/john/mySimpleApplication /home/john/work/result -G"Visual Studio 8 2005" +
+

The generic call for CMake is: +

+
cmake <path to the sources> <target build path> -G"<generator name>" +
+

Then : +

+

- Go in /home/john/work/result +
- Compile your program using the appropriate tool. Examples: +

--> If you chose the Unix Makefiles generator, enter "make" +
--> If you chose Visual Studio generator, open the generated solution/project and compile +
--> ... +
+


+
For further help and information, feel free to send us an email at paradiseo-help@lists.gforge.inria.fr . +

+
+ + + +
+
+
+
+ + + + + + +
+ + +
+ + + diff --git a/utilities/tags/mySimpleApplication-1.0/install.cmake b/utilities/tags/mySimpleApplication-1.0/install.cmake new file mode 100644 index 000000000..6250fe25c --- /dev/null +++ b/utilities/tags/mySimpleApplication-1.0/install.cmake @@ -0,0 +1,50 @@ + + +######################################################################################################### +# 1) ParadisEO install: SIMPLE Configuration +######################################################################################################### + +# Here, just specify PARADISEO_DIR : the directory where ParadisEO has been installed +SET(PARADISEO_DIR "/opt/paradiseo-ix86-1.0" CACHE PATH "ParadisEO directory" FORCE) + +######################################################################################################### + + + +######################################################################################################### +# 2) ParadisEO install: ADVANCED Configuration +######################################################################################################### + +SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE) +SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR}/paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE) + +SET(PARADISEO_MO_SRC_DIR "${PARADISEO_DIR}/paradiseo-mo" CACHE PATH "ParadisEO-MO source directory" FORCE) +SET(PARADISEO_MO_BIN_DIR "${PARADISEO_DIR}/paradiseo-mo/build" CACHE PATH "ParadisEO-MO binary directory" FORCE) + +SET(PARADISEO_MOEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-moeo" CACHE PATH "ParadisEO-MOEO source directory" FORCE) +SET(PARADISEO_MOEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-moeo/build" CACHE PATH "ParadisEO-MOEO binary directory" FORCE) + +SET(PARADISEO_PEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-peo" CACHE PATH "ParadisEO-PEO source directory" FORCE) +SET(PARADISEO_PEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-peo/build" CACHE PATH "ParadisEO-PEO binary directory" FORCE) +######################################################################################################### + + + +###################################################################################### +### 3) OPTIONNAL: Windows advanced config - especially for Microsoft Visual Studio 8 +###################################################################################### + + IF(CMAKE_CXX_COMPILER MATCHES cl) + IF(NOT WITH_SHARED_LIBS) + IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") + SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") + SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") + SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") + SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") + + ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") + ENDIF(NOT WITH_SHARED_LIBS) + ENDIF(CMAKE_CXX_COMPILER MATCHES cl) +###################################################################################### \ No newline at end of file diff --git a/utilities/tags/mySimpleApplication-1.0/mySimpleApplication.cpp b/utilities/tags/mySimpleApplication-1.0/mySimpleApplication.cpp new file mode 100644 index 000000000..504d8f831 --- /dev/null +++ b/utilities/tags/mySimpleApplication-1.0/mySimpleApplication.cpp @@ -0,0 +1,17 @@ + +#include +// #include < file > + +// Use functions from namespace std ? +using namespace std; + + +int main(int argc, char **argv) +{ + // Your code ... + cout << "I'm a simple application linked with ParadisEO" << endl ; + + return 1; + +} +