From 688003e559fa40adc9c3e53b68ffdc0956839c32 Mon Sep 17 00:00:00 2001 From: Caner Candan Date: Wed, 4 May 2011 17:29:45 +0200 Subject: [PATCH] * pyeo: updated pyeo in order to make it works --- eo/src/pyeo/CMakeLists.txt | 35 +++++++++++++++++++++------------- eo/src/pyeo/Makefile | 4 ++-- eo/src/pyeo/pickle.h | 6 +++--- eo/src/pyeo/random_numbers.cpp | 2 +- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/eo/src/pyeo/CMakeLists.txt b/eo/src/pyeo/CMakeLists.txt index 6e23de10..22909f02 100644 --- a/eo/src/pyeo/CMakeLists.txt +++ b/eo/src/pyeo/CMakeLists.txt @@ -16,13 +16,19 @@ # ---------------------------------------------------------------------------- # change this to your local boost-path -SET(BOOST_PATH "C:/development/libs/os/boost/boost_1_33_1") - +# SET(BOOST_PATH "C:/development/libs/os/boost/boost_1_33_1") # ---------------------------------------------------------------------------- +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + PROJECT(PyEO) +FIND_PACKAGE(Boost 1.42 COMPONENTS program_options python) + +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + # python IF(APPLE) @@ -38,10 +44,10 @@ IF(APPLE) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) # boost - SET(BOOST_INC ${BOOST_PATH}) - INCLUDE_DIRECTORIES(${BOOST_INC}) - SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/) - SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python) + # SET(BOOST_INC ${BOOST_PATH}) + # INCLUDE_DIRECTORIES(${BOOST_INC}) + # SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/) + # SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python) # osx internal find_library(APPLE_CARBON Carbon) @@ -54,10 +60,10 @@ ELSE(APPLE) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) # boost - SET(BOOST_INC ${BOOST_PATH}) - INCLUDE_DIRECTORIES(${BOOST_INC}) - SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/) - SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python) + # SET(BOOST_INC ${BOOST_PATH}) + # INCLUDE_DIRECTORIES(${BOOST_INC}) + # SET(BOOST_LIBRARY ${BOOST_PATH}/libs/python/build/bin-stage/) + # SET(BOOSTPYTHON_LIBRARY ${BOOST_LIBRARY}/boost_python) ENDIF(APPLE) @@ -84,8 +90,11 @@ ENDIF(WIN32 AND NOT CYGWIN) # add the libs if(APPLE) - target_link_libraries(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} ) + target_link_libraries(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${Boost_LIBRARIES} + #${BOOSTPYTHON_LIBRARY} + ) else(APPLE) - target_link_libraries(PyEO ${PYTHON_LIBRARY} ${BOOSTPYTHON_LIBRARY} ) + target_link_libraries(PyEO ${PYTHON_LIBRARY} ${Boost_LIBRARIES} + #${BOOSTPYTHON_LIBRARY} + ) endif(APPLE) - diff --git a/eo/src/pyeo/Makefile b/eo/src/pyeo/Makefile index ca2d762b..6953249c 100644 --- a/eo/src/pyeo/Makefile +++ b/eo/src/pyeo/Makefile @@ -10,7 +10,7 @@ CPPFLAGS = -Wall -O2 #-g #-O2 LDFLAGS = COMPILE = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c LINK = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -INC=-I/usr/include/python2.4 -I.. -I../.. -ftemplate-depth-50 +INC=-I/usr/include/python2.6 -I.. -I../.. -ftemplate-depth-50 OBJECTS=eoFunctorStore.o PyEO.o abstract1.o algos.o \ random_numbers.o geneticOps.o selectOne.o continuators.o\ @@ -26,7 +26,7 @@ clean: rm PyEO/*.so *.o test/*.pyc PyEO/PyEO.so: $(OBJECTS) - $(LINK) -o PyEO/PyEO.so $(OBJECTS) -lboost_python -lpython2.4 ${LIB} -shared #-lstlport + $(LINK) -o PyEO/PyEO.so $(OBJECTS) -lboost_python -lpython2.6 ${LIB} -shared #-lstlport eoFunctorStore.o: ../eoFunctorStore.h ../eoFunctorStore.cpp $(COMPILE) -o eoFunctorStore.o ../eoFunctorStore.cpp $(INC) diff --git a/eo/src/pyeo/pickle.h b/eo/src/pyeo/pickle.h index 20399364..ee2706fb 100644 --- a/eo/src/pyeo/pickle.h +++ b/eo/src/pyeo/pickle.h @@ -21,9 +21,9 @@ #ifndef PICKLE_H #define PICKLE_h -#ifndef WIN32 -#include -#endif +// #ifndef WIN32 +// #include +// #endif #include #include diff --git a/eo/src/pyeo/random_numbers.cpp b/eo/src/pyeo/random_numbers.cpp index 7b6a483a..aa9e4feb 100644 --- a/eo/src/pyeo/random_numbers.cpp +++ b/eo/src/pyeo/random_numbers.cpp @@ -99,7 +99,7 @@ void random_numbers() .def("rand", &eoRng::rand) .def("rand_max", &eoRng::rand_max) .def("reseed", &eoRng::reseed) - .def("uniform", &eoRng::uniform) + // .def("uniform", &eoRng::uniform) .def("normal", normal) .def("negexp", &eoRng::negexp) .def("to_string", rng_to_string)