fagg / matlab-zmq

Mozilla Public License 2.0
26 stars 26 forks source link

Fails to build on macOS #51

Open fferri opened 3 years ago

fferri commented 3 years ago

Contents of config.m:

% ZMQ library filename
ZMQ_COMPILED_LIB = './libzmq.a';

% ZMQ library path
ZMQ_LIB_PATH = '/usr/local/Cellar/zeromq/4.3.4/lib/';

% ZMQ headers path
ZMQ_INCLUDE_PATH = '/usr/local/Cellar/zeromq/4.3.4/include/';

Verify that the above file exists:

>> config
>> ls(strcat(ZMQ_LIB_PATH,ZMQ_COMPILED_LIB))
/usr/local/Cellar/zeromq/4.3.4/lib/./libzmq.a

(no error)

Try to build:

>> make
compile ".../matlab-zmq/src/core/version.c"
Building with 'Xcode with Clang'.
Error using mex
ld: library not found for -l./libzmq
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error in make>compile (line 213)
    mex('-largeArrayDims', '-O', flags{:}, deps{:}, file, '-output', outputfile);

Error in make>@(file)compile(zmq_compile_flags,file,fullfile(lib_path,'+zmq/+core')) (line 166)
  build_function = @(file) compile(zmq_compile_flags, file, fullfile(lib_path,'+zmq/+core'));

Error in make>build (line 167)
  cellfun(build_function, COMPILE_LIST);

Error in make (line 40)
    success = build;
iandol commented 2 years ago

This worked for me (remove the relative path):

ZMQ_COMPILED_LIB = 'libzmq.a';