Difference between revisions of "MNE CPP on Neuromag Linux"
(Created page with "<pre style="color: red"> Warning: You should know what you are doing and be familiar with the Neuromag system! </pre> == Pre-Requisites == === Qt 5 === ./configure -no-x...") |
|||
Line 6: | Line 6: | ||
=== Qt 5 === | === Qt 5 === | ||
− | + | <source lang=cpp> | |
− | + | ./configure -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-glib -no-gui -no-widgets -no-opengl -no-openssl -opensource -nomake examples -prefix /home/neuromag/RT_MNE_CPP/Qt/Qt5.3.0 | |
+ | make | ||
+ | </source> | ||
It's likely that following error occurs: | It's likely that following error occurs: | ||
Line 14: | Line 16: | ||
You can fix this error by replacing following line in src/corelib/thread/qmutex_linux.cpp | You can fix this error by replacing following line in src/corelib/thread/qmutex_linux.cpp | ||
− | + | <source lang=cpp> | |
+ | # include <linux/futex.h> | ||
+ | </source> | ||
with | with | ||
− | + | <source lang=cpp> | |
− | + | # define FUTEX_WAIT 0 | |
+ | # define FUTEX_WAKE 1 | ||
+ | </source> | ||
You can ignore further Qt5 build errors. Since only qmake and the most important libraries are needed. | You can ignore further Qt5 build errors. Since only qmake and the most important libraries are needed. | ||
Finish the installation with: | Finish the installation with: | ||
− | + | <source lang=cpp> | |
+ | make install | ||
+ | </source> | ||
=== MNE-CPP === | === MNE-CPP === | ||
Line 31: | Line 39: | ||
Edit _mne-cpp.pri_ by commenting _withGui_ out: | Edit _mne-cpp.pri_ by commenting _withGui_ out: | ||
− | + | <source lang=cpp> | |
+ | #MNECPP_CONFIG += withGui | ||
+ | </source> | ||
run: | run: | ||
− | + | ||
− | + | <source lang=cpp> | |
+ | qmake -r | ||
+ | make | ||
+ | </source> | ||
==== Edit .bashrc ==== | ==== Edit .bashrc ==== | ||
After you compiled mne-cpp succesfully edit your .bashrc to make the shared libraries globally available: | After you compiled mne-cpp succesfully edit your .bashrc to make the shared libraries globally available: | ||
− | + | <source lang=cpp> | |
− | + | # | |
− | + | # Qt | |
− | + | # | |
− | + | export QT_HOME=/home/neuromag/RT_MNE_CPP/Qt/Qt5.3.0 | |
− | + | if [[ $QT_HOME && ${QT_HOME-_} ]]; then | |
− | + | PATH=$PATH:$QT_HOME/bin | |
− | + | if [[ $LD_LIBRARY_PATH && ${LD_LIBRARY_PATH-_} ]]; then | |
− | + | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QT_HOME/lib | |
− | + | else | |
− | + | export LD_LIBRARY_PATH=$QT_HOME/lib | |
fi | fi | ||
+ | fi | ||
− | + | # | |
− | + | # MNE-CPP | |
− | + | # | |
− | + | export MNE_CPP=/home/neuromag/RT_MNE_CPP/Git_Repos/mne-cpp | |
− | + | if [[ $MNE_CPP && ${MNE_CPP-_} ]]; then | |
− | + | PATH=$PATH:$MNE_CPP/bin | |
− | + | if [[ $LD_LIBRARY_PATH && ${LD_LIBRARY_PATH-_} ]]; then | |
− | + | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MNE_CPP/lib | |
− | + | else | |
− | + | export LD_LIBRARY_PATH=$MNE_CPP/lib | |
− | + | ||
fi | fi | ||
+ | fi | ||
+ | </source> | ||
==== Firewall Configuration ==== | ==== Firewall Configuration ==== | ||
Open port 4217 & 4218 and add allowed clients by editing /etc/sysconfig/iptables. Insert the following: | Open port 4217 & 4218 and add allowed clients by editing /etc/sysconfig/iptables. Insert the following: | ||
− | + | <source lang=cpp> | |
− | + | -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4217 -j ACCEPT | |
− | + | -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4218 -j ACCEPT | |
− | + | -A RH-Firewall-1-INPUT -s ip.of.your.client -m tcp -p tcp --dport 4217 -j ACCEPT | |
+ | -A RH-Firewall-1-INPUT -s ip.of.your.client -m tcp -p tcp --dport 4218 -j ACCEPT | ||
+ | </source> | ||
=== run _mne_rt_server_ === | === run _mne_rt_server_ === | ||
Line 80: | Line 97: | ||
=== The collectors === | === The collectors === | ||
You can use telnet to monitor the interaction of _mne_rt_server_ with the neuromag machine: | You can use telnet to monitor the interaction of _mne_rt_server_ with the neuromag machine: | ||
− | + | Therefore connect to the collectors running on the real-time computers: | |
− | + | <source lang=cpp> | |
+ | telnet megacq collector | ||
+ | </source> | ||
or | or | ||
− | + | <source lang=cpp> | |
+ | telnet ip.of.megacq 11122 | ||
+ | </source> | ||
Authorize your self: | Authorize your self: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | PASS *** | ||
+ | </source> | ||
Check the status by typing (They should be setup but not measuring. If this is not the case run a simple dummy project using the neuromag acqusition software, afterwards they will be setup.): | Check the status by typing (They should be setup but not measuring. If this is not the case run a simple dummy project using the neuromag acqusition software, afterwards they will be setup.): | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | STAT | ||
+ | </source> | ||
Check the values of the variables by typing: | Check the values of the variables by typing: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | VARS | ||
+ | </source> | ||
Save the variables in a text file and make sure that they are the same after you have finished (your colleagues will appreciate this) | Save the variables in a text file and make sure that they are the same after you have finished (your colleagues will appreciate this) | ||
You can change variable names by typing | You can change variable names by typing | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | VARA ``<var> = <value>`` | ||
+ | </source> | ||
Switch on the monitoring to follow all interactions with the real-time computers: | Switch on the monitoring to follow all interactions with the real-time computers: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | MONI ON | ||
+ | </source> | ||
You can start the acqusition manually with: | You can start the acqusition manually with: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | MEAS | ||
+ | </source> | ||
And stopping it again with: | And stopping it again with: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | STOP | ||
+ | </source> | ||
All available commands you'll find by typing: | All available commands you'll find by typing: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | HELP | ||
+ | </source> | ||
You can leave the collectors by typing: | You can leave the collectors by typing: | ||
− | + | ||
+ | <source lang=cpp> | ||
+ | QUIT | ||
+ | </source> | ||
=== Neuromag Acqusition === | === Neuromag Acqusition === | ||
It's recommended to start the Neuromag Acquisition program. The software will be remotely controlled by MNE-X since the collectors mirror the instructions received. You can use the Neuromag data display to check your MNE-X measurements. | It's recommended to start the Neuromag Acquisition program. The software will be remotely controlled by MNE-X since the collectors mirror the instructions received. You can use the Neuromag data display to check your MNE-X measurements. |
Revision as of 17:29, 21 January 2016
Warning: You should know what you are doing and be familiar with the Neuromag system!
Contents
Pre-Requisites
Qt 5
./configure -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-glib -no-gui -no-widgets -no-opengl -no-openssl -opensource -nomake examples -prefix /home/neuromag/RT_MNE_CPP/Qt/Qt5.3.0 make
It's likely that following error occurs: Futex Error (RHEL 5.1 with gcc 4.1.2 compiler)
You can fix this error by replacing following line in src/corelib/thread/qmutex_linux.cpp
# include <linux/futex.h>
with
# define FUTEX_WAIT 0 # define FUTEX_WAKE 1
You can ignore further Qt5 build errors. Since only qmake and the most important libraries are needed. Finish the installation with:
make install
MNE-CPP
Download MNE-CPP
Edit _mne-cpp.pri_ by commenting _withGui_ out:
#MNECPP_CONFIG += withGui
run:
qmake -r
make
Edit .bashrc
After you compiled mne-cpp succesfully edit your .bashrc to make the shared libraries globally available:
# # Qt # export QT_HOME=/home/neuromag/RT_MNE_CPP/Qt/Qt5.3.0 if [[ $QT_HOME && ${QT_HOME-_} ]]; then PATH=$PATH:$QT_HOME/bin if [[ $LD_LIBRARY_PATH && ${LD_LIBRARY_PATH-_} ]]; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QT_HOME/lib else export LD_LIBRARY_PATH=$QT_HOME/lib fi fi # # MNE-CPP # export MNE_CPP=/home/neuromag/RT_MNE_CPP/Git_Repos/mne-cpp if [[ $MNE_CPP && ${MNE_CPP-_} ]]; then PATH=$PATH:$MNE_CPP/bin if [[ $LD_LIBRARY_PATH && ${LD_LIBRARY_PATH-_} ]]; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MNE_CPP/lib else export LD_LIBRARY_PATH=$MNE_CPP/lib fi fi
Firewall Configuration
Open port 4217 & 4218 and add allowed clients by editing /etc/sysconfig/iptables. Insert the following:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4217 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4218 -j ACCEPT -A RH-Firewall-1-INPUT -s ip.of.your.client -m tcp -p tcp --dport 4217 -j ACCEPT -A RH-Firewall-1-INPUT -s ip.of.your.client -m tcp -p tcp --dport 4218 -j ACCEPT
run _mne_rt_server_
If all previous steps were successfully processed you are now able to run _mne_rt_server_ - well done :)!
Hints
The collectors
You can use telnet to monitor the interaction of _mne_rt_server_ with the neuromag machine: Therefore connect to the collectors running on the real-time computers:
telnet megacq collector
or
telnet ip.of.megacq 11122
Authorize your self:
PASS ***
Check the status by typing (They should be setup but not measuring. If this is not the case run a simple dummy project using the neuromag acqusition software, afterwards they will be setup.):
STAT
Check the values of the variables by typing:
VARS
Save the variables in a text file and make sure that they are the same after you have finished (your colleagues will appreciate this)
You can change variable names by typing
VARA ``<var> = <value>``
Switch on the monitoring to follow all interactions with the real-time computers:
MONI ON
You can start the acqusition manually with:
MEAS
And stopping it again with:
STOP
All available commands you'll find by typing:
HELP
You can leave the collectors by typing:
QUIT
Neuromag Acqusition
It's recommended to start the Neuromag Acquisition program. The software will be remotely controlled by MNE-X since the collectors mirror the instructions received. You can use the Neuromag data display to check your MNE-X measurements.