1)在OpenEXR官网上下载相关组件 http://www.openexr.com/downloads.html。目前最新的稳定版本为:
ImlBase1.0.2 source code release
OpenEXR 1.7.0 source code release
在zlib官网上下载最新版本的zlib。http://zlib.net
Zlib 1.2.7 source code release
2)解压到相应的目录
sudo tar -zxvf ilmbase-1.0.2.tar.gz -C /usr/local/
sudo tar -zxvf openexr-1.7.0.tar.gz -C /usr/local/
sudo tar -zxvf zlib-1.2.7.tar.gz -C /usr/local/
3)编译安装IlmBase
安装C/C++编译器
sudo apt-get install gcc
gcc安装相关构建工具
apt-get install build-essential
cd /usr/local/ilmbase-1.0.2
sudo ./configure
sudo make
sudo make install
4)编译安装Zlib
cd /usr/local/zlib-1.2.7
sudo ./configure
sudo make
sudo make install
4)安装编译OpenEXR
sudo apt-get install gawk
cd /usr/local/openexr-1.7.0
sudo ./configure
sudo make
sudo make install
遇到问题及解决方案:
1)/usr/local/include/OpenEXR/ImathMatrix.h:1813:5:error: ‘memset’ was not declared in this scope
解决方法:
sudo chmod a+w/usr/local/include/OpenEXR/ImathMatrix.h
vi /usr/local/include/OpenEXR/ImathMatrix.h
在打开的文件中加入#include “string.h”,保存后退出。
2)blurImage.cpp:423:62:error: ‘memcpy’ was not declared in this scope
解决方法:
sudo chmod a+w/usr/local/openexr-1.7.0/exrenvmap/blurImage.cpp
vi /usr/local/openexr-1.7.0/exrenvmap/blurImage.cpp
在打开的文件中加入#include “string.h”,保存后退出。