You only need to follow the instructions in this section 1.0 once (the first time you want to use the Naiad Buddy for Field3D). However, please follow the instructions in section 2.0 every time you need to update the Naiad Buddy for Field3D due to a new Naiad release.
Since you will be compiling and building the Naiad Buddy yourself, you will need the following tools and utilities installed:
- a C++ compiler such as gcc/g++
- cmake
- git
These are very common tools you can find on any flavor of Linux.
Unfortunately, each Linux distribution handles the exact method of installation slightly differently. We will show how to install these using Ubuntu:
sudo apt-get install git-core gcc g++ cmake -y
(for installing these common build tools on other Linux distros, please consult Google).
Next, you have to set up the environment for the plugin manually by editing the appropriate shell resource configuration file.
The first step is to determine which shell you are using; there are two main types: bash and tcsh/csh.
To determine which shell you're using, please type
$ echo $SHELL
if you see /bin/bash - then you are using a bash shell. Otherwise it's tcsh/csh.
This was tested in Ubuntu 10.10
1. Get Field3D
Get the latest Field3D version from Sony Imageworks's github:
You can put the repository anywhere you want. In this guide, it'll be added at ~/field3d.git
git clone https://github.com/imageworks/Field3D.git ~/field3d.git
2. Get HDF5
Go to http://www.hdfgroup.org and download the 64-bit shared Linux version, for example hdf5-1.8.7-linux-shared.tar.gz
Extract it anywhere and add an environment variable:
export HDF5_ROOT=/PATH/TO/HDF5
3. Get OpenEXR
Get it at http://www.openexr.com or
sudo apt-get install libopenexr-dev
Add an environment variable to the OpenEXR include files (for example: /usr/include/OpenEXR)
export OPENEXR_INCLUDE_FILES=/PATH/TO/OPENEXR/INCLUDE/FILES
4. Get boost
sudo apt-get install libboost-dev
5. Get scons
sudo apt-get install scons
6. Build Field3D
Go to the root of where you put the Field3D repository, for example ~/field3d.git.
edit BuildSupport.py
at Line78, change:
arch64 : ["/usr/local64/include" ]}
to
arch64 : ["/usr/local64/include", "/PATH/TO/HDF5/include","/PATH/TO/OPENEXR/INCLUDE/FILES"]}
and at Line 87, change:
arch64 : ["/usr/local64/lib"]}
to
arch64 : ["/usr/local64/lib","/PATH/TO/HDF5/lib"]}
Finally run this cmd:
scons do64=1
You might have to include boost include and lib paths too if this does not work.
Once everything is built, add a Field3D environment variable. If the repository was cloned into ~/field3d.git, this can look like:
export FIELD3D_ROOT=~/field3D.git/install/linux2/m64/release
7. Add Field3D and HDF5 to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FIELD3D_ROOT/lib:$HDF5_ROOT/lib
Done! Now we can build Houdini and Naiad operators!
Please edit the .bashrc configuration file to add the necessary environment variables. The .bashrc configuration file is a text file which is located in your home directory. You can use any text editor (such as gedit) to edit the .bashrc file:
$ gedit ~/.bashrc
Once inside the .bashrc file, please skip to the very end, and add the following lines:
export EM_COMPILER=gcc export CC=gcc export CXX=g++ export EM_PLAT=LINUX export EM_ARCH=`uname -m` export FIELD3D_ROOT=/path/to/where/Field3D/is/installed export HDF5_ROOT=/PATH/TO/HDF5 export OPENEXR_INCLUDE_PATH=/PATH/TO/OPENEXR/INCLUDE/FILES export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FIELD3D_ROOT/lib:$HDF5_ROOT/lib
If you are NOT using a bash shell, you need to edit the .cshrc configuration file, which is located in your home directory. You can use any text editor (such as gedit) to edit the .cshrc file:
$ gedit ~/.cshrc
Once inside the .cshrc file, please skip to the very end, and add the following lines:
setenv EM_COMPILER gcc setenv CC gcc setenv CXX g++ setenv EM_PLAT LINUX setenv EM_ARCH `uname -m` setenv FIELD3D_ROOT=/path/to/where/Field3D/is/installed setenv HDF5_ROOT=/PATH/TO/HDF5 setenv OPENEXR_INCLUDE_PATH=/PATH/TO/OPENEXR/INCLUDE/FILES setenv LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FIELD3D_ROOT/lib:$HDF5_ROOT/lib
Quit the text editor and close the shell. Open a new shell, which should take into account the new variables you've added. You should verify this by typing:
$ echo $NAIAD_PATH
This should print the path to your current Naiad installation.
$ echo $OPENEXR_INCLUDE_PATH
Path to OpenEXR include files.
$ echo $HDF5_ROOT
Path to HDF5 root.
$ echo $FIELD3D_ROOT
That should print the correct path relative to your Field3D installation directory. If it does not, then you've made a mistake.
You need to do this every time a new version of Naiad is released that contains API changes. This is typically semi-major or major releases, such as 1.0 to 1.5 or 2.0, etc.
We assume the following:
- Naiad and Field3D have been installed.
- The environment variable $NAIAD_PATH points to the location of the Naiad installation and $FIELD3D_ROOT points to the location of the Field3D installation.
- You want to keep the field3d-buddy source in your home directory, e.g., in the path /field3d-buddy.git. If you wish to use another location for the source code, then please make the appropriate substitutions in the commands shown below:
First, get a fresh copy of the latest Naiad Buddy for Field3D source code:
rm -rf ~/field3d-buddy.git git clone git://github.com/ExoticMatter/Naiad-Buddy-For-Field3D.git ~/field3d-buddy.git
Now, to compile this buddy, run the following commands:
cd ~/field3d-buddy.git mkdir -p build && cd build cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$NAIAD_PATH ~/field3d-buddy.git make cd .. rm -rf build
1. Get the latest version of Houdini
Download from http://www.sidefx.com/
2. Copy the Field3D Houdini Toolkit sample files
For example:
cp -r /opt/hfs11.1.22/toolkit/samples/field3d ~/ && mv ~/field3d ~/houdini-field3d
3. Build
Enter the dir:
cd ~/houdini-field3d
You might have to get csh before you can compile with hcustom
sudo apt-get install csh
Finally, run this command:
hcustom -L $HDF5_ROOT/lib -L $FIELD3D_ROOT/lib -l hdf5 -l Field3D -I $HDF5_ROOT/include -I $FIELD3D_ROOT/include -I $OPENEXR_INCLUDE_PATH f3dtools.C
If built successfully, remove the dir
rm -rf ~/houdini-field3d
Done!