Back to the main page.

Bug 1385 - mex files for windows 64 should be compiled according to the guidelines

Status CLOSED FIXED
Reported 2012-03-21 17:58:00 +0100
Modified 2014-03-12 12:21:40 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Jörn M. Horschig
URL: http://fieldtrip.fcdonders.nl/code_guidelines?&#compiling_mex_files
Tags:
Depends on: 1258
Blocks:
See also:

Robert Oostenveld - 2012-03-21 17:58:55 +0100


Robert Oostenveld - 2012-03-22 09:02:01 +0100

The following mex files are candidates for recompilation according to the new guidelines. Note that the list includes many double counts, and might include false positives. manzana> find . -name \*.mexw64 -exec grep -L MSVCR90 {} \; | grep -v external ./engine/private/memprofile.mexw64 ./engine_private/memprofile.mexw64 ./fileio/@uint64/abs.mexw64 ./fileio/@uint64/max.mexw64 ./fileio/@uint64/min.mexw64 ./fileio/@uint64/minus.mexw64 ./fileio/@uint64/plus.mexw64 ./fileio/@uint64/rdivide.mexw64 ./fileio/@uint64/times.mexw64 ./fileio/private/buffer.mexw64 ./fileio/private/mxDeserialize.mexw64 ./fileio/private/mxSerialize.mexw64 ./fileio/private/nanstd.mexw64 ./fileio/private/nanvar.mexw64 ./fileio/private/read_16bit.mexw64 ./fileio/private/read_24bit.mexw64 ./fileio/private/sap2matlab.mexw64 ./forward/private/lmoutr.mexw64 ./forward/private/meg_leadfield1.mexw64 ./forward/private/plgndr.mexw64 ./forward/private/ptriproj.mexw64 ./forward/private/routlm.mexw64 ./forward/private/solid_angle.mexw64 ./inverse/private/solid_angle.mexw64 ./peer/private/memprofile.mexw64 ./peer/private/peer.mexw64 ./peer/private/time.mexw64 ./private/lmoutr.mexw64 ./private/nanstd.mexw64 ./private/nanvar.mexw64 ./private/plgndr.mexw64 ./private/ptriproj.mexw64 ./private/solid_angle.mexw64 ./qsub/private/memprofile.mexw64 ./realtime/buffer/matlab/buffer.mexw64 ./realtime/online_eeg/private/midiOut.mexw64 ./realtime/online_mri/ft_omri_smooth_volume.mexw64 ./realtime/src/buffer/matlab/buffer.mexw64 ./src/lmoutr.mexw64 ./src/ltrisect.mexw64 ./src/meg_leadfield1.mexw64 ./src/mxDeserialize.mexw64 ./src/mxSerialize.mexw64 ./src/nanstd.mexw64 ./src/nanvar.mexw64 ./src/plgndr.mexw64 ./src/ptriproj.mexw64 ./src/read_16bit.mexw64 ./src/read_24bit.mexw64 ./src/routlm.mexw64 ./src/solid_angle.mexw64 ./src/splint_gh.mexw64 ./statfun/private/nanstd.mexw64 ./statfun/private/nanvar.mexw64 ./testing/MIDI/midiOut.mexw64 ./testing/test_bug646/lmoutr.mexw64 ./testing/test_bug646/ptriproj.mexw64 ./utilities/private/lmoutr.mexw64 ./utilities/private/ptriproj.mexw64 You might want to check with manzana> strings $FILENAME | grep -i dll


Eelke Spaak - 2012-03-27 11:50:42 +0200

Sending @config/private/deepcopy.mexw64 Sending @config/private/increment.mexw64 Sending @config/private/setzero.mexw64 Sending fileio/@uint64/abs.mexw64 Sending fileio/@uint64/max.mexw64 Sending fileio/@uint64/min.mexw64 Sending fileio/@uint64/minus.mexw64 Sending fileio/@uint64/plus.mexw64 Sending fileio/@uint64/rdivide.mexw64 Sending fileio/@uint64/times.mexw64 Adding (bin) realtime/acquisition/siemens/sap2matlab.mexw64 Sending realtime/online_mri/ft_omri_smooth_volume.mexw64 Adding (bin) src/det2x2.mexw64 Sending src/ft_getopt.mexw64 Sending src/ft_spike_sub_crossx.mexw64 Sending src/getpid.mexw64 Adding (bin) src/inv2x2.mexw64 Sending src/lmoutr.mexw64 Sending src/ltrisect.mexw64 Sending src/meg_leadfield1.mexw64 Adding (bin) src/mtimes2x2.mexw64 Sending src/mxDeserialize.mexw64 Sending src/mxSerialize.mexw64 Sending src/nanmean.mexw64 Sending src/nanstd.mexw64 Sending src/nansum.mexw64 Sending src/plgndr.mexw64 Sending src/plinproj.mexw64 Sending src/ptriproj.mexw64 Sending src/read_16bit.mexw64 Sending src/read_24bit.mexw64 Adding (bin) src/rename.mexw64 Sending src/routlm.mexw64 Adding (bin) src/sandwich2x2.mexw64 Sending src/solid_angle.mexw64 Sending src/splint_gh.mexw64 Transmitting file data .................................... Committed revision 5539.


Eelke Spaak - 2012-03-27 12:11:34 +0200

Still a few mex-files left with dependencies other than MSCVCR90: $ find . -name \*.mexw64 -exec grep -L MSVCR90 {} \; | grep -v external ./src/nanvar.mexw64 ./peer/private/peer.mexw64 ./peer/private/time.mexw64 ./peer/private/memprofile.mexw64 ./fileio/private/sap2matlab.mexw64 ./fileio/private/buffer.mexw64 ./fileio/private/nanvar.mexw64 ./private/nanvar.mexw64 ./realtime/buffer/matlab/buffer.mexw64 ./realtime/online_eeg/private/midiOut.mexw64 ./statfun/private/nanvar.mexw64 ./engine/private/memprofile.mexw64 ./qsub/private/memprofile.mexw64 My guess is that these are not listed in ft_compile_mex, I will investigate.


Eelke Spaak - 2012-03-27 14:01:48 +0200

bash-3.2$ svn commit src/nanvar.mexw64 Sending src/nanvar.mexw64 Transmitting file data . Committed revision 5542. nanvar seems the only trivial one, the rest requires a bit more communication on where to put sources etc. Remaining: $ find . -name \*.mexw64 -exec grep -L MSVCR90 {} \; | grep -v external ./peer/private/peer.mexw64 ./peer/private/time.mexw64 ./peer/private/memprofile.mexw64 ./fileio/private/sap2matlab.mexw64 ./fileio/private/buffer.mexw64 ./realtime/buffer/matlab/buffer.mexw64 ./realtime/online_eeg/private/midiOut.mexw64 ./engine/private/memprofile.mexw64 ./qsub/private/memprofile.mexw64


Arjen Stolk - 2012-03-28 13:18:41 +0200

move memprofile, time, and sap2matlab to /src/


Eelke Spaak - 2013-05-08 15:34:06 +0200

I think this has been taken care of. I'm assigning to Jorn, as he is the windows-wizard aroud here :) But as I said, I think you can just close the bugs, unless you find something problematic. Note: I can't seem to compile windows mex anymore, on my new desktop.


Jörn M. Horschig - 2013-07-16 09:43:12 +0200

hmmm windows-wizard... I like that, but I'm afraid it's not true mex -IM:\FieldTrip\trunk\realtime\src\external\pthreads-win64\include peer.c peer.c peer.c(61) : warning C4013: 'openlog' undefined; assuming extern returning int peer.c(61) : error C2065: 'LOG_PID' : undeclared identifier peer.c(61) : error C2065: 'LOG_USER' : undeclared identifier peer.c(62) : warning C4013: 'setlogmask' undefined; assuming extern returning int peer.c(62) : warning C4013: 'LOG_MASK' undefined; assuming extern returning int peer.c(62) : error C2065: 'LOG_EMERG' : undeclared identifier peer.c(62) : error C2065: 'LOG_ALERT' : undeclared identifier peer.c(62) : error C2065: 'LOG_CRIT' : undeclared identifier peer.c(138) : warning C4013: 'closelog' undefined; assuming extern returning int peer.c(454) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(455) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(456) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(464) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(465) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(466) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(497) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(498) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(515) : warning C4013: 'mxIsScalar' undefined; assuming extern returning int peer.c(666) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data peer.c(685) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data peer.c(704) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data peer.c(854) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(888) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(922) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(956) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(990) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(1024) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data peer.c(1164) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data peer.c(1165) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data peer.c(1355) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(1356) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data peer.c(1357) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'double', possible loss of data C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Compile of 'peer.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. for memprofile.c and buffer.c there are dependencies that I'd need to resolve first


Robert Oostenveld - 2013-07-30 12:47:37 +0200

(In reply to comment #7) peer stuff does not have to be recompiled on windows. Actually, I think we should consider removing it altogether.


Jörn M. Horschig - 2013-10-16 14:58:18 +0200

I guess the buffer still needs to be compiled? I gave it a try and got stuck with a kinda nasty one. Then I digged into the code and found that the error occurs because of this: ft_swap_data(ddef->nchans*ddef->nsamples, ddef->data_type, (void *)ddef + sizeof(datadef_t)); /* ddef+1 points to first data byte */ the problem seems to be that arithmetic computations with void are not possible - at least with the compile that I am using. Any idea on how to solve this elegantly?


Jörn M. Horschig - 2014-03-12 08:43:12 +0100

it might be that the buffer is still missing, but apart from that I got a new computer in November and atm do not have the possibility to compile for Matlab64 (ie I'd need to download the distributables again), so changed this to fixed