yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05892
[Branch ~yade-dev/yade/trunk] Rev 2479: 1. Make number in qt4 show the left-most part if the text field is narrower, rather than the left...
------------------------------------------------------------
revno: 2479
committer: Václav Šmilauer <eu@xxxxxxxx>
branch nick: yade
timestamp: Wed 2010-10-13 16:03:59 +0200
message:
1. Make number in qt4 show the left-most part if the text field is narrower, rather than the left part
2. Run the debug version if optimized is not available, even without --debug
3. Add the possibility of running the monolithig compilation (mono=True); not fully functional yet.
4. Add warning when using march with clang, which leads to crashes (optimizations are not the cause, in the end)
added:
SConscript-mono
modified:
SConstruct
core/main/main.py.in
gui/qt4/SerializableEditor.py
pkg/common/Engine/GlobalEngine/ResetRandomPosition.cpp
py/SConscript
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== added file 'SConscript-mono'
--- SConscript-mono 1970-01-01 00:00:00 +0000
+++ SConscript-mono 2010-10-13 14:03:59 +0000
@@ -0,0 +1,93 @@
+# syntax: python
+Import('*')
+
+
+srcs=[] # list of single source files that will be compiled in chunks based on chunkSize
+extraSrcs=[] # list of _chunks_ (list/tuple) of sources that will be compiled separately
+pyMods=[] # list of symbolic links that will point to the resulting library; their sources must be specified in srcs/extraSrcs
+libs=[]
+
+### core
+
+pyMain='$PREFIX/bin/yade$SUFFIX'
+env['PLUGINDIR']='$PREFIX/lib/yade$SUFFIX'
+main=env.ScanReplace('core/main/main.py.in')
+batch=env.ScanReplace('core/main/yade-batch.in')
+env.AlwaysBuild(main)
+env.AlwaysBuild(batch)
+env.InstallAs(pyMain,main)
+env.InstallAs(pyMain+'-batch',batch)
+env.AddPostAction(pyMain,Chmod(pyMain,0755))
+env.AddPostAction(pyMain+'-batch',Chmod(pyMain+'-batch',0755))
+
+extraSrcs+=[['core/'+f for f in ['Body.cpp','BodyContainer.cpp','Bound.cpp','Cell.cpp','PartialEngine.cpp','Engine.cpp','FileGenerator.cpp','FrontEnd.cpp','Interaction.cpp','InteractionContainer.cpp','GroupRelationData.cpp','Material.cpp','Scene.cpp','Dispatcher.cpp','Omega.cpp','Shape.cpp','SimulationFlow.cpp','State.cpp','ThreadRunner.cpp','ThreadWorker.cpp','TimeStepper.cpp','corePlugins.cpp','main/pyboot.cpp']]]
+pyMods+=['boot']
+
+# libs
+srcs+=['lib/'+f for f in ['base/Math.cpp','factory/ClassFactory.cpp','factory/DynLibManager.cpp','multimethods/Indexable.cpp','serialization/Serializable.cpp','pyutil/gil.cpp']]
+if 'opengl' in env['features']:
+ srcs+=['lib/opengl/GLUtils.cpp']
+ libs+=['GL','GLU','glut']
+if 'cgal' in env['features']:
+ extraSrcs+=[['lib/'+f for f in Split('triangulation/KinematicLocalisationAnalyser.cpp triangulation/Operations.cpp triangulation/RegularTriangulation.cpp triangulation/Timer.cpp triangulation/basicVTKwritter.cpp triangulation/FlowBoundingSphere.cpp triangulation/Deformation.cpp triangulation/Empilement.cpp triangulation/stdafx.cpp triangulation/Tenseur3.cpp triangulation/Tesselation.cpp triangulation/TriaxialState.cpp')]]
+
+# py
+if 'gts' in env['features']:
+ extraSrcs+=['py/'+f for f in ('3rd-party/pygts-0.3.1/cleanup.c','3rd-party/pygts-0.3.1/edge.c','3rd-party/pygts-0.3.1/face.c','3rd-party/pygts-0.3.1/object.c','3rd-party/pygts-0.3.1/point.c','3rd-party/pygts-0.3.1/pygts.c','3rd-party/pygts-0.3.1/segment.c','3rd-party/pygts-0.3.1/surface.c','3rd-party/pygts-0.3.1/triangle.c','3rd-party/pygts-0.3.1/vertex.c')]
+ pyMods+=['../gts/_gts']
+ env.Install('$PLUGINDIR/py/gts',[env.File('py/3rd-party/pygts-0.3.1/__init__.py'),env.File('py/3rd-party/pygts-0.3.1/pygts.py')])
+
+pyMods+=['../miniEigen','WeightedAverage2d','log','_utils','_packPredicates','_packSpheres','_packObb','wrapper','_customConverters','_eudoxos','_packSpherePadder']
+srcs+=['py/mathWrap/miniEigen.cpp','py/WeightedAverage2d.cpp','py/_eudoxos.cpp','py/log.cpp','py/_utils.cpp','py/pack/_packPredicates.cpp','py/pack/_packSpheres.cpp','py/pack/_packObb.cpp','py/wrapper/yadeWrapper.cpp','py/wrapper/customConverters.cpp']
+extraSrcs+=[ ['py/pack/_packSpherePadder.cpp','py/pack/SpherePadder/SpherePadder.cpp','py/pack/SpherePadder/TetraMesh.cpp','py/pack/SpherePadder/CellPartition.cpp']+(['py/pack/SpherePadder/SpherePackingTriangulation.cpp'] if 'cgal' in env['features'] else []) ]
+
+env.Install('$PLUGINDIR/py/yade',[
+ env.AlwaysBuild(env.ScanReplace('py/__init__.py.in')),
+ env.AlwaysBuild(env.ScanReplace('py/config.py.in'))
+ ]
+ +[env.File('py/'+f) for f in ['utils.py','ymport.py','export.py','eudoxos.py','plot.py','params.py','linterpolation.py','timing.py','pack/pack.py','remote.py','system.py','export.py','post2d.py','runtime.py','manpage.py','_extraDocs.py',]]
+)
+env.Install('$PLUGINDIR/py/yade/tests',[env.File('__init__.py','py/tests'),env.File('wrapper.py','py/tests'),env.File('omega.py','py/tests')
+])
+
+env.Install('$PLUGINDIR/py',[
+ env.File('mtTkinter.py','py/3rd-party/mtTkinter-0.3'),
+])
+
+# gui
+if 'qt4' in env['features']:
+ env.Install('$PLUGINDIR/py/yade/qt',[env.File('gui/'+f) for f in ['qt4/img_rc.py','qt4/ui_controller.py','qt4/SerializableEditor.py','qt4/Inspector.py','qt4/__init__.py',]])
+ env.Command('gui/qt4/img_rc.py','gui/qt4/img.qrc','pyrcc4 -o $buildDir/gui/qt4/img_rc.py gui/qt4/img.qrc')
+ env.Command('gui/qt4/ui_controller.py','gui/qt4/controller.ui','pyuic4 -o $buildDir/gui/qt4/ui_controller.py gui/qt4/controller.ui')
+ srcs+=['gui/qt4/GLViewer.cpp','gui/qt4/_GLViewer.cpp','gui/qt4/OpenGLManager.cpp']
+ pyMods+=['qt/_GLViewer']
+ libs+=[env['QGLVIEWER_LIB']]
+
+# pkg
+pluginsSrcs=[p.src for p in env['buildPlugs'].values()]
+srcs+=pluginsSrcs
+
+
+# building itself
+env['LIBS']=env['LIBS']+libs
+
+extraChunks=[(ff if isinstance(ff,str) else env.Combine('chunk%d.%s'%(i,ff[0].split('.')[-1]),ff)) for i,ff in enumerate(extraSrcs)]
+#import pprint; pprint.pprint(extraSrcs)
+chunkSize=env['chunkSize']
+if chunkSize>1:
+ srcsChunks=[srcs[chunkSize*i:chunkSize*(i+1)] for i in range(0,1+len(srcs)/chunkSize)]
+ env.Install('$PLUGINDIR',env.SharedLibrary('yade',[env.Combine('yade%d.cpp'%i,chunkSrcs) for i,chunkSrcs in enumerate(srcsChunks)]+extraChunks))
+elif chunkSize==1:
+ env.Install('$PLUGINDIR',env.SharedLibrary('yade',srcs+extraChunks))
+else: # chunkSize<=0
+ env.Install('$PLUGINDIR',env.SharedLibrary('yade',[env.Combine('yade.cpp',srcs)]+extraChunks))
+
+yadeSo=env.subst('$PLUGINDIR/libyade.so')
+import os, os.path
+for m in pyMods:
+ mm=env.subst('$PLUGINDIR/py/yade/'+m+'.so')
+ d=os.path.dirname(mm);
+ if not os.path.exists(d): os.makedirs(d)
+ relpath=os.path.relpath(yadeSo,d)
+ env.Command(mm,yadeSo,'ln -s -f "%s" "%s"'%(relpath,mm))
+
=== modified file 'SConstruct'
--- SConstruct 2010-10-12 18:02:23 +0000
+++ SConstruct 2010-10-13 14:03:59 +0000
@@ -451,7 +451,6 @@
### COMPILER
if env['debug']: env.Append(CXXFLAGS='-ggdb2',CPPDEFINES=['YADE_DEBUG'])
-else: env.Append(CXXFLAGS='-O3')
if 'openmp' in env['features']: env.Append(CXXFLAGS='-fopenmp',LIBS='gomp',CPPDEFINES='YADE_OPENMP')
if env['optimize']:
# NDEBUG is used in /usr/include/assert.h: when defined, asserts() are no-ops
@@ -471,9 +470,9 @@
if 'clang' in env['CXX']:
print 'Looks like we use clang, adding some flags to avoid warning flood.'
- env.Append(CXXFLAGS=['-Wno-unused-variable','-Wno-mismatched-tags','-Wno-constant-logical-operand','-Qunused-arguments'])
+ env.Append(CXXFLAGS=['-Wno-unused-variable','-Wno-mismatched-tags','-Wno-constant-logical-operand','-Qunused-arguments','-Wno-empty-body'])
if 'openmp' in env['features']: print 'WARNING: building with clang and OpenMP feature, expect compilation errors!'
- if env['optimize']: print 'WARNING: clang\'s optimized builds might crash at startup (if so, recompile with opimize=0)!'
+ if env['march']: print 'WARNING: specifying march with clang\'s might lead to crash at startup (if so, recompile with march= )!'
### LINKER
=== modified file 'core/main/main.py.in'
--- core/main/main.py.in 2010-10-12 18:02:23 +0000
+++ core/main/main.py.in 2010-10-13 14:03:59 +0000
@@ -11,12 +11,12 @@
## find available builds
nonDebugLibDir=prefix+'/lib/yade'+suffix
debugLibDir=nonDebugLibDir+'/dbg'
-hasDebug,hasNonDebug=os.path.exists(debugLibDir+'/lib'),os.path.exists(nonDebugLibDir+'/lib')
+hasDebug,hasNonDebug=os.path.exists(debugLibDir+'/py/yade/__init__.py'),os.path.exists(nonDebugLibDir+'/py/yade/__init__.py')
if hasDebug and hasNonDebug: buildsAvailable='both non-debug and debug build'
elif hasDebug and not hasNonDebug: buildsAvailable='debug build only'
elif not hasDebug and hasNonDebug: buildsAvailable='non-debug build only'
else:
- raise RuntimeError('Neither non-debug nor debug build found! ('+nonDebugLibDir+'/lib, '+debugLibDir+'/lib)')
+ raise RuntimeError('Neither non-debug nor debug build found! ('+nonDebugLibDir+'/py/yade/__init__.py, '+debugLibDir+'/py/yade/__init__.py)')
# handle command-line options first
@@ -57,8 +57,10 @@
libDir=debugLibDir
else:
if not hasNonDebug:
- raise RuntimeError('Non-debug build not available (running with --debug, or try --rebuild)')
- libDir=nonDebugLibDir
+ print 'WARNING: non-debug build not available, running with --debug instead (try --rebuild to get the non-debug build).'
+ #raise RuntimeError('Non-debug build not available (run with --debug, or try --rebuild)')
+ else:
+ libDir=nonDebugLibDir
## remove later
## python2.5 relative module imports workaround
=== modified file 'gui/qt4/SerializableEditor.py'
--- gui/qt4/SerializableEditor.py 2010-09-30 18:00:41 +0000
+++ gui/qt4/SerializableEditor.py 2010-10-13 14:03:59 +0000
@@ -107,7 +107,7 @@
self.textEdited.connect(self.isHot)
self.selectionChanged.connect(self.isHot)
self.editingFinished.connect(self.update)
- def refresh(self): self.setText(str(self.getter()))
+ def refresh(self): self.setText(str(self.getter())); self.home(False)
def update(self):
try: self.trySetter(float(self.text()))
except ValueError: self.refresh()
@@ -129,7 +129,7 @@
def refresh(self):
val=self.getter(); axis,angle=val.toAxisAngle()
for i in (0,1,2,4):
- self.grid.itemAt(i).widget().setText(str(axis[i] if i<3 else angle))
+ w=self.grid.itemAt(i).widget(); w.setText(str(axis[i] if i<3 else angle)); w.home(False)
def update(self):
try:
x=[float((self.grid.itemAt(i).widget().text())) for i in (0,1,2,4)]
@@ -156,8 +156,9 @@
def refresh(self):
pos,ori=self.getter(); axis,angle=ori.toAxisAngle()
for i in (0,1,2,4):
- self.grid.itemAtPosition(1,i).widget().setText(str(axis[i] if i<3 else angle))
- for i in (0,1,2): self.grid.itemAtPosition(0,i).widget().setText(str(pos[i]))
+ w=self.grid.itemAtPosition(1,i).widget(); w.setText(str(axis[i] if i<3 else angle)); w.home(False)
+ for i in (0,1,2):
+ w=self.grid.itemAtPosition(0,i).widget(); w.setText(str(pos[i])); w.home(False)
def update(self):
try:
q=[float((self.grid.itemAtPosition(1,i).widget().text())) for i in (0,1,2,4)]
@@ -186,7 +187,9 @@
def refresh(self):
val=self.getter()
for row,col in itertools.product(range(self.rows),range(self.cols)):
- self.grid.itemAtPosition(row,col).widget().setText(str(val[self.idxConverter(row,col)]))
+ w=self.grid.itemAtPosition(row,col).widget()
+ w.setText(str(val[self.idxConverter(row,col)]))
+ w.home(False) # make the left-most part visible, if the text is wider than the widget
def update(self):
try:
val=self.getter()
@@ -216,7 +219,7 @@
def refresh(self):
val=self.getter()
for row,col in itertools.product(range(self.rows),range(self.cols)):
- self.grid.itemAtPosition(row,col).widget().setValue(val[self.idxConverter(row,col)])
+ w=self.grid.itemAtPosition(row,col).widget().setValue(val[self.idxConverter(row,col)])
def update(self):
val=self.getter(); modified=False
for row,col in itertools.product(range(self.rows),range(self.cols)):
=== modified file 'pkg/common/Engine/GlobalEngine/ResetRandomPosition.cpp'
--- pkg/common/Engine/GlobalEngine/ResetRandomPosition.cpp 2010-09-30 18:00:41 +0000
+++ pkg/common/Engine/GlobalEngine/ResetRandomPosition.cpp 2010-10-13 14:03:59 +0000
@@ -6,6 +6,10 @@
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
+#ifdef pi
+ #undef pi
+#endif
+
#include<boost/random.hpp>
#include<yade/core/Body.hpp>
#include<yade/pkg-common/Aabb.hpp>
=== modified file 'py/SConscript'
--- py/SConscript 2010-10-11 16:28:49 +0000
+++ py/SConscript 2010-10-13 14:03:59 +0000
@@ -40,7 +40,7 @@
env.File('manpage.py'),
env.File('_extraDocs.py'),
env.SharedLibrary('wrapper',['wrapper/yadeWrapper.cpp'],SHLIBPREFIX='',LIBS=linkPlugins(['Shop','Dispatching','InteractionLoop','ParallelEngine','Clump','STLImporter',])),
- env.SharedLibrary('_customConverters',['wrapper/customConverters.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+linkPlugins(['Dispatching']))
+ env.SharedLibrary('_customConverters',['wrapper/customConverters.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+linkPlugins(['Dispatching']+(['GLDrawFunctors','OpenGLRenderer'] if 'opengl' in env['features'] else [])))
])
env.Install('$LIBDIR/py/yade/tests',[
env.File('__init__.py','tests'),