Getting started with OpendTect developmentIntro | Prerequisites | Setup | Building OpendTect
In principle, anyone can build the full OpendTect system from source. Fortunately, OpendTect has a plugin architecture which makes it much easier to start developing. Therefore, this manual will focus on plugin development rather than building the entire OpendTect from scratch. If for some reason you are interested in building the entire OpendTect, follow the instructions for plugin development before going here. Even if you want to build for a completely new platform, the first step would still be to get your environment ready for plugin development.
For both types of development you should have installed a fully functional OpendTect system before you start. Even when you build the entire OpendTect, you'll want to be able to use some of the libraries from the distribution.
MS Windows-based developers should not be here: instead, go to the windows development section.
Before you can start developing, there are a few external programs that need to be installed.
The following programs should be available:
Setting up the environment
CMake is used to build both the entire system as well as plugins.
Setup ODWork dir
First of all, we strongly recommend to have no spaces in the path to your ODWork directory. A good place for your ODWork directory may be your home directory.
As you will need to consult the OpendTect header files all the time, it may be handy to set links to the include directory in the installation, as in:
Building your own plugins
Testing the installation
Your own plugin
To create your very own plugin, we added a directory 'My_Plugin_Name'. Change that directory name to how you want to name your plugin. No spaces please. Example: 'PsychicFreqEst'. You want to get this name in all details now. So:
Now edit both the CMakeLists.txt and psychicfreqest_pi.cc, as in:
CMakelists will need the changed file name, 'psychicfreqest_pi' instead of 'my_plugin_name_pi'. Then go through the psychicfreqest_pi.cc file and change everything appropriate, at least 'My_Plugin_Name' to 'PsychicFreqEst'. Then .. first go back to $WORK to change CMakeLists.txt there, change 'My_Plugin_Name' to 'PsychicFreqEst'. Because you have changed a directory name ... Then run
After that 'global' cmake reconfiguration, you can go to your plugin directory (i.c. plugins/PsychicFreqEst) and do 'make'. Again you can load the plugin (libPsychicFreqEst.so), and a message 'Hello world' should be the result.
To change the implementation, you would want to change some more stuff, like the message. Look in my_first_separate_source.cc and change "Hello world!" to "I sense your frequencies!". And so forth. For useful changes, take a peek at the Tut plugins and the documentation.
Unloading plugins (NOT)
There is no way to un-load a plugin. That means you have to exit OpendTect to test a new version (e.g. after recompile). It's nice to have auto-load in place, therefore (read on). Also interesting may be the usage of the Command Driver.
Installing your plugins
Installing a plugin means: making it auto-loaded. This removes the nuisance of having to load the plugin each time you start OpendTect. On the other hand, when you're still developing you may not want the plugin to be loaded all the time. Anyway, the plugins are installed by linking or copying them to the correct plugin subdirectory in either your personal '.od' settings directory, or in the program installation directory and making a configuration ".alo" file.
Distributing your plugins
The distribution of plugins is basically the same for Unix and windows, see the plugins page.
For distribution to the outside world, you'll need to package your plugins, documentation, etc. into zip files. If you're in the mood for really going public, you'd want to be in the installation manager. Then read the plugins page and then contact support at opendtect.org.
Building from source
If you're really into it, you can build the entire OpendTect from source after you've installed OpendTect and built a plugin. For that, you will have to get hold of a Qt and a OpenSceneGraph source distribution. This is because you'll need the correct header files to go with the libraries.
Qt from Digia is used for the GUI. Use the latest Qt release. We configured with:
You need to install a version of the OpenSceneGraph system.
Now, you can configure cmake. As always, do a 'cmake .', this time in $WORK itself. If configuring succeeds, 'make' should do the trick.