~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to core/main/main.py.in

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# get yade path (allow YADE_PREFIX to override)
12
12
prefix,suffix='${runtimePREFIX}' if not os.environ.has_key('YADE_PREFIX') else os.environ['YADE_PREFIX'],'${SUFFIX}'
13
13
# duplicate some items from yade.config here, so that we can increase verbosity when the c++ part is booting
14
 
features,version='${features}'.split(' '),'${realVersion}'
 
14
features,version,debugbuild='${features}'.split(' '),'${realVersion}',' ${debugbuild}'
15
15
 
16
16
libPATH='${LIBRARY_OUTPUT_PATH}'
17
17
if (libPATH[1:] == '{LIBRARY_OUTPUT_PATH}'): libPATH='lib'
52
52
par.add_argument('--performance',help='Starts a test to measure the productivity',dest='performance',action='store_true')
53
53
par.add_argument('script',nargs='?',default='',type=str,help=argparse.SUPPRESS)
54
54
par.add_argument('args',nargs=argparse.REMAINDER,help=argparse.SUPPRESS) # see argparse doc, par.disable_interspersed_args() from optargs module
 
55
par.add_argument('-l',help='import libraries at startup before importing yade libs. May be used when the ordering of imports matter (see e.g. https://bugs.launchpad.net/yade/+bug/1183402/comments/3). The option can be use multiple times, as in "yade -llib1 -llib2"',default=None,action='append',dest='impLibraries',type=str)
55
56
opts=par.parse_args()
56
57
args = opts.args
57
58
 
 
59
if opts.impLibraries:
 
60
        sys.path.append('.')
 
61
        for lib in opts.impLibraries:
 
62
                __import__(lib)
 
63
 
58
64
if opts.version:
59
 
        print 'Yade version: %s'%version
 
65
        print 'Yade version: %s%s'%(version,debugbuild)
60
66
        sys.exit(0)
61
67
 
62
68
if opts.script:
109
115
else: os.environ['OMP_NUM_THREADS']='1'
110
116
 
111
117
if __name__ == "__main__": # do not print this while importing yade in other python application
112
 
        sys.stderr.write('Welcome to Yade '+version+'\n')
 
118
        sys.stderr.write('Welcome to Yade '+version+debugbuild+'\n')
113
119
 
114
120
# initialization and c++ plugins import
115
121
import yade
242
248
                # usually Xlib.error.DisplayError, but there can be Xlib.error.XauthError etc as well
243
249
                # let's just pretend any exception means the display would not work
244
250
                gui=None
 
251
                print 'Warning: no X rendering available (see https://bbs.archlinux.org/viewtopic.php?id=13189)'
245
252
 
246
253
# run remote access things, before actually starting the user session (not while imported by other python application)
247
254
if __name__ == "__main__":