Apr 16 2002 Try to do mex file for interpos.f File matlab6/mex/interpos.f on sun5 same as JET one (except malloc statement with %val) ftp file to matlab6/mex/interpos.f cd matlab6/mex matlab -v 12 -nojvm mex -v -fortran interpos.f % output: %%%%%%%%%%%%%%%%%%% f77 -c -I/afs/ipp/common/soft/matlab_12/extern/include -I/afs/ipp/common/soft/matlab_12/simulink/include -dalign -KPIC -O interpos.f -> /usr/ccs/bin/ld -G -M /afs/ipp/common/soft/matlab_12/extern/lib/sol2/fexport.map -o interpos.mexsol interpos.o /afs/ipp/common/soft/matlab_12/extern/lib/sol2/version4.o %%%%%%%%%%%%%%%%%%%%%%%%% testing: xx=[1 2 3 4 5 6]; yy=[1.23 2.93 2.234 4.23 2.45 1.35 ]; aa=interpos(13,xx,yy,[0:0.2:7]); figure plot(xx,yy) hold on plot([0:0.2:7],aa,'r--') after interpos, got message: Unable to load mex file: /afs/ipp/u/osauter/matlab6/mex/interpos.mexsol. ld.so.1: /afs/ipp/common/soft/matlab_12/bin/sol2/matlab: fatal: relocation error: file /afs/ipp/u/osauter/matlab6/mex/interpos.mexsol: symbol __s_wsle_pv: referenced symbol not found ??? Invalid MEX-file Trying from matlab (thus matlab 5.3.1) got: mex -v -fortran interpos.f -> f77 -c -I/afs/ipp/common/soft/matlab_5.3.1/extern/include -I/afs/ipp/common/soft/matlab_5.3.1/simulink/include -dalign -KPIC -O interpos.f (much longer => good sign?) -> /usr/ccs/bin/ld -G -M /afs/ipp/common/soft/matlab_5.3.1/extern/lib/sol2/fexport.map -o interpos.mexsol interpos.o /afs/ipp/common/soft/matlab_5.3.1/extern/lib/sol2/version4.o same message: Unable to load mex file: /afs/ipp/home/o/osauter/matlab6/mex/interpos.mexsol. ld.so.1: /afs/ipp/common/soft/matlab_5.3.1/bin/sol2/matlab: fatal: relocation error: file /afs/ipp/home/o/osauter/matlab6/mex/interpos.mexsol: symbol __s_wsle_pv: referenced symbol not found ??? Invalid MEX-file bringing version from sun5 ftp binary interpos.mexsol works fine with both matlab 5.3.1 and 6 (-v 12) Trying to compile it again on crppsun5 in /tmp >> mex -v -fortran interpos.f -> f77 -c -I/usr/local/matlab/extern/include -I/usr/local/matlab/simulink/include -dalign -KPIC -O interpos.f -> /usr/ccs/bin/ld -G -M /usr/local/matlab/extern/lib/sol2/fexport.map -o interpos.mexsol interpos.o /usr/local/matlab/extern/lib/sol2/version4.o does not work (segmentation violation) from unix shell, trying: % fmex -v interpos.f -> f77 -c -I/export/soft/matlab-5.3.1/extern/include -I/export/soft/matlab-5.3.1/simulink/include -dalign -KPIC -O interpos.f -> /usr/ccs/bin/ld -G -M /export/soft/matlab-5.3.1/extern/lib/sol2/fexport.map -o interpos.mexsol interpos.o /export/soft/matlab-5.3.1/extern/lib/sol2/version4.o same but had IBM definition of malloc: malloc_f = malloc(%val(nbytes)) trying SUN def, without %val() works redoes it from within matlab works fine as well