8000 numpy/bscript at master · powerphysics/numpy · GitHub
[go: up one dir, main page]

Skip to content
< 5D2A script type="application/json" data-target="react-app.embeddedData">{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"benchmarks","path":"benchmarks","contentType":"directory"},{"name":"branding","path":"branding","contentType":"directory"},{"name":"doc","path":"doc","contentType":"directory"},{"name":"numpy","path":"numpy","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"BENTO_BUILD.txt","path":"BENTO_BUILD.txt","contentType":"file"},{"name":"COMPATIBILITY","path":"COMPATIBILITY","contentType":"file"},{"name":"DEV_README.txt","path":"DEV_README.txt","contentType":"file"},{"name":"INSTALL.txt","path":"INSTALL.txt","contentType":"file"},{"name":"LICENSE.txt","path":"LICENSE.txt","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"README.txt","path":"README.txt","contentType":"file"},{"name":"TEST_COMMIT","path":"TEST_COMMIT","contentType":"file"},{"name":"THANKS.txt","path":"THANKS.txt","contentType":"file"},{"name":"bento.info","path":"bento.info","contentType":"file"},{"name":"bscript","path":"bscript","contentType":"file"},{"name":"pavement.py","path":"pavement.py","contentType":"file"},{"name":"release.sh","path":"release.sh","contentType":"file"},{"name":"setup.py","path":"setup.py","contentType":"file"},{"name":"setupegg.py","path":"setupegg.py","contentType":"file"},{"name":"setupscons.py","path":"setupscons.py","contentType":"file"},{"name":"setupsconsegg.py","path":"setupsconsegg.py","contentType":"file"},{"name":"site.cfg.example","path":"site.cfg.example","contentType":"file"}],"totalCount":25}},"fileTreeProcessingTime":8.907316,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":2945624,"defaultBranch":"master","name":"numpy","ownerLogin":"powerphysics","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2011-12-09T06:46:08.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1251544?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1627184217.006834","canEdit":false,"refType":"branch","currentOid":"5a683949d87fbad1dc93fb4fcb8b8293e7d19dc4"},"path":"bscript","currentUser":null,"blob":{"rawLines":["\"\"\"","See BENTO_BUILD.txt.","","Caveats:",""," - no automatic detection for BLAS/LAPACK/etc... You need to set it up"," manually for now (except on Mac OS X and Debian/Ubuntu). The upside is"," that it is extremely easy to do so"," - bento is still in flux, and some things may changes between releases.","\"\"\""," ","import os","import sys","import shutil","import subprocess","import string","","import os.path as op","","# Ugly but necessary hack: import numpy here so that wscript in sub directories","# will see this numpy and not an already installed one","import __builtin__","__builtin__.__NUMPY_SETUP__ = True","","from bento.installed_package_description \\"," import \\"," InstalledSection","from bento.commands import hooks","from bento.commands.extras.waf \\"," import \\"," ConfigureWafContext, BuildWafContext, register_options","","import waflib","","sys.path.insert(0, os.getcwd())","try:"," _SETUP_PY = __import__(\"setup\")","finally:"," sys.path.pop(0)","","def check_blas_lapack(conf):"," conf.env.HAS_CBLAS = False"," if sys.platform == \"win32\":"," mkl_libs = \"mkl_lapack95,mkl_blas95,mkl_intel_c,mkl_intel_thread,mkl_core,libiomp5md\".split(\",\")"," mkl_base = r\"C:\\Program Files\\Intel\\Compiler\\11.1\\051\""," conf.env.INCLUDES.append(\"%s\\mkl\\include\" % mkl_base)"," conf.env.LIBPATH.extend([\"%s\\mkl\\ia32\\lib\" % mkl_base,"," \"%s\\lib\\ia32\" % mkl_base])",""," try:"," conf.check_cc(lib=mkl_libs, msg=\"Checking for MKL (CBLAS)\","," uselib_store=\"CBLAS\")"," conf.env.HAS_CBLAS = True",""," conf.check_cc(lib=mkl_libs, msg=\"Checking for MKL (LAPACK)\","," uselib_store=\"LAPACK\")"," conf.env.HAS_LAPACK = True"," except waflib.Errors.ConfigurationError:"," pass",""," elif sys.platform == \"darwin\":"," try:"," conf.check(framework=\"Accelerate\", msg=\"Checking for framework Accelerate\", uselib_store=\"CBLAS\")"," conf.env.HAS_CBLAS = True",""," conf.check(framework=\"Accelerate\", msg=\"Checking for framework Accelerate\", uselib_store=\"LAPACK\")"," conf.env.HAS_LAPACK = True"," except waflib.Errors.ConfigurationError:"," pass"," else:"," try:"," conf.check_cc(lib=[\"cblas\", \"atlas\"], uselib_store=\"CBLAS\")"," conf.env.HAS_CBLAS = True",""," conf.check_cc(lib=[\"lapack\", \"f77blas\", \"cblas\", \"atlas\"],"," uselib_store=\"LAPACK\")"," conf.env.HAS_LAPACK = True"," except waflib.Errors.ConfigurationError:"," pass",""," # You can manually set up blas/lapack as follows:"," #conf.env.HAS_CBLAS = True"," #conf.env.LIB_CBLAS = [\"cblas\", \"atlas\"]"," #conf.env.HAS_LAPACK = True"," #conf.env.LIB_LAPACK = [\"lapack\", \"f77blas\", \"cblas\", \"atlas\"]","","def remove_flag(name, flag):"," while True:"," if name in flag:"," i = flag.index(name)"," flag.pop(i)"," else:"," break","","def remove_flag_postvalue(name, flag):"," while True:"," if name in flag:"," i = flag.index(name)"," flag.pop(i)"," flag.pop(i)"," else:"," break","","def remove_flag_prevalue(name, flag):"," while True:"," if name in flag:"," i = flag.index(name)"," flag.pop(i-1)"," flag.pop(i-1)"," else:"," break","","@hooks.pre_configure","def pre_configure(context):"," conf = context.waf_context",""," conf.load(\"compiler_c\")"," conf.load(\"python\")",""," conf.check_python_version((2, 4, 0))"," conf.check_python_headers()"," if sys.platform == \"darwin\":"," remove_flag_prevalue(\"ppc\", conf.env.CFLAGS_PYEXT)"," remove_flag_prevalue(\"ppc\", conf.env.LINKFLAGS_PYEXT)"," conf.env[\"MACOSX_DEPLOYMENT_TARGET\"] = \"10.4\"",""," if conf.env[\"CC_NAME\"] == \"gcc\":"," conf.env.CFLAGS_PYEXT.append(\"-Wfatal-errors\")"," check_blas_lapack(conf)","","# FIXME: abstract those module gen tasks...","class write_module(waflib.Task.Task):"," color = \"CYAN\""," vars = [\"CONTENT\"]"," def run(self):"," # FIXME: put actual data here"," self.outputs[0].write(self.env.CONTENT)","","@waflib.TaskGen.feature(\"gen_pymodule\")","def process_write_config(self):"," if not hasattr(self, \"content\"):"," raise ValueError(\"task gen %r expects a 'content' argument\" % self.name)"," else:"," self.env.CONTENT = self.content"," output = self.path.find_or_declare(self.target)"," name = getattr(self, \"name\", None) or self.target",""," bento_context = self.bld.bento_context"," b_output = bento_context.build_node.make_node(output.bldpath())"," bento_context.outputs_registry.register_outputs("," \"gen_pymodule\", name, [b_output], bento_context.build_node, \"$sitedir\")",""," tsk = self.create_task(\"write_module\")"," tsk.set_outputs(output)"," return tsk","","def set_revision(template, version):"," try:"," proc = subprocess.Popen('git rev-parse --short HEAD',"," stdout=subprocess.PIPE,"," stderr=subprocess.PIPE,"," shell=True)"," git_revision, _ = proc.communicate()"," git_revision = git_revision.strip()"," except Exception:"," git_revision = \"Unknown\"",""," full_version = version"," template_str = template.read()",""," if not _SETUP_PY.ISRELEASED:"," full_version += '.dev-' + git_revision[:7]"," content = string.Template(template_str).substitute(version=version,"," full_version=full_version, git_revision=git_revision,"," is_released=_SETUP_PY.ISRELEASED)"," output = template.change_ext(\"\")"," output.safe_write(content)"," return output","","def make_git_commit_info(ctx):"," commit_template = ctx.make_source_node(op.join(\"numpy\", \"version.py.in\"))"," return set_revision(commit_template, ctx.pkg.version)","","@hooks.pre_build","def pre_build(context):"," bld = context.waf_context",""," context.register_category(\"git_info\")"," commit_output = make_git_commit_info(context)"," context.register_outputs(\"git_info\", \"git_commit_info\", [commit_output])",""," def iregistrer(category, name, nodes, from_node, target_dir):"," source_dir = os.path.join(\"$_srcrootdir\", from_node.bldpath())"," files = [n.path_from(from_node) for n in nodes]"," return InstalledSection.from_source_target_directories(category, name, source_dir, target_dir, files)"," context.isection_registry.register_category(\"gen_pymodule\", iregistrer)"," context.outputs_registry.register_category(\"gen_pymodule\", \"pythonfiles\")"," bld(features=\"gen_pymodule\","," target=\"numpy/__config__.py\","," content=\"\"\"\\","def show():"," pass","\"\"\","," always=True)","","@hooks.options","def options(context):"," register_options(context)","","@hooks.startup","def startup(context):"," context.register_context(\"configure\", ConfigureWafContext)"," context.register_context(\"build\", BuildWafContext)"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/powerphysics/numpy/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"bscript","displayUrl":"https://github.com/powerphysics/numpy/blob/master/bscript?raw=true","headerInfo":{"blobSize":"6.68 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"205414c","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fpowerphysics%2Fnumpy%2Fblob%2Fmaster%2Fbscript","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"213","truncatedSloc":"178"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":null,"languageID":null,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/powerphysics/numpy/blob/master/bscript","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/powerphysics/numpy/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/powerphysics/numpy/raw/refs/heads/master/bscript","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":true,"symbols":[]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/powerphysics/numpy/branches":{"post":"tDABdTD7DoQD5HQoG2hvfkkJnaEzD_yI9YqLQsqHPNJ3n41I0G9k2T5PexIkOMQbIb9QvgDfe2gOp7A8fFBMbg"},"/repos/preferences":{"post":"HBQY-OuxyX553zCtoM9-UuN6w2yF-W1emGKSs4GI5LdTSnGnOp__bnJRhgLzGGiBETLoTs28fCRDRhKpR6BE0A"}}},"title":"numpy/bscript at master · powerphysics/numpy","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}
0