简体   繁体   English

将libjpeg v8安装到/ opt / local

[英]Install libjpeg v8 to /opt/local

How do I install libjpeg 8 to /opt/local on OSX? 如何在OSX上将libjpeg 8安装到/ opt / local? The reason I am asking is that I would like to create small movies of brain activity using the MNE-C libraries . 我要问的原因是,我想使用MNE-C库制作有关大脑活动的小电影。

I executed 'mne_make_movie' which results in the following error: 我执行了“ mne_make_movie”,导致以下错误:

Movie production selected (from data)... Scanning /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib for plugins Found lqt_mjpeg.so...Getting codec info from module Trying to load /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so... dlopen failed for /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so: dlopen(/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so, 2): Library not loaded: /opt/local/lib/libjpeg.8.dylib Referenced from: /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so 已选择电影制作(从数据中)...正在扫描/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib以找到插件找到lqt_mjpeg.so ...从模块中获取编解码器信息试图加载/ Users /user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so ... dlopen对于/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg失败.so:dlopen(/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so,2):库未加载:/opt/local/lib/libjpeg.8.dylib已引用来自:/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so
Reason: image not found ERROR: lqt_find_video_codec failed to find codecs! 原因:找不到图像错误:lqt_find_video_codec找不到编解码器!

Since everything is already compiled I don't think I can change the location where 'mne_make_movie' is looking for libjpeg. 由于所有内容均已编译,因此我认为无法更改'mne_make_movie'寻找libjpeg的位置。 So I tried installing libjpeg using Mac Ports, which only has libjpeg-turbo available. 因此,我尝试使用Mac Ports(仅提供libjpeg-turbo)安装libjpeg。 However, then I get another error: 但是,然后出现另一个错误:

Movie production selected (from data)... Scanning /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib for plugins Found lqt_mjpeg.so...Getting codec info from module Trying to load /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so... dlopen failed for /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so: dlopen(/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so, 2): Library not loaded: /opt/local/lib/libjpeg.8.dylib Referenced from: /Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so 已选择电影制作(从数据中)...正在扫描/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib以找到插件找到lqt_mjpeg.so ...从模块中获取编解码器信息试图加载/ Users /user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so ... dlopen对于/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg失败.so:dlopen(/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so,2):库未加载:/opt/local/lib/libjpeg.8.dylib已引用来自:/Users/user/mne/MNE-2.7.4-3420-MacOSX-x86_64/lib/lqt_mjpeg.so
Reason: Incompatible library version: lqt_mjpeg.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 10.0.0 ERROR: lqt_find_video_codec failed to find codecs! 原因:库版本不兼容:lqt_mjpeg.so需要版本13.0.0或更高版本,但libjpeg.8.dylib提供了版本10.0.0错误:lqt_find_video_codec找不到编解码器!

A more up to date version does not seem to be available on Mac Ports. Mac Ports上似乎没有更新的版本。

On the official website of libjpeg I downloaded the source for version 8d and followed the install instructions. 在libjpeg的官方网站上 ,我下载了版本8d的源代码并遵循安装说明。 This would install everything to /usr/local. 这会将所有内容安装到/ usr / local。 I am not familiar with makefiles and don't know what I have to alter to install everything correctly to /opt/local. 我不熟悉makefile,也不知道要更改所有内容才能正确地将所有内容安装到/ opt / local。

So how do I install libjpeg 8 version 13.0.0 or greater to /opt/local? 那么,如何将libjpeg 8版本13.0.0或更高版本安装到/ opt / local?

PS: Homebrew does not seem applicable since it does not install to /opt/local (and it is not recommended to change it to /opt/local) and libjpeg 9 seems to be the only version available. PS:Homebrew似乎不适用,因为它没有安装到/ opt / local(不建议将其更改为/ opt / local),并且libjpeg 9似乎是唯一可用的版本。

If you don't use command-line build tools much, or you have recently upgraded macOS, you will probably need to download the Xcode command-line tools before you start. 如果您不太使用命令行构建工具,或者您最近升级了macOS,则可能需要在开始之前下载Xcode命令行工具。 It won't do any harm if you already have them. 如果您已经拥有它们,则不会造成任何伤害。 The command is: 该命令是:

xcode-select --install

Then the following should work, though I have not tested it, so you may like to copy and paste one line at a time into your Terminal: 然后,以下内容应该可以工作,尽管我尚未测试过,所以您可能希望一次复制一行并将其粘贴到您的终端中:

curl -O -J -L http://www.ijg.org/files/jpegsrc.v8.tar.gz
tar xvfz jpeg*tar.gz                 # Unzip and untar what you downloaded
cd jpeg-8                            # Change directory to wherever it unpacked to
./configure --prefix="/opt/local"    # Configure with the necessary prefix
make
make install

You may need to prefix the last line with sudo . 您可能需要在最后一行加上sudo前缀。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM