📄 sconstruct
字号:
####################################################################### ::::_aureservoir_::::# C++ library for analog reservoir computing neural networks## Scons build system for aureservoir# (here only installing headers)## Georg Holzmann, 2007## This library is free software; you can redistribute it and/or# modify it under the terms of the GNU Lesser General Public# License as published by the Free Software Foundation; either# version 2.1 of the License, or (at your option) any later version.######################################################################import os, glob, sys, os.path###################################################################### build files#####################################################################files = glob.glob("*.h") # install all *.h filesfiles += glob.glob("*.hpp") # install all *.h files###################################################################### build system help#####################################################################Help("\nType: 'scons' for dependency checking.")Help("\n 'scons install' to install headers.\n")Help("\n 'scons doc' to build doxygen documentation.\n")Help("\n 'scons -c' to clean objects and build programs.\n")###################################################################### general build options#####################################################################env = Environment(ENV = {'PATH' : os.environ['PATH'], 'TERM' : os.environ['TERM'], 'HOME' : os.environ['HOME']})env.Append( CPPPATH=['.',] )env.Append(CCFLAGS="-O2 -fPIC -Wall -ffast-math -mfpmath=sse -msse -msse2")###################################################################### command line options#####################################################################opt = Options('options.cache')opt.AddOptions( PathOption('flens_path', 'include path for FLENS', None), PathOption('fftw3_path', 'include path for FFTW3', None), ('prefix', 'install prefix', '/usr/local'))opt.Update(env)opt.Save('options.cache',env)Help(opt.GenerateHelpText(env))if env.has_key('flens_path'): env.Append(CPPPATH=[env['flens_path']])if env.has_key('fftw3_path'): env.Append(CPPPATH=[env['fftw3_path']])if env.has_key('prefix'): prefix = env['prefix']###################################################################### check dependencies###################################################################### don't check in help or clean modechecking = 1if "-h" in sys.argv: checking = 0# do the checksconf = Configure(env)if checking: if not conf.CheckLib('flens', language="C++"): print 'Did not find FLENS library !' Exit(1) if not conf.CheckCXXHeader('flens/flens.h'): print 'Did not find FLENS header (flens/flens.h) !' Exit(1) if not conf.CheckHeader('xmmintrin.h'): print 'Did not find xmmintrin.h !' Exit(1) if not conf.CheckLib('fftw3', language="C"): print 'Did not find FFTW3 library !' Exit(1) if not conf.CheckLib('fftw3f', language="C"): print 'Did not find FFTW3 single precision library !' Exit(1) if not conf.CheckHeader('fftw3.h'): print 'Did not find FFTW3 header !' Exit(1)env = conf.Finish()###################################################################### install library#####################################################################headerinstall = env.Install(os.path.join(env['prefix'], "include", "aureservoir"), files)env.Alias("install", [headerinstall,])###################################################################### build doxygen documentation#####################################################################def build_doxy(target,source,env): """ Builder-code to build doxygen docu """ cmd = "doxygen " + str(source[0]) os.system(cmd) builddoc = Builder(action = build_doxy)env.Append(BUILDERS = {'Doc' : builddoc} )# dummy target - is there a better method ?doc = env.Doc('html/index.html','Doxyfile')env.NoClean(doc)env.Alias("doc", doc)###################################################################### EOF#####################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -