Linux 安装库 (ICU) 问题

发布于 2024-09-19 11:20:30 字数 598 浏览 2 评论 0原文

我是安装库的相对菜鸟。我的系统当前有旧版本的 ICU 库 (3.8) 我想要最新的 (4.4) )。

按照 ICU readme.html 中的步骤操作,一切顺利(echo $? 每一步都会生成全 0)。我看到该库已安装到 /usr/local/lib 中。但是,该库的当前版本安装在 /usr/lib 中。

我的问题。

1) 这两个地点之间是否存在“组织”或其他显着差异?

2)如何将新库的安装路径更改为/usr/lib?

3) 库位于错误的位置是否是我运行 ICU 目录中的示例时出现“加载共享库时出错:libicui18n.so.44”的原因?

谢谢大家。

I'm a relative noob to installing libraries. My system currently has an older version of the ICU library (3.8) and I want to go the latest (4.4).

Following the steps in the ICU readme.html, everything goes fine (echo $? produces all 0 for every step). And I see the libary was installed to /usr/local/lib. However the current version of the library is is installed in /usr/lib.

My questions.

1) Is there an "organzational" or some other significant difference between these two locations?

2) How can I change the install path for the new library to /usr/lib?

3) Is the library being in the wrong location the reason why when I run even the samples in the ICU directory, I get "error while loading shared libraries: libicui18n.so.44"?

Thanks all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昨迟人 2024-09-26 11:20:31
  1. /usr/local 是本地安装的软件的目录层次结构。 /usr/bin、/usr/lib/ 等用于系统管理的文件(即由您的发行版工具(如 rpm yum dselect 等)管理的文件)。
  2. 通常您不应该将内容安装到 /usr/lib 中
  3. 您可能需要运行 ldconfig (以 root 身份)来更新将名称(如 libicui18n.so.44)映射到路径名(如 /usr/local/lib/libicui18n.so.44)的库缓存

另一个问题是,如果您有 x86_64 系统,64 位库的正确库路径是 /usr/local/lib64 而不是 /usr/local/lib。在这种情况下,在构建 ICU 时将 --libdir=/usr/local/lib64 添加到 ./configure 命令行。

  1. /usr/local is the directory hierarchy for locally installed software. /usr/bin, /usr/lib/, etc. are for system managed files (i.e. the ones managed by your distributions tools like rpm yum dselect etc.)
  2. You shouldn't install things into /usr/lib generally
  3. You may need to run ldconfig (as root) to update the library cache that maps names (like libicui18n.so.44) to path names (like /usr/local/lib/libicui18n.so.44)

Another wrinkle is that if you have an x86_64 system, the correct library path for 64 bit libraries is /usr/local/lib64 not /usr/local/lib. In this case add --libdir=/usr/local/lib64 to the ./configure command line when building ICU.

浅暮の光 2024-09-26 11:20:30

1) 直接位于 /usr 中的内容属于您的发行版,除非通过其包管理器,否则不应修改。 /usr/local 中的内容属于本地安装,供您根据需要进行管理。因此,将较新的 libICU 本地安装放在 /usr/local/lib 中是正确的。

2)您可以通过在构建 ICU 时调整一些设置来做到这一点 - 我无法给您具体建议,因为我不知道 ICU 使用什么构建线束。但是,您不应该这样做,因为这会覆盖发行版的文件,这可能会导致任意可怕的损坏。

3)有点。问题不在于该库安装在错误的位置,而是 /usr/local/lib 不在默认搜索路径中。您可以通过两种方式修复此问题:

  • 使用此 shell 命令暂时为自己修复:

    export LD_LIBRARY_PATH=/usr/local/lib
    
  • 通过将 /usr/local/lib 添加到 /etc/ld 中的列表,永久为所有用户提供.so.conf,然后以 root 身份运行 ldconfig

1) Stuff directly in /usr belongs to your distribution and should not be modified except via its package manager. Stuff in /usr/local belongs to the local installation, and is for you to manage as you see fit. Thus, it is correct to put a local installation of a newer libICU in /usr/local/lib.

2) You can do this by adjusting some settings when you build ICU - I can't give you specific advice because I don't know what build harness ICU uses. However, you should not do this, because that will overwrite the distribution's files, which can cause arbitrarily horrible breakage.

3) Sort of. The problem is not that the library was installed in the wrong place, but that /usr/local/lib isn't in the default search path. You can fix this two ways:

  • temporarily for yourself with this shell command:

    export LD_LIBRARY_PATH=/usr/local/lib
    
  • permanently for all users, by adding /usr/local/lib to the list in /etc/ld.so.conf and then running ldconfig as root.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文