|
| 1 | +1. Introduction |
| 2 | +====================================================================== |
| 3 | + |
| 4 | +Their are two versions of the plugin. |
| 5 | + |
| 6 | + * the GMS-2.X version, which is build using Visual Studio 2008 |
| 7 | + and obviously requires the DMSDK for GMS 2.X |
| 8 | + |
| 9 | + * the GMS-1.X version, which is build using Visual Studio 2003 |
| 10 | + and obviously requires the DMSDK for GMS 1.X (aka DMSDK382) |
| 11 | + |
| 12 | +For the DMSDKs contact Gatan or look on their website www.gatan.com. |
| 13 | + |
| 14 | +2. Prerequisites |
| 15 | +====================================================================== |
| 16 | + |
| 17 | +The DMSDK must running work (examples will compile), so any prerequisites |
| 18 | +for the DMSDK (e.g. boost) must be properly installed. |
| 19 | + |
| 20 | +The plugin depends on some 3rdparty libraries (for example the HDF5 library...). |
| 21 | +These must be separately downloaded and unpacked or linked to the directory |
| 22 | +names mentioned below |
| 23 | + |
| 24 | +Required libraries: |
| 25 | + utfcpp |
| 26 | + * see http://utfcpp.sourceforge.net |
| 27 | + * version 2.3.1A was used for building the plugin |
| 28 | + * unpack to 3rdparty/utfcpp |
| 29 | + |
| 30 | + zlib |
| 31 | + * see http://zlib.org |
| 32 | + * version 1.2.8 was used for building the plugin |
| 33 | + * unpack to 3rdparty/zlib |
| 34 | + |
| 35 | + szip |
| 36 | + * see http://www.hdfgroup.org/HDF5 |
| 37 | + * version version 2.1 was used for building the plugin |
| 38 | + * unpack to 3rdparty/szip |
| 39 | + * As there are special licensing issues with this library, the |
| 40 | + compression is disabled by the build instructions below. The |
| 41 | + decompression has no licensing problems. |
| 42 | + |
| 43 | + hdf5 |
| 44 | + * see http//www.hdfgroup.org/HDF5 |
| 45 | + * Version 1.8.8 was used for the GMS-2.X plugin |
| 46 | + * Version 1.8.3 was used for the GMS-1.X plugin, due to the needed |
| 47 | + VS2003 support) |
| 48 | + * unpack to 3rdparty/hdf5 |
| 49 | + |
| 50 | +3. Building |
| 51 | +====================================================================== |
| 52 | + |
| 53 | + 3.1 Build zlib |
| 54 | + -------------------------------------------------------------- |
| 55 | + |
| 56 | + This can be done from the Visual Studio command prompt. Go to the |
| 57 | + 3rdparty/zlib directory and execute either |
| 58 | + nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj" |
| 59 | + or |
| 60 | + nmake -f win32/Makefile.msc |
| 61 | + |
| 62 | + 3.2 Build szip |
| 63 | + -------------------------------------------------------------- |
| 64 | + |
| 65 | + For GMS-1.X: |
| 66 | + * Copy the vc2003/szip_static_vs2003.vcproj file to 3rdparty/szip/window/static |
| 67 | + * Open the 3rdparty/szip/windows/static/szip_static_vs2003.vcproj in Visual Studio 2003. |
| 68 | + |
| 69 | + For GMS-2.X: |
| 70 | + * Open the 3rdparty/szip/windows/static/szip_static.vcproj in Visual Studio 2008. |
| 71 | + |
| 72 | + The following steps are for both versions: |
| 73 | + * Remove line "#define HAVE_ENCODING" in SZconfig.h |
| 74 | + * Build the Release build |
| 75 | + |
| 76 | + 3.3 Build hdf5 |
| 77 | + -------------------------------------------------------------- |
| 78 | + |
| 79 | + * Set up environment variables |
| 80 | + HDF5_EXT_ZLIB=YOURDIR\3rdparty\zlib\zlib.lib |
| 81 | + HDF5_EXT_SZIB=YOURDIR\3rdparty\szib\windows\static\lib\Win32\Release\libszip.lib |
| 82 | + * Call windows\copy_hdf.bat |
| 83 | + * For GMS-1.X: Open windows_vnet\proj\all\all.sln with Visual Studio 2003 |
| 84 | + For GMS-2.X: Open windows\proj\all\all.sln with Visual Studio 2008 |
| 85 | + * In Visual Studio add to the include directories (in Tools/Options/Projects and Solutions/VC++ Directories) |
| 86 | + 3rdparty\zlib |
| 87 | + 3rdparty\szib\src |
| 88 | + * IMPORTANT: In the "Release" configuration of the projects hdf5 set the Runtime Library (under |
| 89 | + C/C++/Code Generation) to Multi-threaded DLL (/MD). |
| 90 | + * Build the hdf5 project (Release build). |
| 91 | + |
| 92 | + 3.4 Build the plugin |
| 93 | + -------------------------------------------------------------- |
| 94 | + |
| 95 | + GMS-2.X: |
| 96 | + * Open vc2008/hdf5_plugin.vcproj with Visual Studio 2008 |
| 97 | + * Add your DMSDK include and library directories to the VC++ Directories |
| 98 | + in Visual Studio (in Tools/Options/Projects and Solutions/VC++ Directories). The |
| 99 | + DMSDK is usally installed to C:\ProgramData\Gatan\DMSDK |
| 100 | + * Build the Release build |
| 101 | + * You should find your plugin as vc2008/Release/hdf5_plugin.dll |
| 102 | + |
| 103 | + GMS-1.X: |
| 104 | + * Open vc2003/hdf5_plugin.vcproj with Visual Studio 2003 |
| 105 | + * Add your DMSDK include and library directories to the VC++ Directories |
| 106 | + in Visual Studio (in Tools/Options/Projects/VC++ Directories). |
| 107 | + * Build the Release build |
| 108 | + * You should find your plugin as vc2003/Release/hdf5_GMS1X_x86.dll |
| 109 | + |
| 110 | + 3.5 Building the documentation |
| 111 | + -------------------------------------------------------------- |
| 112 | + |
| 113 | + The documentation requires the Sphinx Python tool (www.sphinx-doc.org). |
| 114 | + With Sphinx/Python properly installed, simply change into the doc |
| 115 | + directory and execute |
| 116 | + make WHATEVER |
| 117 | + to produce the documentation in the desired format. Call make |
| 118 | + without an argument to see a list of possible formats. |
| 119 | + |
| 120 | + Tested with Sphinx version 1.3 |
| 121 | + |
| 122 | +4. Testing |
| 123 | +====================================================================== |
| 124 | + |
| 125 | +To run the tests, the unittest.s (in tests/unittest) script must be installed in DigitalMicrograph. |
| 126 | +Follow the instruction accompanied with the script for installation. |
| 127 | + |
| 128 | +The tests access some test data files, which are also in the tests directory. In order to |
| 129 | +know that directory under DigitalMicrograph the tests must be immediately run after loading |
| 130 | +them into DigitalMicrograph. Otherwise the directory may not be discoverable anymore. |
| 131 | + |
| 132 | +The tests are designed to succeed under GMS-2.X. Under GMS-1.X some magic numbers and functionality |
| 133 | +is different. To run change the arguments of the following calls |
| 134 | + |
| 135 | + # Current directory |
| 136 | + GMS-2.X: GetApplicationDirectory(0, 0) |
| 137 | + GMS-1.X: GetApplicationDirectory(2, 0) |
| 138 | + |
| 139 | + # Temporary directory |
| 140 | + GMS-2.X: GetApplicationDirectory(6, 0) |
| 141 | + GMS-1.X: GetApplicationDirectory(3, 0) |
| 142 | + |
| 143 | +A known issue is that the handling of packed complex data is different and currently only works under GMS 2.X. |
| 144 | + |
| 145 | +5. Install |
| 146 | +====================================================================== |
| 147 | + |
| 148 | +The Visual Studio project files are designed to produce different outputs, depending on the |
| 149 | +combination of target GMS version and platform. The plugins produced are: |
| 150 | + |
| 151 | + GMS-1.X (32 bit): vc2008\Release\hdf5_GMS1X_x86.dll |
| 152 | + GMS-2.X (32 bit): vc2008\Release\hdf5_GMS2X_x86.dll |
| 153 | + GMS-2.X (64 bit): vc2008\x64\Release\hdf5_GMS2X_amd64.dll |
| 154 | + |
| 155 | +For installation simply copy the correct DLL file into the plugin directory of your Digital |
| 156 | +Micrograph installation. By default these are: |
| 157 | + |
| 158 | + GMS-2.X: c:\ProgramData\Gatan\Plugins |
| 159 | + GMS-1.X: c:\Program Files\Gatan\DigitalMicrograph\Plugins |
0 commit comments