Back to the main page.

Bug 1913 - recompile the ANT libeep mex files on all platforms

Reported 2012-12-22 08:14:00 +0100
Modified 2019-08-10 12:28:42 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Jörn M. Horschig
Depends on:
See also:

Robert Oostenveld - 2012-12-22 08:14:16 +0100

There is now an open source version of the libeep toolbox that works out of the box, so compilation should be doable. Desired are 32 and 64 bit versions for windows, linux and osx.

Robert Oostenveld - 2012-12-22 08:21:41 +0100

I compiled them (and did a quick test, it seems ok) on 64 bit OS X mbp> svn commit Adding eeprobe/AUTHORS Adding eeprobe/LICENSE Adding eeprobe/LICENSE.addendum Sending eeprobe/README Sending eeprobe/read_eep_avr.mexmaci64 Sending eeprobe/read_eep_cnt.mexmaci64 Adding (bin) eeprobe/write_eep_avr.mexmaci64 Adding (bin) eeprobe/write_eep_cnt.mexmaci64 Transmitting file data ........ Committed revision 7253. This was using libeep-3.3.167, which I have now documented in VERSION mbp> svn commit Adding eeprobe/VERSION Transmitting file data . Committed revision 7254.

Robert Oostenveld - 2012-12-22 08:51:47 +0100

On 64 bit linux roboos@dccn-c012> cat /etc/redhat-release CentOS release 6.2 (Final) it was a bit more work to figure out the right options, but the following did it: roboos@dccn-c012> export MATLAB=/opt/matlab2011b/ roboos@dccn-c012> ./configure --prefix=/opt --enable-matlab --enable-shared=no CFLAGS=-fPIC roboos@dccn-c012> make roboos@dccn-c012> ldd mex/matlab/read_eep_cnt.mexa64 => (0x00007ffff61ff000) => not found => not found => not found => /lib64/ (0x00007fe2666c5000) => /usr/lib64/ (0x00007fe2663bf000) => /lib64/ (0x00007fe2661a3000) => /lib64/ (0x00007fe265e01000) /lib64/ (0x0000003df4000000) => /lib64/ (0x00007fe265beb000) Important here (again) is that libeep is not dynamic (shared). I added the newly compiled version to fieldtrip/external, but must admit that I did not test them. roboos@dccn-c012> svn commit Sending eeprobe/README Sending eeprobe/VERSION Sending eeprobe/read_eep_avr.mexa64 Sending eeprobe/read_eep_cnt.mexa64 Adding (bin) eeprobe/write_eep_avr.mexa64 Adding (bin) eeprobe/write_eep_cnt.mexa64 Transmitting file data ...... Committed revision 7255.

Robert Oostenveld - 2012-12-22 08:54:07 +0100

(In reply to comment #2) CFLAGG=-fPIC comes on the same line as the ./configure. Bugzilla broke the line in two.

Robert Oostenveld - 2012-12-22 09:01:04 +0100

I also recompiled them for 32 bit windows on an old Redhat machine with an old MATLAB version. See the README file for details. roboos@mentat001> svn commit Sending eeprobe/README Sending eeprobe/VERSION Sending eeprobe/read_eep_avr.mexglx Sending eeprobe/read_eep_cnt.mexglx Adding (bin) eeprobe/write_eep_avr.mexglx Adding (bin) eeprobe/write_eep_cnt.mexglx Transmitting file data ...... Committed revision 7256. 32-bit OSX and 32/64 bit Windows are still to follow, as I don't have easy access to those machines. Also on windows the compile script may be difficult. Perhaps mingw or cygwin might be needed there.

Robert Oostenveld - 2012-12-22 16:08:57 +0100

I added a test script and data for reading cnt and avr. roboos@dccn-l014> svn commit test_bug1913.m Adding test_bug1913.m Transmitting file data . Committed revision 7257.

Jörn M. Horschig - 2013-01-23 16:36:46 +0100

I got win32 and win64, but I cannot manage to compile them, cause I get these errors: matlab\read_eep_cnt.c(31) : fatal error C1083: Cannot open include file: 'eep/eepmisc.h': No such file or directory Not sure why it does not find that file

Robert Oostenveld - 2013-01-24 17:25:35 +0100

(In reply to comment #6) how are you compiling? With ming32 and ming64?

Diego Lozano Soldevilla - 2013-02-13 14:03:07 +0100

visual studio

Robert Oostenveld - 2013-10-28 14:31:44 +0100

the test script for this is presently causing MATLAB to crash on 64-bit linux

Robert Oostenveld - 2013-11-27 09:19:50 +0100

@Jorn, you are working on this right?

Jörn M. Horschig - 2013-11-27 09:21:32 +0100

yes, I am trying again to overcome all the problems ;)

Jörn M. Horschig - 2013-12-11 16:56:02 +0100

Robert, could you check my mail from last week?

Jörn M. Horschig - 2014-09-03 14:26:28 +0200

My journey to compile this code resulted in a lot of errors. I intended to write a mail to Robert Smies (, but then I discovered that a new version of the libeep toolbox was out, which contained a matlab.m4 file, and a mex.m4. However, I have no clue what to do with m4 files, but it sounds like some automatic way to build the mex-files. I just browsed the internet on this again and found that these files are most likely related to the m4 preprocessor, most likely related to this: I will try to compile using the newest version now and see whether things got easier to handle.

Robert Oostenveld - 2014-09-03 15:18:29 +0200

(In reply to Jörn M. Horschig from comment #13) I think the m4 files are related to the build process, see Similar to a Makefile, but much lower level. I would guess that it uses autoconf/automake, see The result of autoconf is a "configure" script, which in turn can be used to make a "Makefile", which in turn compiles the actual code.

Jörn M. Horschig - 2014-09-03 15:46:42 +0200

ah, so that seems unix related and thus not relevant for my problem (win32/64). then I guess it's time to finally ship off that mail... btw, no luck with the new libeep version, seems even more problematic right now than to compile the older version

Robert Oostenveld - 2014-11-19 15:39:51 +0100

On 19 Nov 2014, at 15:44, Martijn Vlaar wrote to Robert: Wij hebben kort geleden een update van ASAlab gehad. In deze versie is het bestandsformaat waarin opgeslagen wordt (cnt) iets aangepast zodat ook bestanden groter dan 2GB mogelijk zijn. De opgenomen bestanden kunnen we echter niet met FieldTrip openen: read_eep_cnt(cntFile,1,1) Error using read_eep_cnt Error reading header from file Naar aanleiding hiervan heb ik contact gehad met Robert Smies (ANT) en die heeft voor mij de laatste versie van de mex files gecompileerd voor Windows. Bijgevoegd vind je deze files, in de hoop dat ze in FieldTrip terecht zullen komen en anderen er ook wat aan hebben. Het gaat om versie libeep-3.3.172. --- mac011> svn commit Sending read_eep_avr.m Adding (bin) read_eep_avr.mexw64 Sending read_eep_cnt.m Sending read_eep_cnt.mexw64 Sending read_eep_trg.m Adding (bin) read_eep_trg.mexw64 Adding write_eep_avr.m Adding (bin) write_eep_avr.mexw64 Adding write_eep_cnt.m Adding (bin) write_eep_cnt.mexw64 Transmitting file data .......... Committed revision 9975. let's not spend further time on it for other platforms, unless someone offers explicit help.

Robert Oostenveld - 2019-08-10 12:28:42 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on