The external installations can, in principle, be installed wherever you like.
OpendTect 4.2 is build with Visual Studio 8( 2005 ). Although we're using a commercial version, the Visual Studio Express edition, should also get you started. Make sure you have installed the latest updates from Microsoft.
Visual Studio comes with it's own editor. For real coding, vim is still superiour and is our preferred editor. The Windows version can be downloaded from: http://www.vim.org/
A full Coin installation is only necessary when you want to build a plugin which is directly dependend on Coin. Download Windows Coin, SoQt and SIMVoleon packages from Coin website . Or get the source code from Mercurial repositories and build yourself using Visual Studio. Check this link for more details
Before you can build anything, you have to setup a work directory (usually called 'ODWork'). The easiest way to do this is from within OpendTect, menu 'Utilities-Tools-Create Devel Env', but make sure you have downloaded and installed the developer package in the same location where OpendTect is already installed. Note that the OpendTect application window will freeze while the development environment is created. The developer package could also be installed right in to the ODWork folder, in that case the ODWork immediatly becomes the "WORK" directory and you won't have to use OpendTect ->menu -> 'Utilities-Tools-Create Devel Env'
Now you will have to setup at least one environment variable, i.e. WORK, and also OD_COINDIR for Coin and OD_QTDIR for Qt if needed. An easy method has been devised to setup all the environment variables through batch file instead of going through the 'My Computer' which is a bit cumbersome. Inside the msvc8 folder there is a batch file named odvars_example.bat, this file is just an example of adding environment variables with batch file. All you have to do is create another batch file at the same location and rename it to "odvars.bat" and copy the contents of the odvars_example.bat file in to it and edit the paths according to your local settings, now double-click on start_msvc_od.bat file, which is already there, this will load the OpendTect solution in Visual Studio IDE using the variables from the odvars.bar file. So now you are ready to work. This is only one time work and no need to do it every time you use start_msvc_od.bat to start OpendTect solution. The other method is Right-click on 'My Computer', select Properties, Advanced tab and click on the button 'Environment variables'. Add a new variable WORK and set its value to the directory created by the 'Create Devel Env' i.e. the fullpath of the "ODWork . If you're using Qt and/or Coin, you'll have to set OD_QTDIR and OD_COINDIR likewise.
After you setup your environment, goto the plugins\msvc8 folder and open the Tutorial solution. When openened, build the solution from the Build menu, the toolbar, or the Solution right-click menu.
The libraries should now be ready in $WORK\plugins\msvc8\Win32|x64\debug|release.
You can test your newly compiled plugins by loading them using the Utilities-plugins menu in OpendTect. For example, if you load the "Hello.dll" plugin, you should see "Hello World" on the OpendTect console window. Notes:
'Installing' a plugin would be making the plugin auto-load at OpendTect startup. Basically, this is done by copying the plugin to the correct plugin subdirectory in either your personal '.od' settings directory or in the program installation directory. After that, you need to create a new ".alo" file, or add the plugin to an existing ".alo" file. The procedure is the same on Unix and Windows, so please consult the plugins auto-load and installation documentation for more details.
There are a few remarks about the location of your personal directory on windows though. Your 'Personal directory' is located at $HOME if this is defined, which is normally taken care of by the cygwin tcsh shell. Otherwise, the location of $USERPROFILE or eventually $APPDATA is used. This takes place in the "bin/init_dtect_user" script, which sets the environment variable "DTECT_SETTINGS" which on its turn is used internally in OpendTect, unless overridden by "DTECT_WINSETTINGS"
If you want your personal '.od' settings directory to be somewhere else, you can set the "DTECT_WINHOME" and or the "DTECT_WINSETTINGS" environment variable. The first overrides $HOME and thus also specifies a new location for the '.od' settings directory; the latter specifies the '.od' directory itself -- you should even be able to give it another name, although this is not recommended.
You can set environment variables using "My Computer - properties - advanced - Environment Variables", but you can also edit the start_dtect.bat file or a copy of it.
The distribution of plugins is basically the same for Unix and
windows. Just copy the .alo files into the plugins/platform directory
($DTECT_APPL/plugins/$HDIR, default C:\Program
Files\OpendTect\plugins\win on windows) and copy the actual
plugins into the libs subdirectory.
In order to do this, we use .tar.gz files on Unix and inno-setup on windows, which can be obtained for free at: jrsoftware.org.
Because we internally treat Windows as much like Unix as we can, we actually make a .tar.gz file for our windows plugins too, which is extracted to "d:\users\admin\rel\plugins\opendtect-4.x.y\", which forms the "Source" for Inno-Setup.
As an example, here is the Inno-setup file "dgbsetup.iss" that we use for our own dgb plugins. Note that the OpendTect installation directory is stored in the registry and used as 'DefaultDirName':
[Setup]
AppName=OpendTect
AppVerName=OpendTect 4.x.y
AppPublisher=De Groot-Bril Earth Sciences
AppPublisherURL=http://www.opendtect.org
AppSupportURL=http://www.opendtect.org
AppUpdatesURL=http://www.opendtect.org
DefaultDirName={reg:HKLM\OpendTect\Base\Settings,Path|{pf}\OpendTect}
DisableDirPage=yes
DefaultGroupName=OpendTect
AllowNoIcons=yes
OutputBaseFilename=myplugin-opendtect-4.x.y
LicenseFile=d:\users\admin\rel\opendtect-4.x.y\LICENSE.txt
[Files]
Source: d:\users\admin\rel\plugins\opendtect-4.x.y\*; DestDir: {app}; Flags: recursesubdirs
OpendTect solution and OpendTect plugins solution can be found in $WORK\msvc8. From these solutions it should be quite easy to build OpendTect from scratch. Note that it requires an installation of Qt and Coin. The currently used versions can be found in: $DTECT_APPL\doc\ReleaseInfo\RELEASEINFO.txt