| 1 |
|
| 2 |
INSTALLATION |
| 3 |
============ |
| 4 |
|
| 5 |
Quick start for Debian/Linux installing libbiosig: |
| 6 |
|
| 7 |
# Compile-Time Requirements |
| 8 |
apt-get install libb64-dev |
| 9 |
optional: |
| 10 |
apt-get install libsuitesparse-dev zlib1g-dev libtinyxml-dev libdcmtk-dev |
| 11 |
|
| 12 |
|
| 13 |
# Runtime requirements |
| 14 |
apt-get install libb64 zlib1g |
| 15 |
optional: |
| 16 |
apt-get install libsuitesparse libtinyxml libdcmtk8 |
| 17 |
|
| 18 |
|
| 19 |
# Installation (for users): |
| 20 |
download source release and run |
| 21 |
|
| 22 |
VER=2.0.2 |
| 23 |
wget https://sourceforge.net/projects/biosig/files/BioSig\ for\ C_C\+\+/src/biosig4c\+\+-$VER.src.tar.gz |
| 24 |
tar xvf biosig4c++-$VER.src.tar.gz |
| 25 |
cd biosig4c++-$VER |
| 26 |
./configure && make && sudo make install |
| 27 |
|
| 28 |
|
| 29 |
# Installation for developers: |
| 30 |
|
| 31 |
## latest development version |
| 32 |
git clone https://git.code.sf.net/p/biosig/code biosig-code |
| 33 |
cd biosig-code |
| 34 |
autoreconf -fi # only needed if autoconf files have been changed |
| 35 |
./configure # only needed if configuration has changed |
| 36 |
make && sudo make install |
| 37 |
|
| 38 |
## or if |
| 39 |
git pull |
| 40 |
make distclean |
| 41 |
autoreconf -fi # only needed if autoconf files have been changed |
| 42 |
./configure # only needed if configuration has changed |
| 43 |
make && sudo make install |
| 44 |
|
| 45 |
|
| 46 |
# compiling of mexbiosig for Matlab and Octave |
| 47 |
MATLABDIR=/usr/local/MATLAB/R20##x/bin make mex4m |
| 48 |
make mex4o |
| 49 |
|
| 50 |
# generating an octave package |
| 51 |
make mexbiosig |
| 52 |
start octave and run |
| 53 |
pkg install mex/mexbiosig-X.Y.Z.src.tar.gz |
| 54 |
|
| 55 |
If libbiosig is available on your OS, you can also start octave and run |
| 56 |
pkg install https://pub.ist.ac.at/~schloegl/biosig/prereleases/mexbiosig-1.9.2.src.tar.gz |
| 57 |
|
| 58 |
# Compiling for python |
| 59 |
make python |
| 60 |
|
| 61 |
# Compiling save2gdf and biosig_fhir |
| 62 |
make tools |
| 63 |
sudo make install_tools |
| 64 |
|
| 65 |
# Monitoring of flow sensor |
| 66 |
./flowmon2 -d `ls /dev/ttyUSB*` |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
### The information below might be outdated - it's not removed yet because it might still contain some useful hints ### |
| 71 |
|
| 72 |
|
| 73 |
General remarks: |
| 74 |
---------------- |
| 75 |
|
| 76 |
Prerequisites: |
| 77 |
-------------- |
| 78 |
P0) gnu c compiler (gcc, g++, gnu make, gawk). It will work on unix like systems (Linux, BSD, etc) |
| 79 |
mingw, cygwin. |
| 80 |
and NO, MSVC is not suitable for compiling libbiosig !!! |
| 81 |
|
| 82 |
P1) for building libbiosig, save2gdf, mma (mathematica) and mex (matlab) |
| 83 |
sudo apt-get install subversion libz-dev libsuitesparse-dev libcurl-dev gawk g++ gcc |
| 84 |
svn co https://biosig.svn.sourceforge.net/svnroot/biosig/trunk/biosig4c++ |
| 85 |
|
| 86 |
For ttl2trig, also the package |
| 87 |
libasound-dev |
| 88 |
is required. |
| 89 |
|
| 90 |
P2) for building SigViewer |
| 91 |
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-qt3support |
| 92 |
svn co https://sigviewer.svn.sourceforge.net/svnroot/sigviewer/trunk sigviewer |
| 93 |
|
| 94 |
|
| 95 |
P3) Cross-compilation on Linux for Win32/Win64-target: |
| 96 |
aptitude install -R autoconf automake bash bison bzip2 \ |
| 97 |
cmake flex g++ intltool make sed \ |
| 98 |
libtool openssl libssl-dev \ |
| 99 |
libxml-parser-perl patch perl \ |
| 100 |
pkg-config scons unzip wget \ |
| 101 |
xz-utils yasm mercurial |
| 102 |
git clone https://github.com/schloegl/mxe.git |
| 103 |
cd mxe |
| 104 |
make biosig stimfit |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
Platform specific information |
| 110 |
----------------------------- |
| 111 |
# Linux |
| 112 |
You need GNU gcc, g++ (ver>4.0), make, zlib (if you do not have zlib, do not define WITH_ZLIB), |
| 113 |
libsuitesparse (if you do not have libsuitesparse, do not define WITH_CHOLMOD). |
| 114 |
|
| 115 |
Running make compiles the converter. |
| 116 |
make # makes the file format converter |
| 117 |
make save2gdf # makes the file format converter |
| 118 |
make win32 # makes the file format converter for Win32 |
| 119 |
make win64 # makes the file format converter for Win64 |
| 120 |
make physicalunits # makes the en/decoder for physical units |
| 121 |
make lib # makes library |
| 122 |
make mex4o # makes mexSLOAD for Octave (requires Octave-headers2.9 or higher) |
| 123 |
make mex4m # makes mexSLOAD for Matlab (path_to_mex need to be defined in Makefile) |
| 124 |
make biosig4python # compiles the BioSig interface for Python (requires SWIG and Python) |
| 125 |
make all # all of the above |
| 126 |
make sigviewer # recompiles SigViewer (requires qmake and Qt, the sources of sigviewer must be in ../sigviewer) |
| 127 |
make testscp |
| 128 |
make testhl7 |
| 129 |
make test # tests HL7<->SCP, SCP<->GDF, GDF<->HL7 converters |
| 130 |
make test6 # tests bidirectional conversion between 6 differerent data formats |
| 131 |
|
| 132 |
# Mac OS X (tested under 10.7 Lion) |
| 133 |
1. First, get Xcode from the App Store. You need to create an Apple Developer Account (which is free) to install the command line tools (see next step). |
| 134 |
2. In Xcode, go to Preferences - Downloads - Components - Install Command Line Tools. |
| 135 |
3. Install MacPorts from http://www.macports.org/. |
| 136 |
4. In a terminal, type "sudo port install gawk". |
| 137 |
5. In a terminal, type "sudo port install SuiteSparse". |
| 138 |
|
| 139 |
Optional (if you want a good IDE, this is recommended): |
| 140 |
6. Install Eclipse from http://www.eclipse.org/. |
| 141 |
7. Install CDT (in Eclipse, go to Help - Install New Software...). |
| 142 |
Activate the CDT repository by clicking on "Available Software Sites" and activate "CDT Juno". |
| 143 |
After clicking OK, select "-- All Available Sites --" and install "CDT Main Features". |
| 144 |
8. In Eclipse, go to Preferences - C/C++ - Build - Environment - Add... |
| 145 |
Enter PATH in the Name text box and /opt/local/bin:/opt/local/sbin in the Value text box. |
| 146 |
9. To load the project, go to File - New - Makefile Project with Existing Code. |
| 147 |
Fill in the name of the project (for example, biosig4c++) and enter the root folder containing the source code of biosig4c++. |
| 148 |
10. In the Project Explorer, you can now right-click on the project and choose Clean or Build to start compiling the project. |
| 149 |
|
| 150 |
|
| 151 |
# MinGW Crosscompiler on Debian/Ubuntu for Windows |
| 152 |
- aptitude install mingw32 mingw32-binutils mingw32-runtime |
| 153 |
|
| 154 |
# mxe/mce-w64 on GNU/Linux for Windows |
| 155 |
Prerequisites P3) and/or P4) (see above) |
| 156 |
- modify Makefile and set variable CROSS for Win32 (and CROSS64 for Win64) to the proper value e.g. |
| 157 |
CROSS = $(HOME)/src/mxe/usr/bin/i686-pc-mingw32 |
| 158 |
CROSS64 = $(HOME)/src/mce-w64/usr/bin/x86_64-w64-mingw32 |
| 159 |
|
| 160 |
- run the command |
| 161 |
make win32/save2gdf.exe # converter between data formats |
| 162 |
make win32/libbiosig.dll # dynamic library |
| 163 |
make win32/libbiosig.a # static library |
| 164 |
make win32mma # Win32/Mathematica interface |
| 165 |
make mexw32 # Win32/Matlab mex interface |
| 166 |
make win32 # all of the above |
| 167 |
make win64/save2gdf.exe # converter between data formats 64bit Windows |
| 168 |
make mexw64 # Win64/Matlab mex interface |
| 169 |
|
| 170 |
# Windows + MinGW |
| 171 |
Prerequisites P5) (see above) |
| 172 |
Support for FEF, ZLIB, CHOLMOD is turned off, because of lack of support in MinGW. |
| 173 |
In general, Makefile.win32 should be used. |
| 174 |
- Run the make command |
| 175 |
make -f Makefile.win32 libbiosig.a |
| 176 |
make -f Makefile.win32 save2gdf.exe |
| 177 |
make -f Makefile.win32 sigviewer |
| 178 |
make -C mma -f Makefile.win32 sload.exe # mathematica interface |
| 179 |
|
| 180 |
You can also start compilation of sigviewer. |
| 181 |
First, you need to have the sigviewer sources in ..\sigviewer and |
| 182 |
Then, you need to run once qmake in ..\sigviewer\src\ |
| 183 |
make -f Makefile.win32 sigviewer |
| 184 |
|
| 185 |
# Matlab/Win32 using MinGW on Windows |
| 186 |
do the steps in "Windows+MinGW" |
| 187 |
install and configure gnumex (from http://gnumex.sf.net) |
| 188 |
make libbiosig.a |
| 189 |
start matlab |
| 190 |
>> gnumex % configure mingw for mex |
| 191 |
>> mex mexSLOAD.cpp libbiosig \mingw\lib\libws2_32.a |
| 192 |
|
| 193 |
# Mathematica/Win32 using MinGW on Windows |
| 194 |
Adapt user-specified variables (directory names) in Makefile.win32 and mma/Makefile.win32 |
| 195 |
cd biosig4c++/mma |
| 196 |
make -f Makefile.win32 sload.exe |
| 197 |
|
| 198 |
# Windows + Cygwin |
| 199 |
Currently, only the file converter save2gdf is supported. |
| 200 |
- install Cygwin |
| 201 |
- within Cygwin install gcc4 g++4, zlib, suitesparse/cholmod and make |
| 202 |
- run the make command |
| 203 |
make save2gdf |
| 204 |
|
| 205 |
# MSVC - Microsoft Visual C++ |
| 206 |
MSVC is currently not supported. You are on your own. |
| 207 |
|
| 208 |
# Other platforms (Windows+MSVC, MacOSX, Solaris, etc. ) |
| 209 |
some tests on other Unix-like systems have been successful. |
| 210 |
|
| 211 |
|
| 212 |
Installation: |
| 213 |
------------- |
| 214 |
run as root |
| 215 |
make |
| 216 |
make install # installs save2gdf, save2scp, save2aecg, |
| 217 |
make install_octave # installs mexSLOAD.mex in /usr/local/share/octave/site-m/ |
| 218 |
make install_sigviewer # installs sigviewer |
| 219 |
|
| 220 |
|
| 221 |
Execution: |
| 222 |
---------- |
| 223 |
# if test.gdf exists, some header information is displayed |
| 224 |
save2gdf test.gdf |
| 225 |
|
| 226 |
# help and usage information |
| 227 |
save2gdf -h |
| 228 |
|
| 229 |
# converts a data file into a GDF format (destination |
| 230 |
save2gdf PFE103.scp t5.gdf |
| 231 |
|
| 232 |
# converts a data file into a SCP format (destination |
| 233 |
save2scp t5.gdf t5.scp |
| 234 |
save2gdf -f=SCP t5.gdf t5.scp |
| 235 |
|
| 236 |
# converts a data file into a HL7aECG format (destination |
| 237 |
save2aecg t5.gdf t5.hl7 |
| 238 |
save2gdf -f=HL7aECG t5.gdf t5.hl7 |
| 239 |
|
| 240 |
# load matlab into octave or matlab |
| 241 |
start octave or matlab |
| 242 |
addpath path_to_mexSLOAD.mex |
| 243 |
[data,HDR] = mexSLOAD(filename); % loads data and header information |
| 244 |
|
| 245 |
|
| 246 |
Development & Testing: |
| 247 |
---------------------- |
| 248 |
There are several testing functions included. |
| 249 |
The following commands test the converter and should finish without errors. |
| 250 |
make test |
| 251 |
make testhl7 |
| 252 |
make testscp |
| 253 |
make test6 |
| 254 |
|
| 255 |
The Octave/Matlab script |
| 256 |
test0/test01.m |
| 257 |
tests whether the various data formats give the same results |
| 258 |
or whether some conversion error has been included. |
| 259 |
|
| 260 |
|
| 261 |
Copyright (C) 2005-2013, Alois Schloegl <[email protected]> |
| 262 |
This function is part of the "BioSig for C/C++" repository |
| 263 |
(BioSig4C++) at http://biosig.sf.net/ |
| 264 |
|