justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

Eyelink code not compiling / linking correctly in Matlab 2023b / Silicon version #92

Open justingardner opened 10 months ago

justingardner commented 10 months ago

Actually, two issues. The first is, probably simple. The new mglMakeMetal compiles to arm64, but our eyelink library is x86_64 based. So, on compile we get an error:

mglMakeMetal mglEyelinkForce ============ Compiling mglEyelinkIsConnected.c ============= mex -R2018a CFLAGS='-x objective-c -fno-common -no-cpp-precomp -arch arm64 -Wno-deprecated-declarations -Wno-deprecated -Wno-implicit-function-declaration -I/Library/Frameworks/eyelink_core.framework/Headers -I/Library/Frameworks/edfapi.framework/Headers ' LDFLAGS='-Wl,-twolevel_namespace -F/Library/Frameworks -arch arm64 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2023b.app/extern/lib/maca64/mexFunction.map -framework Carbon -framework Cocoa -framework CoreServices -framework openGL -framework CoreAudio -framework eyelink_core -framework edfapi' mglEyelinkIsConnected.c Building with 'Xcode with Clang'. (mglMakeMetal) Error compiling mglEyelinkIsConnected.c Error using mex ld: warning: ignoring file '/Library/Frameworks/eyelink_core.framework/Versions/A/eyelink_core': found architecture 'x86_64', required architecture 'arm64' ld: warning: ignoring file '/Library/Frameworks/edfapi.framework/Versions/A/edfapi': found architecture 'x86_64', required architecture 'arm64' ld: Undefined symbols: _eyelink_is_connected, referenced from: _mexFunction in mglEyelinkIsConnected.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

MATLAB:mex:Error ====== Compilation FAILED for mglEyelinkIsConnected.c ======

justingardner commented 10 months ago

The second issue seems to be some problem with finding dynamic link libraries. When compiled correctly, the dynamic link libraries could not be found correctly even though there location was specified with the linker flag: -F/Library/Frameworks the eyelink can be run if you put the libraries into the Matlab directory which is still on the dynamic link library list. The error at runtime of any mglEyelink compiled function is that the eyelink libraries cannot be found and therefore the Mex file can't run./