title: Install libjpeg v8 to /opt/local
body: <p>How do I install libjpeg 8 to /opt/local on OSX? The reason I am asking is that I would like to create small movies of brain activity using the <a href="http://www.nmr.mgh.harvard.edu/martinos/userInfo/data/MNE_register/index.php" rel="nofollow noreferrer">MNE-C libraries</a>.</p>
  
  <p>I executed 'mne_make_movie' which results in the following error:</p>
  
  <blockquote>
    <p>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<br>
    Reason: image not found ERROR: lqt_find_video_codec failed to find
    codecs!</p>
  </blockquote>
  
  <p>Since everything is already compiled I don't think I can change the location where 'mne_make_movie' is looking for libjpeg. So I tried installing libjpeg using Mac Ports, which only has libjpeg-turbo available. However, then I get another error:</p>
  
  <blockquote>
    <p>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<br>
    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!</p>
  </blockquote>
  
  <p>A more up to date version does not seem to be available on Mac Ports.</p>
  
  <p>On the official <a href="http://www.ijg.org/files/" rel="nofollow noreferrer">website</a> of libjpeg I downloaded the source for version 8d and followed the install instructions. This would install everything to /usr/local. I am not familiar with makefiles and don't know what I have to alter to install everything correctly to /opt/local.</p>
  
  <p>So how do I install libjpeg 8 version 13.0.0 or greater to /opt/local?</p>
  
  <p>P.S.: 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.</p>