[FieldTrip] mexa64 files
Schoffelen, J.M. (Jan Mathijs)
janmathijs.schoffelen at donders.ru.nl
Wed Mar 26 16:19:56 CET 2025
Dear Burkhard,
>From what you describe, it seems as if most of the mex files have compiled successfully. We try to stay away from (re)compiling the mex files as long as we can, so I haven’t tried the ft_compile_mex function recently on our filesystem. We (i.e. our TG) is in the process of upgrading from CentOS Linux (hopelessly outdated, so: whoohoo) to Almalinux version 9, which is still not exactly the bleeding edge (and will be outdated again relatively soon)…
This being said, when I try ft_compile_mex on our end, we get the same (final) error that you got, but the rest compiled just fine. I suspect (and hope) that now the relevant mex files start working again. We should look into mxSerialize.cpp functions on our end, but we would be happy if one of the readers of this thread picks up the challenge… :)
BTW, if ft_getopt still causes problems, you may want to throw away the mexa64 altogether (note ft_getopt is in overloaded in a bunch of folders in the fieldtrip distribution): we have a (slower, yet functional) ft_getopt.m file that should have the same functionality as ft_getopt.
BW,
JM
> On 26 Mar 2025, at 12:56, Dr. Burkhard Maess via fieldtrip <fieldtrip at science.ru.nl> wrote:
>
> Dear Fieldtrip-Team,
>
> since the upgrade to Linux 6.1.0-32-amd64 my copies of fieldtrip keeps rejecting to work due to this error message:
>
> Invalid MEX-file '/software/fieldtrip-20201117/fileio/private/ft_getopt.mexa64':
> /software/rothirsch2/fieldtrip-20201117/fileio/private/ft_getopt.mexa64: failed to map segment from shared object
> Error in ft_read_header (line 182)
> headerformat = ft_getopt(varargin, 'headerformat');
>
> I am using matlab R2024b currently, but have tested older version in respect to the above problem. None if the versions R2022a, R2024a or R2024b can use the mex-files anymore. They were usuable with an older installation of the linux machine. However, after the system update it does not work. The version of fieldtrip does not matter either. So, I read on your website and considered recompiling the mex files a good idea.
>
> However, this was not completed without errors. It stopped while compiling with g++ (see below). Do you have any hints how to get around this problem?
>
> Thank you very much and best wishes,
>
> Burkhard
>
>
> in matlab (R2024b)
>
> >> ft_compile_mex(true)
> Compiling MEX file compat/matlablt2010b/@uint64/abs ...
> Building with 'gcc'.
> MEX completed successfully.
> Compiling MEX file compat/matlablt2010b/@uint64/min ...
> Building with 'gcc'.
> MEX completed successfully.
> # .... lots of successes :)
>
> Compiling MEX file src/read_24bit ...
> Building with 'gcc'.
> MEX completed successfully.
> Compiling MEX file src/lmoutr ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
> MEX completed successfully.
> Compiling MEX file src/ltrisect ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
>
> MEX completed successfully.
> Compiling MEX file src/plinproj ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
>
> MEX completed successfully.
> ompiling MEX file src/ptriproj ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
>
> MEX completed successfully.
> Compiling MEX file src/routlm ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
>
> MEX completed successfully.
> Compiling MEX file src/solid_angle ...
> Building with 'gcc'.
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c: In function â€ltrisect’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/geometry.c:176:15: warning: implicit declaration of function â€mxGetNaN’ [-Wimplicit-function-declaration]
> 176 | proj[0] = mxGetNaN();
> | ^~~~~~~~
>
> MEX completed successfully.
> Compiling MEX file src/rfbevent ...
> Building with 'gcc'.
> MEX completed successfully.
> # ... lots of successes again
>
> Compiling MEX file external/fileexchange/CalcMD5 ...
> Building with 'gcc'.
> MEX completed successfully.
> Compiling MEX file src/mxSerialize_cpp ...
> Building with 'g++'.
> Error using ft_compile_mex>compile_mex_list (line 217)
> Error using mex
> /nobackup/rothirsch2/fieldtrip-20201117/src/mxSerialize_cpp.cpp:10:1: error: â€EXTERN_C’ does not name a type
> 10 | EXTERN_C mxArray* mxSerialize(mxArray const *);
> | ^~~~~~~~
> /nobackup/rothirsch2/fieldtrip-20201117/src/mxSerialize_cpp.cpp:11:1: error: â€EXTERN_C’ does not name a type
> 11 | EXTERN_C mxArray* mxDeserialize(const void *, size_t);
> | ^~~~~~~~
> /nobackup/rothirsch2/fieldtrip-20201117/src/mxSerialize_cpp.cpp: In function â€void mexFunction(int, mxArray**, int, const
> mxArray**)’:
> /nobackup/rothirsch2/fieldtrip-20201117/src/mxSerialize_cpp.cpp:22:31: error: â€mxSerialize’ was not declared in this scope
> 22 | plhs[0] = (mxArray *) mxSerialize(prhs[0]);
> | ^~~~~~~~~~~
>
>
> Error in ft_compile_mex (line 114)
> compile_mex_list(L, ftpath, force);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> --
> Dr. Burkhard Maess
> Brain Networks (@brainnetleipzig)
> Max Planck Institute for Human Cognitive and Brain Sciences
> Stephanstr. 1a, D-04301 Leipzig, Germany
> phone/fax: +49 341 9940-2526/-2511 https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cbs.mpg.de%2F~maess&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C0fe70bad21244f932f7108dd6c79aac4%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638785991982277127%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=45B38DnezMrbzVumxvnY7ocNpJgVlY%2BNnyyMI2pXLcY%3D&reserved=0
>
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C0fe70bad21244f932f7108dd6c79aac4%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638785991982301458%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=DEsnhmESmeGXwypWhHQK4unqqMEaAOlluIRr17b1Ywg%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C0fe70bad21244f932f7108dd6c79aac4%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638785991982322826%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=dwLILOGO%2BH%2BI%2FxKgtmCtAoww3SLAu4xVKAH0wXzkmfI%3D&reserved=0
More information about the fieldtrip
mailing list