* pyeo: updated pyeo in order to make it works
This commit is contained in:
parent
211de53623
commit
688003e559
4 changed files with 28 additions and 19 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@
|
|||
#ifndef PICKLE_H
|
||||
#define PICKLE_h
|
||||
|
||||
#ifndef WIN32
|
||||
#include <config.h>
|
||||
#endif
|
||||
// #ifndef WIN32
|
||||
// #include <config.h>
|
||||
// #endif
|
||||
|
||||
#include <boost/python.hpp>
|
||||
#include <sstream>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Reference in a new issue