Building Open Naiad Studio
This page describes how to build Open Naiad Studio from source. The following section lists the prerequisites for this task. Note that changes in the prerequisites are rare, which means that developers seldom need to worry about this more than once. The second section of this page describes the build process. At present, Open Naiad Studio can be built on Linux x86_64 distributions. Support for Windows 7 and Mac OS X is planned for the future.1.0 Prerequisites
First of all, a Linux x86_64
distribution is required. Please check out our support forums
if you are not sure how to configure your system. Additionally, it is important to ensure that up-to-date graphics drivers are installed since Open Naiad Studio uses some advanced OpenGL features. Since you will be compiling and building Open Naiad Studio yourself, you will need the following tools and utilities installed:
- Naiad (see this article for installation guidelines)
- Qt 4.6 (see this article for installation guidelines)
- CMake version 2.6 or higher, check with the command: cmake --version.
- libXt-dev (Xterm development package)
- libgl-dev (OpenGL development package)
- A C++ compiler such as gcc/g++
These are all common tools that can be found on any flavor of Linux x86_64. However, different Linux x86_64 distributions have slightly different ways of installing the above packages. In general, consult installation instructions provided for your distribution. In some cases we have provided more detailed instructions, given in the article links. Once these tools have been installed proceed to the following section, which explains the process of compiling and installing Open Naiad Studio.
2.0 Compiling and Installing Open Naiad Studio
This section describes how to download and build the current version of the Open Naiad Studio source code. Please verify that the prerequisites mentioned in the previous section have been installed before proceeding. The first step is to download the Open Naiad Studio source code to your machine. The following command uses git to fetch the latest version of the source code to a directory (which will be automatically created) called open-naiad-studio-src.gitlocated inside your home directory:
- git clone git://github.com/ExoticMatter/Open-Naiad-Studio.git ~/open-naiad-studio-src.git
Note that the location of the git-repo may change in the future. However, the procedure will remain the same. Next, create a directory to store temporary files used during the build. For instance, the command:
- mkdir ~/open-naiad-studio-src.git/build
creates a directory called build inside the source code directory. While inside /open-naiad-studio-src.git/build, run the command:
- cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$NAIAD_PATH ~/open-naiad-studio-src.git
This creates the files necessary to build Open Naiad Studio in release mode. Note that this assumes that the environment variable $NAIAD_PATH points to the location of the Naiad installation. In order to build Open Naiad Studio in debug mode, just change RELEASE to DEBUG. Importantly, this command has to be run every time changes are made to CMakeLists.txt in order to update the build files. At this point we are ready to build Open Naiad Studio. While still inside /open-naiad-studio-src.git/build, run the command:
to build Open Naiad Studio. Note that the sudo is not required if Naiad is installed somewhere in your home directory. However, by default Naiad is installed under /usr , which required superuser access. The build produces a binary file called nstudio, which is located in:
This is useful, because this path is part of your environment (assuming Naiad was installed correctly). Hence, the newly built nstudio can be run from anywhere in a terminal by just typing:
If you wish to verify which version of Open Naiad Studio this command launches, type:
2.1 Scripted Build
Note that the build procedure described above will over-write the pre-built Open Naiad Studio binary shipped with Naiad. However, reverting to the pre-built version is easy; just reinstall Naiad.
Creating an automatic installation script for Open Naiad Studio is easy, and eliminates the necessity of doing all the build commands manually every time Exotic Matter releases a new version of Open Naiad Studio. Assuming a bash shell, such a script can easily be created using a text editor (such as gedit), like this:
- $ gedit ~/openNaiadStudioInstall_bash
then, inside this text file, add the following lines for the script:
# in case your Naiad installation contains redistributed qt libraries,
# get rid of them, since we'll be using the qt libaries on your local machinesudo
rm $NAIAD_PATH/lib/libQt*# download latest Open Naiad Studio coderm -rf ~/open-naiad-studio-src.gitgit clone
# build Open Naiad Studio
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$NAIAD_PATH ~/open-naiad-studio-src.git
sudo make install
sudo rm -rf build
# clean up (we don't need no stinkin' code anymore)
rm -rf ~/open-naiad-studio-src.git
Once you've saved your script, just make it executable from the shell:
- $ chmod +x ~/openNaiadStudioInstall_bash
And that's it! You're done. Every time you need to install the latest Open Naiad Studio, you just need to run:
- $ ~/openNaiadStudioInstall_bash
Please note that this script simply downloads and builds the newest version of Open Naiad Studio. The source code is thereafter removed. While this is useful for updating your system, developers will most likely prefer to keep the source code to be able to make changes. The script given above could be easily be modified to accomodate such needs.
- Ignore warnings about zlib being hidden by the zlib that came with your Naiad installation. However, if you get an error that looks something like:undefined reference to `compressBound@ZLIB_1.2.0', then you want to ensure that $NAIAD_PATH/lib comes before $LD_LIBRARY_PATH in your shell resource configuration file so that Naiad picks up the zlib that shipped with Naiad.
- If you receive compiler errors when running the script, or the make install command in the shell, please ensure that the $NAIAD_PATH environment variable is correct. You can check it by typing: echo $NAIAD_PATH in a shell, and you should see the correct Naiad installation path appear.
Once you have corrected your paths as shown above, you can just re-run the installation script.