← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3736: Raise minimal boost version to 1.47

 

------------------------------------------------------------
revno: 3736
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2015-11-09 21:26:06 +0100
message:
  Raise minimal boost version to 1.47
  
  Clean some old unused stuff
modified:
  CMakeLists.txt
  core/corePlugins.cpp
  lib/base/Math.hpp
  lib/base/openmp-accu.hpp
  lib/factory/ClassFactory.cpp
  lib/factory/ClassFactory.hpp
  lib/factory/DynLibManager.hpp
  lib/multimethods/DynLibDispatcher.hpp
  lib/multimethods/FunctorWrapper.hpp
  lib/opengl/GLUtils.cpp
  lib/pyutil/numpy.hpp
  lib/pyutil/raw_constructor.hpp
  lib/serialization/ObjectIO.hpp
  lib/smoothing/LinearInterpolate.hpp
  py/wrapper/yadeWrapper.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2015-08-27 09:47:31 +0000
+++ CMakeLists.txt	2015-11-09 20:26:06 +0000
@@ -83,7 +83,7 @@
 # Add possibility to use local boost installation (e.g. -DLocalBoost=1.46.1)
 
 IF ( NOT LocalBoost )
-  SET(LocalBoost "1.35.0") # Minimal required Boost version
+  SET(LocalBoost "1.47.0") # Minimal required Boost version
 ENDIF ( NOT LocalBoost )
 FIND_PACKAGE(Boost ${LocalBoost} COMPONENTS python thread filesystem iostreams regex serialization system date_time REQUIRED)
 INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})

=== modified file 'core/corePlugins.cpp'
--- core/corePlugins.cpp	2014-10-15 06:44:01 +0000
+++ core/corePlugins.cpp	2015-11-09 20:26:06 +0000
@@ -23,17 +23,9 @@
 
 // these two are not accessible from python directly (though they should be in the future, perhaps)
 
-#if BOOST_VERSION>=104200
-	BOOST_CLASS_EXPORT_IMPLEMENT(BodyContainer);
-	BOOST_CLASS_EXPORT_IMPLEMENT(InteractionContainer);
-#else
-	BOOST_CLASS_EXPORT(BodyContainer);
-	BOOST_CLASS_EXPORT(InteractionContainer);
-#endif
+BOOST_CLASS_EXPORT_IMPLEMENT(BodyContainer);
+BOOST_CLASS_EXPORT_IMPLEMENT(InteractionContainer);
 
 YADE_PLUGIN((Body)(Bound)(Cell)(Dispatcher)(EnergyTracker)(Engine)(FileGenerator)(Functor)(GlobalEngine)(Interaction)(IGeom)(IPhys)(Material)(PartialEngine)(Shape)(State)(TimeStepper));
 
-EnergyTracker::~EnergyTracker(){} // vtable
-
-//BOOST_CLASS_EXPORT(OpenMPArrayAccumulator<Real>);
-//BOOST_CLASS_EXPORT(OpenMPAccumulator<Real>);
+EnergyTracker::~EnergyTracker(){}

=== modified file 'lib/base/Math.hpp'
--- lib/base/Math.hpp	2015-11-06 20:00:30 +0000
+++ lib/base/Math.hpp	2015-11-09 20:26:06 +0000
@@ -8,7 +8,6 @@
 	using Real = double;
 #endif
 
-#include <algorithm>
 #include <cassert>
 #include <cmath>
 #include <cstdlib>
@@ -22,7 +21,6 @@
 #include <sstream>
 #include <stdexcept>
 #include <string>
-#include <typeinfo>
 #include <utility>
 #include <vector>
 

=== modified file 'lib/base/openmp-accu.hpp'
--- lib/base/openmp-accu.hpp	2015-11-06 20:00:30 +0000
+++ lib/base/openmp-accu.hpp	2015-11-09 20:26:06 +0000
@@ -1,11 +1,8 @@
 // 2010 © Václav Šmilauer <eudoxos@xxxxxxxx>
 #pragma once 
 
-// for ZeroInitializer template
 #include <lib/base/Math.hpp>
-
 #include <boost/serialization/split_free.hpp>
-#include <cstdlib>
 #include <unistd.h>
 
 #ifdef YADE_OPENMP

=== modified file 'lib/factory/ClassFactory.cpp'
--- lib/factory/ClassFactory.cpp	2014-10-15 06:44:01 +0000
+++ lib/factory/ClassFactory.cpp	2015-11-09 20:26:06 +0000
@@ -23,28 +23,11 @@
 {
 
 	bool tmp = map.insert( FactorableCreatorsMap::value_type( name , FactorableCreators(create,createShared, createPureCustom) )).second;
-
-	#if 0
-		if (tmp)
-			std::cout << "registering factorable: " << name << " OK\n";
-		else
-			std::cout << "registering factorable: " << name << " FAILED\n";
-	#endif
-
 	return tmp;
 }
 
 shared_ptr<Factorable> ClassFactory::createShared( std::string name )
 {
-#if 0
-	cerr<<"Creating shared lib: "<<name<<"\n";
-	cerr<<"Available libs: ";
-		for(FactorableCreatorsMap::iterator i=map.begin(); i!=map.end(); i++){
-			cerr<<i->first<<" ";
-		}
-	cerr<<"\n";
-#endif
-
 	FactorableCreatorsMap::const_iterator i = map.find( name );
 	if( i == map.end() )
 	{
@@ -72,7 +55,6 @@
 	FactorableCreatorsMap::const_iterator i = map.find( name );
 	if( i == map.end() )
 	{
-		//cerr << "------------ going to load something" << endl;
 		dlm.load(name);
 		if (dlm.isLoaded(name))
 		{
@@ -104,7 +86,6 @@
         return dlm.lastError();
 }
 
-
 void ClassFactory::registerPluginClasses(const char* fileAndClasses[]){
 	assert(fileAndClasses[0]!=NULL); // must be file name
 	// only filename given, no classes names explicitly

=== modified file 'lib/factory/ClassFactory.hpp'
--- lib/factory/ClassFactory.hpp	2014-10-15 06:44:01 +0000
+++ lib/factory/ClassFactory.hpp	2015-11-09 20:26:06 +0000
@@ -138,7 +138,6 @@
 			\param tp type info of the type to test
 			\param fundamental is true if the given type is fundamental (Vector3,Quaternion ...)
 		*/
-		bool isFactorable(const type_info& tp,bool& fundamental);
 
 		bool load(const string& fullFileName);
 		std::string lastError();
@@ -158,24 +157,12 @@
  * be unique and avoids use of __COUNTER__ which didn't appear in gcc until 4.3.
  */
 
-#if BOOST_VERSION>=104200
-	#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT_IMPLEMENT(z); BOOST_SERIALIZATION_FACTORY_0(z);
-#else
-	#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT(z); BOOST_SERIALIZATION_FACTORY_0(z);
-#endif
-
-// the __attribute__((constructor(priority))) construct not supported before gcc 4.3
-// it will only produce warning from log4cxx if not used
-#if __GNUC__ == 4 && __GNUC_MINOR__ >=3
-	#define YADE_CTOR_PRIORITY(p) (p)
-#else
-	#define YADE_CTOR_PRIORITY(p)
-#endif
-
-#define _PLUGIN_CHECK_REPEAT(x,y,z) void z::must_use_both_YADE_CLASS_BASE_DOC_ATTRS_and_YADE_PLUGIN(){}
+#define _YADE_PLUGIN_BOOST_REGISTER(x,y,z) BOOST_CLASS_EXPORT_IMPLEMENT(z); BOOST_SERIALIZATION_FACTORY_0(z);
+
+
 #define _YADE_PLUGIN_REPEAT(x,y,z) BOOST_PP_STRINGIZE(z),
 
 // priority 500 is greater than priority for log4cxx initialization (in core/main/pyboot.cpp); therefore lo5cxx will be initialized before plugins are registered
 #define YADE_PLUGIN(plugins) namespace{ __attribute__((constructor)) void BOOST_PP_CAT(registerThisPluginClasses_,BOOST_PP_SEQ_HEAD(plugins)) (void){ const char* info[]={__FILE__ , BOOST_PP_SEQ_FOR_EACH(_YADE_PLUGIN_REPEAT,~,plugins) NULL}; ClassFactory::instance().registerPluginClasses(info);} } BOOST_PP_SEQ_FOR_EACH(_YADE_PLUGIN_BOOST_REGISTER,~,plugins)
-// use later: BOOST_PP_SEQ_FOR_EACH(_PLUGIN_CHECK_REPEAT,~,plugins)
+
 

=== modified file 'lib/factory/DynLibManager.hpp'
--- lib/factory/DynLibManager.hpp	2014-10-15 06:44:01 +0000
+++ lib/factory/DynLibManager.hpp	2015-11-09 20:26:06 +0000
@@ -40,5 +40,3 @@
 		bool error();
     std::string lastError_;
 };
-
-

=== modified file 'lib/multimethods/DynLibDispatcher.hpp'
--- lib/multimethods/DynLibDispatcher.hpp	2015-09-16 15:17:33 +0000
+++ lib/multimethods/DynLibDispatcher.hpp	2015-11-09 20:26:06 +0000
@@ -121,19 +121,14 @@
 	typedef typename Loki::TL::Append<  Loki::NullType , BaseClass >::Result BaseClassList;
 	typedef typename Loki::TL::TypeAtNonStrict<BaseClassList , 0>::Result	BaseClass1;  // 1D
 	typedef typename Loki::TL::TypeAtNonStrict<BaseClassList , 1>::Result	BaseClass2;  // 2D
-	typedef typename Loki::TL::TypeAtNonStrict<BaseClassList , 2>::Result	BaseClass3;  // 3D
 		
 	typedef typename GetTail< BaseClassList >::Result			Tail2; // 2D
 	typedef typename GetTail< Tail2 >::Result				Tail3; // 3D
 	typedef typename GetTail< Tail3 >::Result				Tail4; // 4D ...
 		
 	typedef typename Matrix< BaseClassList >::ResultIterator 		Iterator2; // outer iterator 2D
-	typedef typename Matrix< Tail2 >::ResultIterator			Iterator3; // inner iterator 3D
-	typedef typename Matrix< Tail3 >::ResultIterator			Iterator4; // more inner iterator 4D
 		
 	typedef typename Matrix< BaseClassList >::ResultIteratorInt		IteratorInfo2;
-	typedef typename Matrix< Tail2 >::ResultIteratorInt			IteratorInfo3;
-	typedef typename Matrix< Tail3 >::ResultIteratorInt			IteratorInfo4;
 		
 	typedef typename Matrix< BaseClassList >::Result MatrixType;
 	typedef typename Matrix< BaseClassList >::ResultInt MatrixIntType;
@@ -156,12 +151,6 @@
 	typedef typename Impl::Parm7 Parm7;
 	typedef typename Impl::Parm8 Parm8;
 	typedef typename Impl::Parm9 Parm9;
-	typedef typename Impl::Parm10 Parm10;
-	typedef typename Impl::Parm11 Parm11;
-	typedef typename Impl::Parm12 Parm12;
-	typedef typename Impl::Parm13 Parm13;
-	typedef typename Impl::Parm14 Parm14;
-	typedef typename Impl::Parm15 Parm15;
 	
  	public:
 		DynLibDispatcher()
@@ -222,8 +211,6 @@
 			return out;
 		}
 
-
-
  	public:
 		void add1DEntry(string baseClassName, shared_ptr<Executor> executor){
 			// create base class, to access its index. (we can't access static variable, because
@@ -244,10 +231,6 @@
 			callBacks.resize( maxCurrentIndex+1 );	// make sure that there is a place for new Functor
 
 			callBacks[index] = executor;
-						
-			#if 0
-				cerr <<" New class added to DynLibDispatcher 1D: " << libName << endl;
-			#endif
 		};
 
 		
@@ -311,11 +294,7 @@
 				callBacks	[index1][index2] = executor;
 				callBacksInfo	[index1][index2] = 0;
 			}
-
-			#if 0
-				cerr <<"Added new 2d functor "<<executor->getClassName()<<", callBacks size is "<<callBacks.size()<<","<<(callBacks.size()>0?callBacks[0].size():0)<<endl;
-			#endif
-		  }
+		}
 		
 
 		bool locateMultivirtualFunctor1D(int& index, shared_ptr<BaseClass1>& base) {
@@ -712,7 +691,6 @@
 			}
 			else	return ResultType();
 		}
-
 };
 
 

=== modified file 'lib/multimethods/FunctorWrapper.hpp'
--- lib/multimethods/FunctorWrapper.hpp	2015-09-16 15:17:33 +0000
+++ lib/multimethods/FunctorWrapper.hpp	2015-11-09 20:26:06 +0000
@@ -149,10 +149,5 @@
 		return (string(#class1)+" "+string(#class2));					\
 	}											\
 
-#define DEFINE_FUNCTOR_ORDER_3D(class1,class2,class3)						\
-	public : virtual std::string checkOrder() const						\
-	{											\
-		return (string(#class1)+" "+string(#class2)+" "+string(#class3));		\
-	}											\
 
 

=== modified file 'lib/opengl/GLUtils.cpp'
--- lib/opengl/GLUtils.cpp	2013-08-23 15:21:20 +0000
+++ lib/opengl/GLUtils.cpp	2015-11-09 20:26:06 +0000
@@ -53,7 +53,6 @@
 	glPushMatrix();
 	glTranslatef(from[0],from[1],from[2]);
 	Quaternionr q(Quaternionr().setFromTwoVectors(Vector3r(0,0,1),to-from));
-	//glMultMatrixd(q.toRotationMatrix().data());
 	glMultMatrix(q.toRotationMatrix().data());
 	drawArrow((to-from).norm(), radius, nbSubdivisions);
 	glPopMatrix();

=== modified file 'lib/pyutil/numpy.hpp'
--- lib/pyutil/numpy.hpp	2010-02-18 22:47:05 +0000
+++ lib/pyutil/numpy.hpp	2015-11-09 20:26:06 +0000
@@ -2,6 +2,5 @@
 #pragma once
 #include"numpy_boost.hpp"
 
-// helper macro do assign Vector3r and Matrix3r values to subarrays
-#define VECTOR3R_TO_NUMPY(vec,arr) arr[0]=vec[0]; arr[1]=vec[1]; arr[2]=vec[2]
+// helper macro do assign Matrix3r values to subarrays
 #define MATRIX3R_TO_NUMPY(mat,arr) arr[0]=mat(0,0);arr[1]=mat(0,1);arr[2]=mat(0,2);arr[3]=mat(1,0);arr[4]=mat(1,1);arr[5]=mat(1,2);arr[6]=mat(2,0);arr[7]=mat(2,1);arr[8]=mat(2,2);

=== modified file 'lib/pyutil/raw_constructor.hpp'
--- lib/pyutil/raw_constructor.hpp	2014-07-03 17:20:40 +0000
+++ lib/pyutil/raw_constructor.hpp	2015-11-09 20:26:06 +0000
@@ -1,20 +1,26 @@
 #pragma once
-#include<boost/python/raw_function.hpp>
+#include <boost/python/raw_function.hpp>
 // many thanks to http://markmail.org/message/s4ksg6nfspw2wxwd
-namespace boost { namespace python { namespace detail {
-	template <class F> struct raw_constructor_dispatcher{
-		raw_constructor_dispatcher(F f): f(make_constructor(f)) {}
-		PyObject* operator()(PyObject* args, PyObject* keywords)
-		{
-			 borrowed_reference_t* ra = borrowed_reference(args); object a(ra);
-			 return incref(object(f(object(a[0]),object(a.slice(1,len(a))),keywords ? dict(borrowed_reference(keywords)) : dict())).ptr() );
-		}
-		private: object f;
-	};
-	}
-	template <class F> object raw_constructor(F f, std::size_t min_args = 0){
-		return detail::make_raw_function(objects::py_function(detail::raw_constructor_dispatcher<F>(f),mpl::vector2<void, object>(),min_args+1,(std::numeric_limits<unsigned>::max)()));
-	}
-}} // namespace boost::python
+namespace boost {
+  namespace python {
+    namespace detail {
+      template <class F> struct raw_constructor_dispatcher {
+        raw_constructor_dispatcher(F f): f(make_constructor(f)) {}
+        PyObject* operator()(PyObject* args, PyObject* keywords) {
+          borrowed_reference_t* ra = borrowed_reference(args); object a(ra);
+          return incref(object(f(object(a[0]),object(a.slice(1,len(a))),keywords ? dict(borrowed_reference(keywords)) : dict())).ptr() );
+        }
+        private: object f;
+      };
+    }
+    template <class F> object raw_constructor(F f, std::size_t min_args = 0) {
+      return detail::make_raw_function(
+        objects::py_function(detail::raw_constructor_dispatcher<F>(f),
+                             mpl::vector2<void, object>(),
+                             min_args+1,
+                             (std::numeric_limits<unsigned>::max)()));
+    }
+  }
+}
 
 

=== modified file 'lib/serialization/ObjectIO.hpp'
--- lib/serialization/ObjectIO.hpp	2014-05-23 13:03:50 +0000
+++ lib/serialization/ObjectIO.hpp	2015-11-09 20:26:06 +0000
@@ -2,19 +2,15 @@
 
 #pragma once
 
-#include<locale>
-#include<boost/archive/codecvt_null.hpp>
-#include<boost/iostreams/filtering_stream.hpp>
-#include<boost/iostreams/filter/bzip2.hpp>
-#include<boost/iostreams/filter/gzip.hpp>
-#include<boost/iostreams/device/file.hpp>
-#include<boost/algorithm/string.hpp>
+#include <locale>
+#include <boost/archive/codecvt_null.hpp>
+#include <boost/iostreams/filtering_stream.hpp>
+#include <boost/iostreams/filter/bzip2.hpp>
+#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/iostreams/device/file.hpp>
+#include <boost/algorithm/string.hpp>
 
-#if BOOST_VERSION>=104700
-	#include<boost/math/special_functions/nonfinite_num_facets.hpp>
-#else
-	#include<boost/math/nonfinite_num_facets.hpp>
-#endif
+#include <boost/math/special_functions/nonfinite_num_facets.hpp>
 
 
 

=== modified file 'lib/smoothing/LinearInterpolate.hpp'
--- lib/smoothing/LinearInterpolate.hpp	2010-12-21 12:19:50 +0000
+++ lib/smoothing/LinearInterpolate.hpp	2015-11-09 20:26:06 +0000
@@ -30,19 +30,3 @@
 	const Real& t0=tt[pos], t1=tt[pos+1]; const T& v0=values[pos], v1=values[pos+1];
 	return v0+(v1-v0)*((t-t0)/(t1-t0));
 }
-
-#if 0
-	// test program
-	int main(void){
-		Real t,v;
-		std::vector<Real> tt,vv;
-		while(std::cin){
-			std::cin>>t>>v;
-			tt.push_back(t); vv.push_back(v);	
-		}
-		size_t pos;
-		for(Real t=0; t<10; t+=0.1){
-			std::cout<<t<<" "<<linearInterpolate<Real,Real>(t,tt,vv,pos)<<std::endl;
-		}
-	}
-#endif 

=== modified file 'py/wrapper/yadeWrapper.cpp'
--- py/wrapper/yadeWrapper.cpp	2015-07-30 16:25:24 +0000
+++ py/wrapper/yadeWrapper.cpp	2015-11-09 20:26:06 +0000
@@ -24,22 +24,18 @@
 #include<pkg/dem/STLImporter.hpp>
 
 #include<pkg/common/Dispatching.hpp>
-#include<core/GlobalEngine.hpp>
-#include<core/PartialEngine.hpp>
-#include<core/Functor.hpp>
-#include<pkg/common/ParallelEngine.hpp>
-#include<pkg/common/Collider.hpp>
+#include <core/GlobalEngine.hpp>
+#include <core/PartialEngine.hpp>
+#include <core/Functor.hpp>
+#include <pkg/common/ParallelEngine.hpp>
+#include <pkg/common/Collider.hpp>
 
-#include<pkg/common/InteractionLoop.hpp>
+#include <pkg/common/InteractionLoop.hpp>
 
 #include <core/Clump.hpp>
 #include <pkg/common/Sphere.hpp>
 
-#if BOOST_VERSION>=104700
-	#include<boost/math/special_functions/nonfinite_num_facets.hpp>
-#else
-	#include<boost/math/nonfinite_num_facets.hpp>
-#endif
+#include <boost/math/special_functions/nonfinite_num_facets.hpp>
 
 #include <locale>
 #include <boost/random/linear_congruential.hpp>