1. <i id='Cm35E'><tr id='Cm35E'><dt id='Cm35E'><q id='Cm35E'><span id='Cm35E'><b id='Cm35E'><form id='Cm35E'><ins id='Cm35E'></ins><ul id='Cm35E'></ul><sub id='Cm35E'></sub></form><legend id='Cm35E'></legend><bdo id='Cm35E'><pre id='Cm35E'><center id='Cm35E'></center></pre></bdo></b><th id='Cm35E'></th></span></q></dt></tr></i><div id='Cm35E'><tfoot id='Cm35E'></tfoot><dl id='Cm35E'><fieldset id='Cm35E'></fieldset></dl></div>

      <small id='Cm35E'></small><noframes id='Cm35E'>

      <tfoot id='Cm35E'></tfoot>

        • <bdo id='Cm35E'></bdo><ul id='Cm35E'></ul>
        <legend id='Cm35E'><style id='Cm35E'><dir id='Cm35E'><q id='Cm35E'></q></dir></style></legend>

        用编译的 Julia 打包 Python?

        Packaging Python with compiled Julia?(用编译的 Julia 打包 Python?)
        • <i id='kvckh'><tr id='kvckh'><dt id='kvckh'><q id='kvckh'><span id='kvckh'><b id='kvckh'><form id='kvckh'><ins id='kvckh'></ins><ul id='kvckh'></ul><sub id='kvckh'></sub></form><legend id='kvckh'></legend><bdo id='kvckh'><pre id='kvckh'><center id='kvckh'></center></pre></bdo></b><th id='kvckh'></th></span></q></dt></tr></i><div id='kvckh'><tfoot id='kvckh'></tfoot><dl id='kvckh'><fieldset id='kvckh'></fieldset></dl></div>

          <small id='kvckh'></small><noframes id='kvckh'>

            <bdo id='kvckh'></bdo><ul id='kvckh'></ul>
            <legend id='kvckh'><style id='kvckh'><dir id='kvckh'><q id='kvckh'></q></dir></style></legend>
            <tfoot id='kvckh'></tfoot>

                  <tbody id='kvckh'></tbody>
                  本文介绍了用编译的 Julia 打包 Python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个严重依赖 Julia 库的 python 包.我们实际上不是使用 PyCall,而是使用 PackageCompiler.jl 将 Julia 代码编译成共享对象 .so 文件.在 python 模块中使用 ctypes 引用它.它还需要 Julia 系统映像.

                  I am working on a python package that relies heavily on a Julia library. Rather than use PyCall, we actually compile the Julia code down into shared objects .so files using PackageCompiler.jl. It is referenced using ctypes in the python module. It also requires a Julia systemimage.

                  有人对如何打包有任何想法吗?我知道您可以在 distutils 中构建 C/C++,但我还没有真正找到跨多个平台包含 Julia 的好地方.

                  Does anyone have any ideas on how to package this? I know that you can build C/C++ inside of distutils, but I haven't really found a good venue for including Julia across multiple platforms.

                  这里要明确一点,对于使用这个 Python 包的人来说,他们需要安装 Julia,并且他们需要适合他们系统的共享对象库.这些可以通过运行 Julia 编译器 juliac.jl 来获得.其他一切都在 Python 中.

                  To be clear here, for someone to use this Python package they need a Julia installation and they need the appropriate shared object libraries for their system. Those can be gotten by running the Julia compiler juliac.jl. Everything else is in Python.

                  推荐答案

                  假设你使用 setup.py 构建你的库,你需要在调用时将共享库添加到 package_datasetup():

                  Assuming you are using setup.py to build your library, you need to add the shared library(s) to package_data when calling setup():

                  setup.py

                  # call out to build system to build the shared library
                  
                  setup(
                    name="my-extension",
                    ext_modules="..."
                    package_data="/path/to/mylib.so"
                  )
                  

                  在此处查看更多文档:https://docs.python.org/3/distutils/setupscript.html#installing-package-data

                  运行 python setup.py bdist_wheel 创建 .whl 文件后,您可能还想运行 auditwheel,它将兼容性标记(例如 manylinux1)并隔离(用哈希重命名,修复链接)共享库.

                  After running python setup.py bdist_wheel to create a .whl file, you may also want to run auditwheel, which will compatibility tag (e.g. manylinux1) and isolate (rename with hash, fix-up linkages) the shared libraries.

                  这篇关于用编译的 Julia 打包 Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Running .jl file from R or Python(从 R 或 Python 运行 .jl 文件)
                  Running Julia .jl file in python(在 python 中运行 Julia .jl 文件)
                  Using PIP in a Azure WebApp(在 Azure WebApp 中使用 PIP)
                  How to run python3.7 based flask web api on azure(如何在 azure 上运行基于 python3.7 的烧瓶 web api)
                  Azure Python Web App Internal Server Error(Azure Python Web 应用程序内部服务器错误)
                  Run python dlib library on azure app service(在 azure app 服务上运行 python dlib 库)

                      <bdo id='f9ZcD'></bdo><ul id='f9ZcD'></ul>

                          <legend id='f9ZcD'><style id='f9ZcD'><dir id='f9ZcD'><q id='f9ZcD'></q></dir></style></legend>
                            <tbody id='f9ZcD'></tbody>

                          <small id='f9ZcD'></small><noframes id='f9ZcD'>

                          <i id='f9ZcD'><tr id='f9ZcD'><dt id='f9ZcD'><q id='f9ZcD'><span id='f9ZcD'><b id='f9ZcD'><form id='f9ZcD'><ins id='f9ZcD'></ins><ul id='f9ZcD'></ul><sub id='f9ZcD'></sub></form><legend id='f9ZcD'></legend><bdo id='f9ZcD'><pre id='f9ZcD'><center id='f9ZcD'></center></pre></bdo></b><th id='f9ZcD'></th></span></q></dt></tr></i><div id='f9ZcD'><tfoot id='f9ZcD'></tfoot><dl id='f9ZcD'><fieldset id='f9ZcD'></fieldset></dl></div>

                            <tfoot id='f9ZcD'></tfoot>