Thread Subject: mex compile error in mac

Subject: mex compile error in mac

From: Hua Wang

Date: 4 Aug, 2011 21:35:31

Message: 1 of 3

I am trying to compile a fortran file under mac 10.6 snow Leopard system. The file has been used long in Linux.

The command line for compling the file is simple (dcm.f is a mex file for dc.f)
mex dcm.f dc.f

The error message is
gcc-4.6.0: error: x86_64: No such file or directory
gcc-4.6.0: error: unrecognized option '-arch'

I installed gcc-4.6.0 by the command line
./configure --prefix=/home1/insar/gcc-4.6.0 --program-suffix=-4.6.0 --enable-languages=c,c++,fortran CC="gcc -m64"

Could anybody give me some suggestions? Thanks in advance!

Subject: mex compile error in mac

From: Hua Wang

Date: 4 Aug, 2011 22:03:27

Message: 2 of 3

When I removed the -arch option in mexopts.sh, the new error is

Undefined symbols for architecture x86_64:
  "_mxgetm_", referenced from:
      _mexfunction_ in dc3dm.f
  "_mxcopyptrtoreal8_", referenced from:
      _mexfunction_ in dc3dm.o
  "_dc3d_", referenced from:
      _mexfunction_ in dc3dm.o
  "_mxcreatedoublematrix_", referenced from:
      _mexfunction_ in dc3dm.o
  "_mxcopyreal8toptr_", referenced from:
      _mexfunction_ in dc3dm.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

Thanks for your help!

Subject: mex compile error in mac

From: Hua Wang

Date: 14 Aug, 2011 16:37:14

Message: 3 of 3

"Hua Wang" <ehwang@163.com> wrote in message <j1f3b3$h5p$1@newscl01ah.mathworks.com>...
> I am trying to compile a fortran file under mac 10.6 snow Leopard system. The file has been used long in Linux.
>
> The command line for compling the file is simple (dcm.f is a mex file for dc.f)
> mex dcm.f dc.f
>
> The error message is
> gcc-4.6.0: error: x86_64: No such file or directory
> gcc-4.6.0: error: unrecognized option '-arch'
>
> I installed gcc-4.6.0 by the command line
> ./configure --prefix=/home1/insar/gcc-4.6.0 --program-suffix=-4.6.0 --enable-languages=c,c++,fortran CC="gcc -m64"
>
> Could anybody give me some suggestions? Thanks in advance!

Can anybody help ?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
mex mac gcc arc... Hua Wang 4 Aug, 2011 17:39:28
rssFeed for this Thread

Contact us at files@mathworks.com