Try changing the Makefile from:
SunOS:
make all SUF=mexsol CC="cc -xO5" MEX="mex
COPTIMFLAGS=-xO5"
to:
SunOS:
make all SUF=mexsol CC="cc -xO5 -DBIGENDIAN"\
MEX="mex COPTIMFLAGS=-xO5 -DBIGENDIAN"
SunOS.gcc:
# Assumes that gccopts.sh has been copied to the current directory
make all SUF=mexsol CC="gcc -O3 -funroll-loops -DBIGENDIAN -fPIC"\
MEX="mex COPTIMFLAGS='-O3 -funroll-loops -DBIGENDIAN'\
-f gccopts.sh"
and then compiling using
make SunOS.gcc
Best regards,
-John
On Monday 21 February 2005 10:40, Mark Daglish wrote:
> Dear All,
>
> I have been following the discussions on optimizing and re-compiling the
> SPM mex routines for faster running. I have run in a number of
> problems, mainly related to my local configuration I suspect. In
> particular, the linking stage is issuing many, many errors of the
> following type:
>
>
> mex -f ./mexopts.sh spm_sample_vol.c spm_vol_utils.mexsol.a
> Text relocation remains referenced
> against symbol offset in file
> <unknown> 0x94
> spm_vol_utils.mexsol.a(spm_vol_access.mexsol.o)
> <unknown> 0xa0
> spm_vol_utils.mexsol.a(spm_vol_access.mexsol.o)
> <unknown> 0x5f0
> spm_vol_utils.mexsol.a(spm_vol_access.mexsol.o)
> <unknown> 0x5fc
> spm_vol_utils.mexsol.a(spm_vol_access.mexsol.o)
> <unknown> 0xbac
> spm_vol_utils.mexsol.a(spm_vol_access.mexsol.o)
>
> The system is Matlab 7.01 running on SunSPARC with Solaris9 and gcc 3.3.2.
>
> If I do mex -n to see what commands are being issued to gcc I get the
> following:
>
> bash-2.05# mex -n -f ./mexopts.sh spm_sample_vol.c
> spm_vol_utils.mexsol.a
> -> gcc -c -I/usr/local/matlab7p1/extern/include
> -DMATLAB_MEX_FILE -fPIC -fexceptions -O3 -funroll-loops -mcpu=v9
> -DNDEBUG spm_sample_vol.c
>
> -> gcc -c -I/usr/local/matlab7p1/extern/include
> -DMATLAB_MEX_FILE -fPIC -fexceptions -O3 -funroll-loops -mcpu=v9
> -DNDEBUG /usr/local/matlab7p1/extern/src/mexversion.c
>
> -> gcc -O -shared
> -Wl,-M,/usr/local/matlab7p1/extern/lib/sol2/mexFunction.map,-R,/usr/local/l
>ib,-R,/opt/sfw/gcc-3/lib -o spm_sample_vol.mexsol spm_sample_vol.o
> mexversion.o
> spm_vol_utils.mexsol.a -L/opt/sfw/gcc-3/lib -L/opt/sfw/gcc-3/lib/gcc-lib
> -L/usr/local/matlab7p1/bin/sol2 -lg2c -lmx -lmex -lmat -lm -lm
>
> This includes all the suggested extra library paths I found by Google
> searching. If anyone has any extra hints, please could they point me in
> the right direction.
>
> Many thanks in advance,
>
> Mark
|