如何强制重新编译Julia包?

huangapple go评论41阅读模式
英文:

How can I force a Julia package to redo precompilation?

问题

我添加了一个包到我的Julia环境中,并且这个包成功预编译。然而,控制台中记录了几条日志消息和错误。这些错误似乎已经被捕获,因为它们没有导致预编译失败。

我如何强制我的Julia环境中的一个包重新进行预编译?

英文:

I added a package to my Julia environment, and the package successfully precompiled. However, several log messages and errors were logged to the console. The errors seem to have been caught because they did not cause precompilation to fail.

How do I force a Julia package in my environment to redo precompilation?

答案1

得分: 1

朱莉亚包通常预编译到 DEPOT_PATH[1]/compiled/v#.#/包的名称,其中 DEPOT_PATH[1] 通常是位于您的主目录下的 ~/.julia

强制重新编译的一种方法是删除上述位置的缓存文件。

另一种方法是使用包名称作为 String 调用以下函数。

force_recompile(package_name::String) = Base.compilecache(Base.identify_package(package_name))

对于通过 Pkg.develop] dev 导入的包,修改包文件也会强制重新编译。

英文:

Julia packages are usually precompiled to DEPOT_PATH[1]/compiled/v#.#/NameOfPackage where DEPOT_PATH[1] is usually ~/.julia in your home directory.

One way to force recompilation is to delete the cache files at the above location.

Another way is to invoke the following function with the name of the package as a String.

force_recompile(package_name::String) = Base.compilecache(Base.identify_package(package_name))

For packages imported via Pkg.develop or ] dev, modify the package files will also force recompilation.

huangapple
  • 本文由 发表于 2023年5月22日 14:48:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76303618.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定