yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05784
[Branch ~yade-dev/yade/trunk] Rev 2452: 1. Make the debug build installed in the same directory as the release build; it is compiled with...
------------------------------------------------------------
revno: 2452
committer: Chiara Modenese <chia@engs-018373>
branch nick: yade
timestamp: Thu 2010-09-30 10:05:24 +0100
message:
1. Make the debug build installed in the same directory as the release build; it is compiled with debug=1 (or True); there is only a single yade executable for both, and the debug plugins are loaded with --debug. I tried to adjust packaging rules a bit, I hope it will not introduce additional errors. --debug and --rebuild work fine together.
2. Add --debug option to yade-batch, which runs yade with --debug.
modified:
SConstruct
Yade.kdevelop
core/SConscript
core/main/main.py.in
core/main/yade-batch.in
debian/rules
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 'SConstruct'
--- SConstruct 2010-09-27 17:47:59 +0000
+++ SConstruct 2010-09-30 09:05:24 +0000
@@ -75,46 +75,21 @@
env['sourceRoot']=os.getcwd()
profOpts=Variables(profileFile)
-profOpts.Add(('profile','Config profile to use (predefined: default or "", dbg); append ! to use it but not save for next build (in scons.current-profile)','default'))
+profOpts.Add(('profile','Config profile to use (predefined: default or ""); append ! to use it but not save for next build (in scons.current-profile)','default'))
profOpts.Update(env)
# multiple profiles - run them all at the same time
# take care not to save current profile for those parallel builds
if env['profile']=='': env['profile']='default'
# save the profile only if the last char is not !
-if env['profile'][-1]=='!': env['profile']=env['profile'][:-1]
-else: profOpts.Save(profileFile,env)
-
-if ',' in env['profile']:
- profiles=env['profile'].split(',')
- import threading,subprocess
- def runProfile(profile): subprocess.call([sys.argv[0],'-Q','profile='+profile+'!'])
- profileThreads=[]
- for arg in sys.argv[2:]:
- print "WARNING: parallel-building, extra argument `%s' ignored!"%arg
- for p in profiles:
- t=threading.Thread(target=runProfile,name='profile_'+p,args=(p,))
- t.start()
- profileThreads.append(t)
- import atexit
- def killAllProfileThreads():
- for t in profileThreads:
- t.join(0.1)
- atexit.register(killAllProfileThreads)
- for t in profileThreads:
- t.join()
- Exit()
+saveProfile=True
+if env['profile'][-1]=='!': env['profile'],noSaveProfile=env['profile'][:-1],False
+if saveProfile: profOpts.Save(profileFile,env)
if env['profile']=='': env['profile']='default'
optsFile='scons.profile-'+env['profile']
profile=env['profile']
print '@@@ Using profile',profile,'('+optsFile+') @@@'
-# defaults for various profiles
-if profile=='default': defOptions={'debug':0,'variant':'','optimize':1,'chunkSize':10}
-elif profile=='dbg': defOptions={'debug':1,'variant':'-dbg','optimize':0,'chunkSize':1}
-else: defOptions={'debug':0,'optimize':0,'variant':'-'+profile,'chunkSize':10}
-
-
opts=Variables(optsFile)
## compatibility hack again
if 'AddVariables' not in dir(opts): opts.AddVariables=opts.AddOptions
@@ -134,10 +109,10 @@
### OLD: use PathOption with PathOption.PathIsDirCreate, but that doesn't exist in 0.96.1!
('PREFIX','Install path prefix','/usr/local'),
('runtimePREFIX','Runtime path prefix; DO NOT USE, inteded for packaging only.',None),
- ('variant','Build variant, will be suffixed to all files, along with version (beware: if PREFIX is the same, headers of the older version will still be overwritten',defOptions['variant'],None,lambda x:x),
- BoolVariable('debug', 'Enable debugging information and disable optimizations',defOptions['debug']),
+ ('variant','Build variant, will be suffixed to all files, along with version (beware: if PREFIX is the same, headers of the older version will still be overwritten','' if profile=='default' else '-'+profile,None,lambda x:x),
+ BoolVariable('debug', 'Enable debugging information',0),
BoolVariable('gprof','Enable profiling information for gprof',0),
- BoolVariable('optimize','Turn on heavy optimizations',defOptions['optimize']),
+ BoolVariable('optimize','Turn on heavy optimizations',1),
ListVariable('exclude','Yade components that will not be built','none',names=['gui','extra','common','dem','lattice','snow']),
EnumVariable('PGO','Whether to "gen"erate or "use" Profile-Guided Optimization','',['','gen','use'],{'no':'','0':'','false':''},1),
ListVariable('features','Optional features that are turned on','log4cxx,opengl,gts,openmp,vtk',names=['opengl','log4cxx','cgal','openmp','gts','vtk','python','gl2ps','devirt-functors','qt4','never_use_this_one']),
@@ -157,6 +132,7 @@
('CXXFLAGS','Additional compiler flags for compilation (like -march=core2).',None,None,Split),
('march','Architecture to use with -march=... when optimizing','native',None,None),
BoolVariable('mono','[experimental] Build only one shared library and make all other files (python objects, for instance) only be symlinks.',0),
+ ('execCheck','Name of the main script that should be installed; if the current one differs, an erro is raised (do not use directly, only intended for --rebuild',None),
#('SHLINK','Linker for shared objects','g++'),
('SHCCFLAGS','Additional compiler flags for linking (for plugins).',None,None,Split),
BoolVariable('QUAD_PRECISION','typedef Real as long double (=quad)',0),
@@ -168,7 +144,7 @@
print 'ERROR: using "features=all" is illegal, since it breaks feature detection at runtime (SCons limitation). Write out all features separated by commas instead. Sorry.'
Exit(1)
-opts.Save(optsFile,env)
+if saveProfile: opts.Save(optsFile,env)
# fix expansion in python substitution by assigning the right value if not specified
if not env.has_key('runtimePREFIX') or not env['runtimePREFIX']: env['runtimePREFIX']=env['PREFIX']
@@ -209,7 +185,8 @@
if not env.has_key('realVersion') or not env['realVersion']: env['realVersion']=yadeSCons.getRealVersion() or 'unknown' # unknown if nothing returned
if not env.has_key('version'): env['version']=env['realVersion']
-env['SUFFIX']='-'+env['version']+env['variant']
+env['SUFFIX_NODEBUG']='-'+env['version']+env['variant']
+env['SUFFIX']=env['SUFFIX_NODEBUG']+('' if not env['debug'] else '/dbg')
print "Yade version is `%s' (%s), installed files will be suffixed with `%s'."%(env['version'],env['realVersion'],env['SUFFIX'])
# make buildDir absolute, saves hassles later
buildDir=os.path.abspath(env.subst('$buildPrefix/build$SUFFIX'))
@@ -648,9 +625,13 @@
## only when installing without requesting special path (we would have no way
## to know what should be installed overall.
if not COMMAND_LINE_TARGETS:
- toInstall=[str(node) for node in env.FindInstalledFiles()]
+ toInstall=set([str(node) for node in env.FindInstalledFiles()])
for root,dirs,files in os.walk(env.subst('$PREFIX/lib/yade${SUFFIX}')):
+ # do not go inside the debug directly, plugins are different there
for f in files:
+ # skip debug files, if in the non-debug build
+ if not env['debug'] and '/dbg/' in root: continue
+ #print 'Considering',f
ff=os.path.join(root,f)
# do not delete python-optimized files and symbolic links (lib_gts__python-module.so, for instance)
if ff not in toInstall and not ff.endswith('.pyo') and not ff.endswith('.pyc') and not os.path.islink(ff) and not os.path.basename(ff).startswith('.nfs'):
=== modified file 'Yade.kdevelop'
--- Yade.kdevelop 2010-08-23 15:33:22 +0000
+++ Yade.kdevelop 2010-09-30 09:05:24 +0000
@@ -10,36 +10,36 @@
<projectname>Yade</projectname>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
- <description/>
- <defaultencoding/>
+ <description></description>
+ <defaultencoding></defaultencoding>
<versioncontrol/>
</general>
<kdevcustomproject>
<run>
- <mainprogram>/home/vincent/yade-local/trunk</mainprogram>
+ <mainprogram>/usr/bin/python</mainprogram>
<directoryradio>executable</directoryradio>
- <programargs/>
- <globaldebugarguments/>
+ <programargs>/home/chia/yade/inst/bin/yade-r2446</programargs>
+ <globaldebugarguments>/home/chia/yade/inst/bin/yade-r2446-dbg</globaldebugarguments>
<globalcwd>/tmp</globalcwd>
<useglobalprogram>false</useglobalprogram>
- <terminal>false</terminal>
- <autocompile>false</autocompile>
- <autoinstall>false</autoinstall>
+ <terminal>true</terminal>
+ <autocompile>true</autocompile>
+ <autoinstall>true</autoinstall>
<autokdesu>false</autokdesu>
<envvars/>
</run>
<build>
<buildtool>make</buildtool>
- <builddir/>
+ <builddir></builddir>
</build>
<make>
<abortonerror>false</abortonerror>
- <numberofjobs>10</numberofjobs>
+ <numberofjobs>4</numberofjobs>
<prio>0</prio>
<dontact>false</dontact>
<makebin>scons</makebin>
- <defaulttarget/>
- <makeoptions/>
+ <defaulttarget></defaulttarget>
+ <makeoptions></makeoptions>
<selectedenvironment>default</selectedenvironment>
<environments>
<default>
@@ -66,9 +66,9 @@
<blacklist/>
<other>
<prio>0</prio>
- <otherbin/>
- <defaulttarget/>
- <otheroptions/>
+ <otherbin>scons</otherbin>
+ <defaulttarget></defaulttarget>
+ <otheroptions></otheroptions>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
@@ -77,18 +77,18 @@
</kdevcustomproject>
<kdevdebugger>
<general>
- <dbgshell/>
- <gdbpath/>
- <configGdbScript/>
- <runShellScript/>
- <runGdbScript/>
+ <dbgshell></dbgshell>
+ <gdbpath></gdbpath>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
<raiseGDBOnStart>false</raiseGDBOnStart>
</general>
<display>
- <staticmembers>false</staticmembers>
+ <staticmembers>true</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
@@ -154,7 +154,7 @@
<root>/usr/share/qt3</root>
<designerintegration>EmbeddedKDevDesigner</designerintegration>
<qmake>/usr/bin/qmake-qt3</qmake>
- <designer></designer>
+ <designer>/usr/bin/designer</designer>
<designerpluginpaths/>
</qt>
<codecompletion>
@@ -183,7 +183,7 @@
<resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
</codecompletion>
<creategettersetter>
- <prefixGet/>
+ <prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@@ -205,9 +205,9 @@
</cppsupportpart>
<kdevdocumentation>
<projectdoc>
- <docsystem/>
- <docurl/>
- <usermanualurl/>
+ <docsystem></docsystem>
+ <docurl></docurl>
+ <usermanualurl></usermanualurl>
</projectdoc>
</kdevdocumentation>
<kdevfileview>
@@ -222,7 +222,8 @@
</tree>
</kdevfileview>
<ctagspart>
- <customArguments/>
+ <customArguments>-R --extra=+q --fields=+n --exclude='.*' --exclude=attic --exclude=doc --exclude=scons-local --exclude=include --exclude=lib/triangulation --exclude=debian --exclude='*.so' --exclude='*.s' --exclude='*.ii' --langmap=c++:+.inl,c++:+.tpp,c++:+.ipp</customArguments>
<activeTagsFiles/>
+ <customTagfilePath>/home/chia/yade/src/r2446/tags</customTagfilePath>
</ctagspart>
</kdevelop>
=== modified file 'core/SConscript'
--- core/SConscript 2010-09-10 11:33:21 +0000
+++ core/SConscript 2010-09-30 09:05:24 +0000
@@ -1,7 +1,7 @@
# syntax: python
Import('*')
-pyMain='$PREFIX/bin/yade$SUFFIX'
+pyMain='$PREFIX/bin/yade$SUFFIX_NODEBUG'
main=env.ScanReplace('main/main.py.in')
batch=env.ScanReplace('main/yade-batch.in')
env.AlwaysBuild(main)
@@ -10,6 +10,9 @@
env.InstallAs(pyMain+'-batch',batch)
env.AddPostAction(pyMain,Chmod(pyMain,0755))
env.AddPostAction(pyMain+'-batch',Chmod(pyMain+'-batch',0755))
+## for --rebuild
+if 'execCheck' in env and env['execCheck']!=env.subst(pyMain):
+ raise RuntimeError('execCheck option (%s) does not match what is about to be installed (%s)'%(env['execCheck'],env.subst(pyMain)))
env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
env.SharedLibrary('boot',['main/pyboot.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['yade-support','core'])
@@ -19,10 +22,6 @@
## remove old executable
## might be removed in the future
import os.path, os
-cxxExec=env.subst('$PREFIX/bin/yade$SUFFIX-cxx')
-if os.path.exists(cxxExec):
- print "Deleting old executable",cxxExec
- os.remove(cxxExec)
env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
env.SharedLibrary('core',
=== modified file 'core/main/main.py.in'
--- core/main/main.py.in 2010-09-23 09:17:40 +0000
+++ core/main/main.py.in 2010-09-30 09:05:24 +0000
@@ -4,32 +4,35 @@
import sys,os,os.path,time
# get yade path (allow YADE_PREFIX to override)
-prefix,suffix='${runtimePREFIX}' if not os.environ.has_key('YADE_PREFIX') else os.environ['YADE_PREFIX'],'${SUFFIX}'
-sys.path.append(os.path.join(prefix,'lib','yade'+suffix,'py'))
+prefix,suffix='${runtimePREFIX}' if not os.environ.has_key('YADE_PREFIX') else os.environ['YADE_PREFIX'],'${SUFFIX_NODEBUG}'
# duplicate some items from yade.config here, so that we can increase verbosity when the c++ part is booting
-debug,features,version=bool(${debug}),'${features}'.split(','),'${realVersion}'
-
-## python2.5 relative module imports workaround
-v=sys.version_info
-if v[0]==2 and v[1]<=5:
- for submodule in ('yade','gts','yade/tests'):
- sys.path.append(os.path.join(prefix,'lib','yade'+suffix,'py',submodule))
+features,version='${features}'.split(','),'${realVersion}'
+
+## find available builds
+nonDebugLibDir=prefix+'/lib/yade'+suffix
+hasDebug,hasNonDebug=os.path.exists(nonDebugLibDir+'/dbg/lib'),os.path.exists(nonDebugLibDir+'/lib')
+if not hasDebug and not hasNonDebug:
+ raise RuntimeError('Neither non-debug nor debug build found! ('+nonDebugLibDir+'/lib, '+nonDebugLibDir+'/dbg/lib)')
+elif hasDebug and hasNonDebug: buildsAvailable='both optimized and debug build'
+elif hasDebug and not hasNonDebug: buildsAvaible='debug build only'
+elif not hasDebug and hasNonDebug: buildsAvailable='optimized build only'
+
# handle command-line options first
import optparse
-par=optparse.OptionParser(usage='%prog [options] [ simulation.xml[.bz2] | script.py [script options]]',prog=os.path.basename(sys.argv[0]),version='%s (%s)%s'%(version,','.join(features),' with debugging symbols' if debug else ''),description="Yade: open-source platform for dynamic compuations. Homepage http://www.yade-dem.org, code hosted at http://www.launchpad.net/yade. This is version %s (with features %s %s)."%(version,','.join(features),', with debugging symbols' if debug else ''))
+par=optparse.OptionParser(usage='%prog [options] [ simulation.xml[.bz2] | script.py [script options]]',prog=os.path.basename(sys.argv[0]),version='%s (%s; %s)'%(version,','.join(features),buildsAvailable),description="Yade: open-source platform for dynamic compuations. Homepage http://www.yade-dem.org, code hosted at http://www.launchpad.net/yade. This is version %s (with features %s, %s)."%(version,','.join(features),buildsAvailable))
par.add_option('-j','--threads',help='Number of OpenMP threads to run; defaults to number of cores. Equivalent to setting OMP_NUM_THREADS environment variable.',dest='threads',type='int')
par.add_option('--update',help='Update deprecated class names in given script(s) using text search & replace. Changed files will be backed up with ~ suffix. Exit when done without running any simulation.',dest='updateScripts',action='store_true')
par.add_option('--nice',help='Increase nice level (i.e. decrease priority) by given number.',dest='nice',type='int')
par.add_option('-x',help='Exit when the script finishes',dest='exitAfter',action='store_true')
par.add_option('-v',help='Increase logging verbosity; first occurence sets default logging level to info, second to debug, third to trace.'+
('' if 'log4cxx' in features else " (Since this build doesn't use log4cxx, this option will only have effect if repeated twice (-vv), equivalent to setting YADE_DEBUG environment variable)"),action='count',dest='verbosity')
-if debug:
- par.add_option('--no-gdb',help='Do not show backtrace when yade crashes.',dest='noGdb',action='store_true',)
par.add_option('-n',help="Run without graphical interface (equivalent to unsetting the DISPLAY environment variable)",dest='nogui',action='store_true')
par.add_option('--generate-manpage',help="Generate man page documenting this program and exit",dest='manpage',metavar='FILE')
par.add_option('--rebuild',help="Re-run build in the source directory, then run the updated yade with the same command line except --rebuild. The build profile for this build (${profile}) and its stored parameters will be used.",dest='rebuild',action='store_true')
par.add_option('--test',help="Run regression test suite and exit; the exists status is 0 if all tests pass, 1 if a test fails and 2 for an unspecified exception.",dest="test",action='store_true')
+par.add_option('--debug',help='Run the debug build, if available.',dest='debug',action='store_true')
+par.add_option('--no-gdb',help='Do not show backtrace when yade crashes (only effective with --debug).',dest='noGdb',action='store_true',)
par.disable_interspersed_args()
opts,args=par.parse_args()
@@ -39,7 +42,7 @@
import subprocess
# rebuild
sourceRoot,profile='${sourceRoot}','${profile}' # replaced at install-time
- cmd=['scons','-Q','-C',sourceRoot,'profile=%s'%profile]
+ cmd=['scons','-Q','-C',sourceRoot,'profile=%s!'%profile,'debug=%d'%(1 if opts.debug else 0),'optimize=0','execCheck=%s'%(prefix+'/bin/yade'+suffix)]
print 'Rebuilding yade using',' '.join(cmd)
if subprocess.call(cmd): raise RuntimeError('Error rebuilding Yade (--rebuild).')
# run ourselves
@@ -47,6 +50,21 @@
print 'Running yade using',' '.join(argv)
sys.exit(subprocess.call(argv))
+if opts.debug:
+ if not hasDebug:
+ raise RuntimeError('Debug build not available with this installation (running with --rebuild might help)')
+ ## fix the prefix, so that yade/__init__.py picks the right plugin files
+ suffix+='/dbg'
+
+ ## remove later
+ ## python2.5 relative module imports workaround
+ v=sys.version_info
+ if v[0]==2 and v[1]<=5:
+ for submodule in ('yade','gts','yade/tests'):
+ sys.path.append(os.path.join(prefix,'lib','yade'+suffix,'py',submodule))
+
+sys.path.append(os.path.join(prefix,'lib','yade'+suffix,'py'))
+
# run regression test suite and exit
if opts.test:
import yade.tests
@@ -75,7 +93,7 @@
# has no effeect after libgomp initializes
if opts.threads: os.environ['OMP_NUM_THREADS']=str(opts.threads)
-sys.stderr.write('Welcome to Yade '+version+'\n')
+sys.stderr.write('Welcome to Yade '+version+'%s\n'%(' (debug build)' if opts.debug else ''))
# initialization and c++ plugins import
import yade
=== modified file 'core/main/yade-batch.in'
--- core/main/yade-batch.in 2010-09-23 09:17:40 +0000
+++ core/main/yade-batch.in 2010-09-30 09:05:24 +0000
@@ -259,7 +259,7 @@
return nCpu
numCores=getNumCores()
-parser=optparse.OptionParser(usage='%prog [options] TABLE SIMULATION.py',description='%prog runs yade simulation multiple times with different parameters.\n\nSee https://yade-dem.org/sphinx/user.html#batch-queuing-and-execution-yade-multi for details.')
+parser=optparse.OptionParser(usage='%prog [options] TABLE SIMULATION.py',description='%prog runs yade simulation multiple times with different parameters.\n\nSee https://yade-dem.org/sphinx/user.html#batch-queuing-and-execution-yade-batch for details.')
parser.add_option('-j','--jobs',dest='maxJobs',type='int',help="Maximum number of simultaneous threads to run (default: number of cores, further limited by OMP_NUM_THREADS if set by the environment: %d)"%numCores,metavar='NUM',default=numCores)
parser.add_option('--job-threads',dest='defaultThreads',type='int',help="Default number of threads for one job; can be overridden by per-job OMP_NUM_THREADS. Defaults to allocate all available cores (%d) for each job."%numCores,metavar='NUM',default=numCores)
parser.add_option('--force-threads',action='store_true',dest='forceThreads')
@@ -268,6 +268,7 @@
parser.add_option('-l','--lines',dest='lineList',help='Lines of TABLE to use, in the format 2,3-5,8,11-13 (default: all available lines in TABLE)',metavar='LIST')
parser.add_option('--nice',dest='nice',type='int',help='Nice value of spawned jobs (default: 10)',default=10)
parser.add_option('--executable',dest='executable',help='Name of the program to run (default: %s)'%executable,default=executable,metavar='FILE')
+parser.add_option('--debug',dest='debug',action='store_true',help='Run the executable with --debug.',default=False)
parser.add_option('--gnuplot',dest='gnuplotOut',help='Gnuplot file where gnuplot from all jobs should be put together',default=None,metavar='FILE')
parser.add_option('--dry-run',action='store_true',dest='dryRun',help='Do not actually run (useful for getting gnuplot only, for instance)',default=False)
parser.add_option('--http-wait',action='store_true',dest='httpWait',help='Do not quit if still serving overview over http repeatedly',default=False)
=== modified file 'debian/rules'
--- debian/rules 2010-09-30 08:48:24 +0000
+++ debian/rules 2010-09-30 09:05:24 +0000
@@ -51,9 +51,9 @@
### (a) use fakeroot-tcp instead of fakeroot
### (b) use just 1 job
#debug build
- NO_SCONS_GET_RECENT= scons profile=deb buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=1 jobs=1 linkStrategy=monolithic features=vtk,gts,opengl,openmp,qt4 PREFIX=debian/yade${_VERSION}-dbg/usr variant=-dbg optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2 QT4DIR=/usr/share/qt4
+ NO_SCONS_GET_RECENT= scons profile=default buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=1 jobs=1 features=vtk,gts,opengl,openmp,qt4 PREFIX=debian/yade${_VERSION}/usr variant='' optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2 QT4DIR=/usr/share/qt4
#optimized build
- NO_SCONS_GET_RECENT= scons profile=deb PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
+ NO_SCONS_GET_RECENT= scons profile=default PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
#install platform-independent files (docs, scripts, examples)
#NO_SCONS_GET_RECENT= scons profile=deb PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/share/doc/yade${_VERSION}-doc
mkdir -p debian/yade${_VERSION}/usr/share/doc/yade${_VERSION}
@@ -63,14 +63,12 @@
# generate manpages
YADE_PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/bin/yade${_VERSION} --generate-manpage yade${_VERSION}.1
YADE_PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/bin/yade${_VERSION}-batch --generate-manpage yade${_VERSION}-batch.1
- YADE_PREFIX=debian/yade${_VERSION}-dbg/usr debian/yade${_VERSION}-dbg/usr/bin/yade${_VERSION}-dbg --generate-manpage yade${_VERSION}-dbg.1
- YADE_PREFIX=debian/yade${_VERSION}-dbg/usr debian/yade${_VERSION}-dbg/usr/bin/yade${_VERSION}-dbg-batch --generate-manpage yade${_VERSION}-dbg-batch.1
check: install
dh_testdir
dh_testroot
- YADE_PREFIX=debian/yade${_VERSION}-dbg/usr debian/yade${_VERSION}-dbg/usr/bin/yade${_VERSION}-dbg --test
YADE_PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/bin/yade${_VERSION} --test
+ YADE_PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/bin/yade${_VERSION} --debug --test
# Build architecture-independent files here.
binary-indep: build install
=== modified file 'py/__init__.py.in'
--- py/__init__.py.in 2010-06-13 21:28:46 +0000
+++ py/__init__.py.in 2010-09-30 09:05:24 +0000
@@ -35,17 +35,21 @@
# find plugin directory
import os,os.path
import config
-libDir=(config.prefix if not os.environ.has_key('YADE_PREFIX') else os.environ['YADE_PREFIX'])+'/lib/yade'+config.suffix
+if 'YADE_PREFIX' in os.environ: libDir=os.environ['YADE_PREFIX']+'/lib/yade'+config.suffix
+else: libDir=config.libDir
libDir=os.path.abspath(libDir) # needed if YADE_PREFIX is a relative path
# find plugins recursively
plugins=[]
# might add followlinks=True to os.walk, for python>=2.6
for root,dirs,files in os.walk(libDir):
+ # for some reason, does not really work?
+ #dirs=[d for d in dirs if d!='dbg']
for f in files:
+ # ouch, ugly!
+ if not config.debug and '/dbg/' in root: continue
if not (f.startswith('lib') and f.endswith('.so')): continue
plugin=os.path.join(libDir,root,f)
plugins.append(plugin)
-
# c++ initialization code
import boot