Re: [Yade-dev] [Yade-users] [IMPORANT] Migration to cmake
Hi Anton, in order to get the compilation going we had to change the include for boost as follows: #include(FindBoost) SET(LIB_BOOST_PATH /usr/local/boost-1.46/lib ) The boost issue seems to work now. However, compilation is still not working. geotech-r710-3-build: make -j4 Scanning dependencies of target yade-all [ 5%] [ 11%] Building CXX object CMakeFiles/yade-all.dir/core.0.cpp.o [ 17%] [ 23%] Building CXX object CMakeFiles/yade-all.dir/pkg.1.cpp.o Building CXX object CMakeFiles/yade-all.dir/pkg.0.cpp.o Building CXX object CMakeFiles/yade-all.dir/lib.0.cpp.o In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward/strstream:47, from //usr/include/vtk/vtkIOStream.h:112, from //usr/include/vtk/vtkSystemIncludes.h:40, from //usr/include/vtk/vtkIndent.h:24, from //usr/include/vtk/vtkObjectBase.h:43, from //usr/include/vtk/vtkObject.h:41, from //usr/include/vtk/vtkCellArray.h:35, from /home/mape526/YADE-git/trunk/pkg/dem/VTKRecorder.cpp:7, from /home/mape526/YADE-git/build/pkg.0.cpp:12: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [ 29%] Building CXX object CMakeFiles/yade-all.dir/pyModules.0.cpp.o In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward/strstream:47, from //usr/include/vtk/vtkIOStream.h:112, from //usr/include/vtk/vtkSystemIncludes.h:40, from //usr/include/vtk/vtkIndent.h:24, from //usr/include/vtk/vtkObjectBase.h:43, from //usr/include/vtk/vtkObject.h:41, from //usr/include/vtk/vtkLocator.h:53, from //usr/include/vtk/vtkAbstractPointLocator.h:27, from //usr/include/vtk/vtkPointLocator.h:39, from /home/mape526/YADE-git/trunk/py/_eudoxos.cpp:13, from /home/mape526/YADE-git/build/pyModules.0.cpp:2: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. /home/mape526/YADE-git/build/pyModules.0.cpp:3:50: error: /home/mape526/YADE-git/trunk/py/log.cpp: No such file or directory In file included from /home/mape526/YADE-git/build/pyModules.0.cpp:4: /home/mape526/YADE-git/trunk/py/_utils.cpp:16:32: error: numpy/ndarrayobject.h: No such file or directory In file included from /home/mape526/YADE-git/build/pyModules.0.cpp:4: /home/mape526/YADE-git/trunk/py/_utils.cpp: In function ‘bool pointInsidePolygon(boost::python::tuple, boost::python::api::object)’: /home/mape526/YADE-git/trunk/py/_utils.cpp:293: error: ‘PyArrayObject’ was not declared in this scope /home/mape526/YADE-git/trunk/py/_utils.cpp:293: error: ‘vert’ was not declared in this scope /home/mape526/YADE-git/trunk/py/_utils.cpp:293: error: expected primary-expression before ‘)’ token /home/mape526/YADE-git/trunk/py/_utils.cpp:293: error: expected ‘;’ before ‘vertices’ /home/mape526/YADE-git/trunk/py/_utils.cpp:294: error: ‘PyArray_DOUBLE’ was not declared in this scope /home/mape526/YADE-git/trunk/py/_utils.cpp:294: error: ‘PyArray_As2D’ was not declared in this scope /home/mape526/YADE-git/trunk/py/_utils.cpp: In function ‘void init_module__utils()’: /home/mape526/YADE-git/trunk/py/_utils.cpp:449: error: ‘import_array’ was not declared in this scope make[2]: *** [CMakeFiles/yade-all.dir/pyModules.0.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs ^Cmake[2]: *** [CMakeFiles/yade-all.dir/pkg.0.cpp.o] Interrupt make[1]: *** [CMakeFiles/yade-all.dir/all] Interrupt make: *** [all] Interrupt There is a problem with py/log.cpp which has been removed recently. Furthermore, there seems to be an issue with numpy on our server (Red Hat). In the scons version the problem has been solved with: CPPPATH = '/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/vtk-5.6:/usr/include/vtk -5.8:/usr/include/vtk:/usr/lib64/python2.6/site-packages/numpy/core/include:/usr/local/boost-1.46/include:/usr/ include/eigen2' However, when adding INCLUDE_DIRECTORIES(/usr/lib64/python2.6/site-packages/numpy/core/include) to the cmake list
[Yade-dev] Yade unknown
Hi all, I have install the latest of Yade dem with github. I followed the instruction put on the wiki. But now the id of the version I have got is missing, I have a Yade version unknown also the build folder create is an unknown version. Do you have any idea about this? Thanks in advance, Anna ___ Mailing list: https://launchpad.net/~yade-dev Post to : yade-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp
Re: [Yade-dev] How to change the macros
ok ok thank you guys ___ Mailing list: https://launchpad.net/~yade-dev Post to : yade-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp
[Yade-dev] How to change the macros
Hi, I try to change the macros in Serializable.hpp in order to have more parameters when I define the wireMat (I have join the code) I want to have possibility to enter two curves but it doesn't work. I have this error with the code join with this mail: home/anna/yade/lib/serialization/Serializable.hpp: In member function 'PyObject* boost::python::objects::caller_py_function_implCaller::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::callerPyObject* (*)(Serializable, const Serializable), boost::python::default_call_policies, boost::mpl::vector3PyObject*, Serializable, const Serializable ]': /home/anna/yade/lib/serialization/Serializable.hpp:264: warning: dereferencing pointer 'p.2661' does break strict-aliasing rules /usr/include/boost/python/detail/destroy.hpp:90: note: initialized from here /home/anna/build-trunk/include/yade/lib/factory/Factorable.hpp:63: warning: dereferencing pointer 'this.685' does break strict-aliasing rules /home/anna/yade/lib/serialization/Serializable.hpp:264: note: initialized from here /home/anna/yade/lib/serialization/Serializable.hpp:264: warning: dereferencing pointer 'p.2661' does break strict-aliasing rules /usr/include/boost/python/detail/destroy.hpp:90: note: initialized from here /home/anna/build-trunk/include/yade/lib/factory/Factorable.hpp:63: warning: dereferencing pointer 'this.685' does break strict-aliasing rules /home/anna/yade/lib/serialization/Serializable.hpp:264: note: initialized from here scons: *** [/home/anna/build-trunk/lib/yade-support.os] Error 1 scons: *** [/home/anna/build-trunk/core/core.os] Error 1 scons: building terminated because of errors. What can I do to make it work? Thanks in advance, Anna /* * Copyright (C) 2004 by Olivier Galizzi * * olivier.gali...@imag.fr * * Copyright (C) 2004 by Janek Kozicki * * cosu...@berlios.de* ** * This program is free software; it is licensed under the terms of the * * GNU General Public License v2 or later. See file LICENSE for details. * */ #pragma once #include boost/any.hpp #include boost/foreach.hpp #ifndef __GXX_EXPERIMENTAL_CXX0X__ # includeboost/shared_ptr.hpp using boost::shared_ptr; #else # includememory using std::shared_ptr; #endif #includeboost/version.hpp #includeboost/python.hpp #includeboost/type_traits.hpp #includeboost/lexical_cast.hpp #includeboost/preprocessor.hpp #includeboost/type_traits/integral_constant.hpp #includelist #includemap #includestring #includevector #includeiostream #includeyade/lib/factory/Factorable.hpp #includeyade/lib/pyutil/raw_constructor.hpp #includeyade/lib/pyutil/doc_opts.hpp #includeyade/lib/base/Math.hpp using namespace boost; using namespace std; // empty functions for ADL //namespace{ templatetypename T void preLoad(T){}; templatetypename T void postLoad(T obj){ /* cerrGeneric no-op postLoad(typeid(T).name()) called for obj.getClassName()std::endl; */ } templatetypename T void preSave(T){}; templatetypename T void postSave(T){} //}; // attribute flags namespace yade{ namespace Attr{ // keep in sync with py/wrapper/yadeWrapper.cpp ! enum flags { noSave=1, readonly=2, triggerPostLoad=4, hidden=8, noResize=16 }; }; }; using namespace yade; // see: // https://bugs.launchpad.net/yade/+bug/539562 // http://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/faq.html#topythonconversionfailed // for reason why the original def_readwrite will not work: // #define _PYATTR_DEF(x,thisClass,z) .def_readwrite(BOOST_PP_STRINGIZE(BOOST_PP_TUPLE_ELEM(2,0,z)),thisClass::BOOST_PP_TUPLE_ELEM(2,0,z),BOOST_PP_TUPLE_ELEM(2,1,z)) #define _PYATTR_DEF(x,thisClass,z) _DEF_READWRITE_CUSTOM(thisClass,z) // // return reference for vector and matrix types to allow things like // O.bodies.pos[1].state.vel[2]=0 // returning value would only change copy of velocity, without propagating back to the original // // see http://www.mail-archive.com/yade-dev@lists.launchpad.net/msg03406.html // // note that for sequences (like vector etc), values are returned; but in case of // vector of shared_ptr's, things inside are still shared, so // O.engines[2].gravity=(0,0,9.33) will work // // OTOH got sequences of non-shared types, it sill (silently) fail: // f=Facet(); f.vertices[1][0]=4 // // see http://www.boost.org/doc/libs/1_42_0/libs/type_traits/doc/html/boost_typetraits/background.html // about how this works namespace yade{ // by default, do not return reference; return value instead templatetypename T struct py_wrap_ref: public boost::false_type{}; // specialize for types that should be returned as references template struct py_wrap_refVector3r: public
Re: [Yade-dev] How to change the macros
Hi, Anton, I have to change the body of the class: class WireMat: public FrictMat { public: virtual shared_ptrState newAssocState() const { return shared_ptrState(new WireState); } virtual bool stateTypeOk(State* s) const { return (bool)dynamic_castWireState*(s); } void postLoad(WireMat); DECLARE_LOGGER; YADE_CLASS_BASE_DOC_ATTRS_CTOR(WireMat,FrictMat,Material for use with the Wire classes, ((Real,diameter,0.0027,, (Diameter of the single wire in [m] (the diameter is used to compute the cross-section area of the wire).)) ((vectorVector2r,strainStressValues1,,Attr::triggerPostLoad,Piecewise linear definition of the stress-strain curve by set of points (strain[-]0,stress[Pa]0) for one single wire. Tension only is considered and the point (0,0) is not needed!)) /I've add a other vector in order to take account of my two curves*/ ((vectorVector2r,strainStressValues2,,Attr::triggerPostLoad,Piecewise linear definition of the stress-strain curve by set of points (strain[-]0,stress[Pa]0) for one double wire. Tension only is considered and the point (0,0) is not needed!)) ((bool,isDoubleTwist,false,,Type of the mesh. If true two particles of the same material which body ids differ by one will be considered as double-twisted interaction.)) /*((Real,lambdaEps,0.4,,Parameter between 0 and 1 to reduce the failure strain of the double-twisted wire (as used by [Bertrand2008]_). [-])) ((Real,lambdak,0.21,,Parameter between 0 and 1 to compute the elastic stiffness of the double-twisted wire (as used by [Bertrand2008]_): $k^D=2(\\lambda_k k_h + (1-\\lambda_k)k^S)$. [-]))*/ ((vector,lambda,,Attr::triggerPostLoad,/*it contain the two lamdaEps and lambdak in order to not have to modify the form of the fonction(don't want to change the number of parameters*/,lambda[0]=lambdaEps,lambda[1]=lambdak)) ((Real,as,0,Attr::readonly,Cross-section area of a single wire used for the computation of the limit normal contact forces. [m²])) , createIndex(); ); REGISTER_CLASS_INDEX(WireMat,FrictMat); But it can't work with YADE_CLASS_BASE_DOC_ATTRS_CTOR() because of the number of parameters so I've try to modify serialiazable.hpp in order to have a new fuction with the number of parameters I need: /** USER MACROS START HERE / // attrs is (type,name,init-value,docstring) #define YADE_CLASS_BASE_DOC(klass,base,doc) YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc) #define YADE_CLASS_BASE_DOC_ATTRS(klass,base,doc,attrs) YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,,,) #define YADE_CLASS_BASE_DOC_ATTRS_CTOR(klass,base,doc,attrs,ctor) YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,,ctor,) /*Adding a macro to have additional attributes/ #define YADE_CLASS_BASE_DOC_ATTRS_attrs_CTOR(klass,base,doc,attrs,attrs,ctor) YADE_CLASS_BASE_DOC_ATTRS_attrs_INIT_CTOR_PY(klass,base,doc,attrs,attrs,,ctor,) #define YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(klass,base,doc,attrs,ctor,py) YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,,ctor,py) #define YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,inits,ctor,py) YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(klass,base,doc,attrs,,inits,ctor,py) Thanks. Anna ___ Mailing list: https://launchpad.net/~yade-dev Post to : yade-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp