So, I love my Macbook, and she loves me. We have our ups and downs, but for the most part our relationship has been strong. Recently though we had a fight. it started out simply enough. I was asking her to do more, trying to be more experimental. We brought things like sse, fast math, and unrolling into the bedroom and compiled new versions of our libraries.

It started out well enough. We'd compile some code using the new libraries, test out the new waters. Over time our performance as a couple soared. She was working faster and I thought all was well and good. Then things took a turn for the worse. We brought another player into the mix. Her name is Matlab.

We started compiling for Matlab,

mex CC="gcc" CFLAGS="\$CFLAGS -msse -msse2 -msse3 -ffast-math -ftree-vectorize" LDFLAGS="\$LDFLAGS -msse2 -msse3 -ffast-math -ftree-vectorize" -I/usr/local/include -L/usr/local/lib -lsundials_cvode -lsundials_nvecserial -v -o kry_new.mexmaci64 mex_main.c

compiling and linking worked great. But then the trouble started:

kry_new(param,init,0:60:240,abstol,rtol,1)
??? Invalid MEX-file
'/Users/Andrew/Documents/MATLAB/het_optim/kry_new.mexmaci64':
dlopen(/Users/Andrew/Documents/MATLAB/het_optim/kry_new.mexmaci64, 1):
Library not loaded: /usr/local/lib/libsundials_cvode.1.dylib
  Referenced from: /Users/Andrew/Documents/MATLAB/het_optim/kry_new.mexmaci64
  Reason: Incompatible library version: kry_new.mexmaci64 requires version
  2.0.0 or later, but libsundials_cvode.1.dylib provides version 1.0.0.

Matlab felt that our experiments had gone to far. That they were totally different versions of the libraries. I don't know where she got this idea. I did some investigating:

$ otool -L kry_new.mexmaci64 
kry_new.mexmaci64:
    /usr/local/lib/libsundials_cvode.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    @loader_path/libsundials_nvecserial.0.0.2.dylib (co
Edit
Report