← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2486: 1. Add OpenGLRenderer to DomainLimiter, that should fix the linking issue reported by Janek.

 

------------------------------------------------------------
revno: 2486
committer: Václav Šmilauer <eu@xxxxxxxx>
branch nick: yade
timestamp: Thu 2010-10-14 10:18:42 +0200
message:
  1. Add OpenGLRenderer to DomainLimiter, that should fix the linking issue reported by Janek.
modified:
  SConscript-mono
  SConstruct
  pkg/dem/ConcretePM.cpp
  pkg/dem/DomainLimiter.cpp
  py/__init__.py.in


--
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
=== modified file 'SConscript-mono'
--- SConscript-mono	2010-10-13 14:03:59 +0000
+++ SConscript-mono	2010-10-14 08:18:42 +0000
@@ -1,4 +1,4 @@
-# syntax: python
+# vim: syntax=python
 Import('*')
 
 
@@ -67,20 +67,28 @@
 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 os.path
+
+def makeChunk(chunk,srcs,baseDir=None):
+	if not baseDir: baseDir=env['buildDir']
+	chunk2=baseDir+'/'+chunk
+	f=open(chunk2,'w')
+	for s in srcs: f.write('#include<%s>\n'%os.path.abspath(env['topLevelDir']+'/'+s))
+	return chunk2
+	
+
+extraChunks=[(ff if isinstance(ff,str) else makeChunk('chunk%02d.%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))
+	env.Install('$PLUGINDIR',env.SharedLibrary('yade',[makeChunk('yade%02d.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))
+	env.Install('$PLUGINDIR',env.SharedLibrary('yade',[makeChunk('yade.cpp',srcs)]+extraChunks))
 
 yadeSo=env.subst('$PLUGINDIR/libyade.so')
 import os, os.path

=== modified file 'SConstruct'
--- SConstruct	2010-10-13 16:23:08 +0000
+++ SConstruct	2010-10-14 08:18:42 +0000
@@ -477,8 +477,10 @@
 
 ### LINKER
 ## libs for all plugins
-env.Append(LIBS=[],SHLINKFLAGS=['-rdynamic'])
-env.Append(LINKFLAGS=['-rdynamic','-Wl,-z,origin']) 
+if not env['mono']:
+	env.Append(LIBS=[],SHLINKFLAGS=['-rdynamic'])
+	env.Append(LINKFLAGS=['-rdynamic','-Wl,-z,origin'])
+
 if not env['debug']: env.Append(SHLINKFLAGS=['-W,--strip-all'])
 
 # makes dynamic library loading easier (no LD_LIBRARY_PATH) and perhaps faster
@@ -581,6 +583,7 @@
 env['buildPlugs']=buildPlugs
 
 if env['mono']:
+	env['topLevelDir']=os.path.abspath(os.getcwd())
 	env.SConscript('SConscript-mono',build_dir=buildDir,duplicate=0)
 
 else:

=== modified file 'pkg/dem/ConcretePM.cpp'
--- pkg/dem/ConcretePM.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/ConcretePM.cpp	2010-10-14 08:18:42 +0000
@@ -133,7 +133,7 @@
 
 
 #ifdef YADE_CPM_FULL_MODEL_AVAILABLE
-	#include"../../../../brefcom-mm.hh"
+	#include"../../brefcom-mm.hh"
 #endif
 
 // #undef CPM_MATERIAL_MODEL (force trunk version of the model)

=== modified file 'pkg/dem/DomainLimiter.cpp'
--- pkg/dem/DomainLimiter.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/DomainLimiter.cpp	2010-10-14 08:18:42 +0000
@@ -182,6 +182,7 @@
 #include<yade/lib-opengl/OpenGLWrapper.hpp>
 #include<yade/lib-opengl/GLUtils.hpp>
 #include<yade/pkg-common/GLDrawFunctors.hpp>
+#include<yade/pkg-common/OpenGLRenderer.hpp>
 #include<GL/glu.h>
 
 CREATE_LOGGER(GlExtra_LawTester);

=== modified file 'py/__init__.py.in'
--- py/__init__.py.in	2010-10-11 16:28:49 +0000
+++ py/__init__.py.in	2010-10-14 08:18:42 +0000
@@ -18,12 +18,15 @@
 	import dl
 except ImportError:
 	import DLFCN as dl
-# see file:///usr/share/doc/python2.6/html/library/sys.html#sys.setdlopenflags
-# and various web posts on the topic, e.g.
-# * http://gcc.gnu.org/faq.html#dso
-# * http://www.code-muse.com/blog/?p=58
-# * http://wiki.python.org/moin/boost.python/CrossExtensionModuleDependencies
-sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL)
+if not eval('${mono}'):
+	# see file:///usr/share/doc/python2.6/html/library/sys.html#sys.setdlopenflags
+	# and various web posts on the topic, e.g.
+	# * http://gcc.gnu.org/faq.html#dso
+	# * http://www.code-muse.com/blog/?p=58
+	# * http://wiki.python.org/moin/boost.python/CrossExtensionModuleDependencies
+	sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL)
+else: sys.setdlopenflags(dl.RTLD_NOW)
+
 # important: initialize c++ by importing libstdc++ directly
 # see http://www.abclinuxu.cz/poradna/programovani/show/286322
 # https://bugs.launchpad.net/bugs/490744