← Back to team overview

yade-dev team mailing list archive

[svn] r1897 - in trunk: . pkg/common/Engine/StandAloneEngine py/yadeWrapper

 

Author: eudoxos
Date: 2009-07-29 00:43:38 +0200 (Wed, 29 Jul 2009)
New Revision: 1897

Modified:
   trunk/SConstruct
   trunk/pkg/common/Engine/StandAloneEngine/InsertionSortCollider.cpp
   trunk/py/yadeWrapper/yadeWrapper.cpp
   trunk/yadeSCons.py
Log:
1. Fix linking with full Wm3 library
2. Automatically add /usr/include/wm3 to CPPPATH if useMiniWm3=False



Modified: trunk/SConstruct
===================================================================
--- trunk/SConstruct	2009-07-28 13:46:19 UTC (rev 1896)
+++ trunk/SConstruct	2009-07-28 22:43:38 UTC (rev 1897)
@@ -307,7 +307,9 @@
 	env['haveForeach']=conf.CheckCXXHeader('boost/foreach.hpp','<>')
 	if not env['haveForeach']: print "(OK, local version will be used instead)"
 	ok&=conf.CheckLibWithHeader('sqlite3','sqlite3.h','c++','sqlite3_close(0L);',autoadd=1)
-	if not env['useMiniWm3']: ok&=conf.CheckLibWithHeader('Wm3Foundation','Wm3Math.h','c++','Wm3::Math<double>::PI;',autoadd=1)
+	if not env['useMiniWm3']:
+		conf.env.Append(CPPPATH='/usr/include/wm3') # packaged version
+		ok&=conf.CheckLibWithHeader('Wm3Foundation','Wm3Math.h','c++','Wm3::Math<double>::PI;',autoadd=1)
 
 
 	if not ok:

Modified: trunk/pkg/common/Engine/StandAloneEngine/InsertionSortCollider.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/InsertionSortCollider.cpp	2009-07-28 13:46:19 UTC (rev 1896)
+++ trunk/pkg/common/Engine/StandAloneEngine/InsertionSortCollider.cpp	2009-07-28 22:43:38 UTC (rev 1897)
@@ -235,7 +235,7 @@
 						assert(V[k].id==iid); // if this fails, we didn't meet the other bound in the downwards sense either; that should never happen
 						assert(!V[k].flags.isMin); // the lower bound should be maximum in this (exceptional) case; we will fix that now
 						V[k].flags.isMin=true; V[i].flags.isMin=false;
-						LOG_DEBUG("Swapping coincident min/max of #"<<iid<<" at positions "<<k<<" and "<<i<<"(coords: "<<V[k].coord<<" and "<<V[i].coord);
+						LOG_DEBUG("Swapping coincident min/max of #"<<iid<<" at positions "<<k<<" and "<<i<<" (coords: "<<V[k].coord<<" and "<<V[i].coord<<")");
 						break; // would happen anyways
 					}
 				}

Modified: trunk/py/yadeWrapper/yadeWrapper.cpp
===================================================================
--- trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-28 13:46:19 UTC (rev 1896)
+++ trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-28 22:43:38 UTC (rev 1897)
@@ -283,7 +283,7 @@
 			OMEGA.createSimulationLoop();
 		}
 	};
-	/* Create variables in python's __builtin__ namespace that correspond to labeled objects. At this moment, only engines can be labeled. */
+	/* Create variables in python's __builtin__ namespace that correspond to labeled objects. At this moment, only engines and functors can be labeled (not bodies etc). */
 	void mapLabeledEntitiesToVariables(){
 		FOREACH(const shared_ptr<Engine>& e, OMEGA.getRootBody()->engines){
 			if(!e->label.empty()){
@@ -486,8 +486,7 @@
 
 
 /*****************************************************************************
-********** New helper functions 
-****/
+********** New helper functions */
 void Serializable_updateAttrs(const shared_ptr<Serializable>& self, const python::dict& d){
 	python::list l=d.items(); size_t ll=python::len(l);
 	for(size_t i=0; i<ll; i++){
@@ -757,13 +756,14 @@
 		.def_readonly("timingDeltas",&Engine::timingDeltas);
 	python::class_<StandAloneEngine,shared_ptr<StandAloneEngine>, python::bases<Engine>, noncopyable>("StandAloneEngine").def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<Engine>));
 	python::class_<DeusExMachina,shared_ptr<DeusExMachina>, python::bases<Engine>, noncopyable>("DeusExMachina").def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<Engine>));
-	python::class_<EngineUnit, shared_ptr<EngineUnit>, python::bases<Serializable>, noncopyable >("EngineUnit")
+	python::class_<EngineUnit, shared_ptr<EngineUnit>, python::bases<Serializable>, noncopyable >("EngineUnit",python::no_init)
 		.def_readonly("timingDeltas",&EngineUnit::timingDeltas)
 		.add_property("bases",&EngineUnit::getFunctorTypes);
+	python::class_<MetaEngine, shared_ptr<MetaEngine>, python::bases<Engine>, noncopyable>("MetaEngine",python::no_init);
 	python::class_<TimingDeltas, shared_ptr<TimingDeltas>, noncopyable >("TimingDeltas").add_property("data",&TimingDeltas_pyData).def("reset",&TimingDeltas::reset);
 
 	python::class_<InteractionDispatchers,shared_ptr<InteractionDispatchers>, python::bases<Engine>, noncopyable >("InteractionDispatchers").def("__init__",python::make_constructor(InteractionDispatchers_ctor_lists));
-	#define EXPOSE_DISPATCHER(DispatcherT,functorT) python::class_<DispatcherT, shared_ptr<DispatcherT>, python::bases<Engine>, noncopyable >(#DispatcherT).def("__init__",python::make_constructor(Dispatcher_ctor_list<DispatcherT,functorT>));
+	#define EXPOSE_DISPATCHER(DispatcherT,functorT) python::class_<DispatcherT, shared_ptr<DispatcherT>, python::bases<MetaEngine>, noncopyable >(#DispatcherT).def("__init__",python::make_constructor(Dispatcher_ctor_list<DispatcherT,functorT>));
 		EXPOSE_DISPATCHER(BoundingVolumeMetaEngine,BoundingVolumeEngineUnit)
 		EXPOSE_DISPATCHER(GeometricalModelMetaEngine,GeometricalModelEngineUnit)
 		EXPOSE_DISPATCHER(InteractingGeometryMetaEngine,InteractingGeometryEngineUnit)
@@ -824,9 +824,5 @@
 	EXPOSE_CXX_CLASS_RENAMED(FileGenerator,Preprocessor)
 		.def("generate",&FileGenerator_generate)
 		.def("load",&FileGenerator_load);
-
-	// containers & iterators
-	// BodyContainer
-	
 }
 

Modified: trunk/yadeSCons.py
===================================================================
--- trunk/yadeSCons.py	2009-07-28 13:46:19 UTC (rev 1896)
+++ trunk/yadeSCons.py	2009-07-28 22:43:38 UTC (rev 1897)
@@ -128,9 +128,9 @@
 		srcs=list(objs[obj][0])
 		if len(srcs)>1: srcs=env.Combine('$buildDir/'+obj+'.cpp',srcs)
 		if linkStrategy!='static':
-			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.SharedLibrary(obj,srcs,LIBS=list(objs[obj][1])))
+			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.SharedLibrary(obj,srcs,LIBS=env['LIBS']+list(objs[obj][1])))
 		else:
-			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.StaticLibrary(obj,srcs,LIBS=list(objs[obj][1])))
+			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.StaticLibrary(obj,srcs,LIBS=env['LIBS']+list(objs[obj][1])))