From: Raphael Attie on
Hi,

Did anyone ever attempted to install mfitsio (cfitsio for Matlab) for mac os x, on intel architecture under Leopard ? (not Snow).
An attempt was made in the past, http://public.lanl.gov/eads/mfitsio/
but its for older architecture. My attempt on my intel leopard failed.
I'm trying to go from scratch, using the cfitsio, and using mex , with my architecture. not easy as pie... I'm attempting this to avoid using embedded fits-related routine in Matlab, as it doesn't answer some issues that cfitsio does.

Any help will be appreciated.

Thanks
From: Raphael Attie on
Here is some more details.

Either i run the makefile from mfitsio, with the proper link to the cfitsio library that I installed with macports, or i run the mex directly from Matlab, it gives me the same errors.
For instance, trying one of the m files from the mfitsio package, that corresponds to the function fits_read_image,

addpath('/Users/attie/matlab/mfitsio-1.2.4-src/mfitsio/')
pathtofile=which('fits_read_image.c');
pathstr = fileparts(pathtofile);
mex(pathtofile,'-outdir',pathstr,'-I/opt/local/var/macports/software/cfitsio/3.240_0/opt/local/include');

It results in the following errors :

Undefined symbols:
"_mfitsio_read_header", referenced from:
_mexFunction in fits_read_image.o
"_mfitsio_free_header", referenced from:
_mexFunction in fits_read_image.o
"_mfitsio_read_image", referenced from:
_mexFunction in fits_read_image.o
"_mfitsio_free_info", referenced from:
_mexFunction in fits_read_image.o
"_mfitsio_read_info", referenced from:
_mexFunction in fits_read_image.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

mex: link of ' "/Users/attie/matlab/mfitsio-1.2.4-src/mfitsio/fits_read_image.mexmaci"' failed.


Any idea what's causing the complain about the symbols ?

I'm using gcc-4.2, but same thing happened using gcc 4.0.
I'm running matlab in 32 bit, on intel leopard 10.5.

I already have done mex compilation with other routines in c++ (.cpp files), without any problem.

Thanks again.



"Raphael Attie" <attie(a)mps.mpg.de> wrote in message <hk4m34$bkt$1(a)fred.mathworks.com>...
> Hi,
>
> Did anyone ever attempted to install mfitsio (cfitsio for Matlab) for mac os x, on intel architecture under Leopard ? (not Snow).
> An attempt was made in the past, http://public.lanl.gov/eads/mfitsio/
> but its for older architecture. My attempt on my intel leopard failed.
> I'm trying to go from scratch, using the cfitsio, and using mex , with my architecture. not easy as pie... I'm attempting this to avoid using embedded fits-related routine in Matlab, as it doesn't answer some issues that cfitsio does.
>
> Any help will be appreciated.
>
> Thanks