gpt4 book ai didi

使用 nar maven 插件创建 so 而不是 dylib

转载 作者:行者123 更新时间:2023-11-30 15:29:46 26 4
gpt4 key购买 nike

我现在已经在 Mac 上构建了 pljava。 pljava 使用maven 和maven nar 插件进行构建。此 maven nar 构建当前正在创建 dylib 而不是 .so。看来 postgres 需要一个 .so 来代替。这是打开 postgres 跟踪的输出:

2014-09-26 10:12:59 EDT STATEMENT:  CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C
2014-09-26 10:12:59 EDT DEBUG: bind <unnamed> to <unnamed>
2014-09-26 10:12:59 EDT LOG: execute <unnamed>: CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C
2014-09-26 10:12:59 EDT DEBUG: ProcessUtility
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/postgresql/pljava"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/pljava"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/share/pljava/pljava"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/pljava"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/server/pljava"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/postgresql/pljava.so"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/pljava.so"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/share/pljava/pljava.so"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/pljava.so"
2014-09-26 10:12:59 EDT DEBUG: find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/server/pljava.so"
2014-09-26 10:12:59 EDT ERROR: could not access file "pljava": No such file or directory

所以我的问题是 - 如何使 maven nar 输出 .so 文件而不是 .dylib?如果我使用类型“shared”,则会创建 dylib;如果我使用类型“plugin”,则会创建 .bundle;如果我使用类型“static”,则链接会失败。

最佳答案

我解决了我的问题。使用“插件”类型创建正确类型的文件。迈尔斯对这个问题的回答帮助我弄清楚了:

What are the differences between .so and .dylib on osx?

Mac OS 建议可加载模块使用 .bundle 扩展名,但移植的应用程序(如 PostgreSQL)仍然希望使用 .so。将文件名更改为 pljava.so 后,PostgreSQL 成功加载了该模块。

关于使用 nar maven 插件创建 so 而不是 dylib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26063061/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com