Thread Subject: Problems with fortran mex on MACOSX Leopard

Subject: Problems with fortran mex on MACOSX Leopard

From: Ibon

Date: 31 Oct, 2007 14:36:38

Message: 1 of 9

Recently I upgraded from Tiger to Leopard MACOSX, and when I try to call –
already tested MEX files on MACOSX Tiger–, they simply crash.

I cannot even compile the first example included in the documentation:
'timestwo.F' properly, I used different configuration 'mexopts.sh' files: for
g95, gfortran and ifort compilers (which works perfectly well with MACOSX
Tiger):


%--- Using g95:

>> mex timestwo.F
/sw/lib/odcctools590/bin/ld: /usr/lib///libm.dylib unknown flags (type) of
section 6 (__TEXT,__dof_plockstat) in load command 0
/sw/lib/odcctools590/bin/ld: /usr/lib///libmx.dylib segment __TEXT
contains no sections and can't be link-edited
/sw/lib/odcctools590/bin/ld: /usr/lib///libSystem.dylib unknown flags (type)
of section 6 (__TEXT,__dof_plockstat) in load command 0

mex: link of 'timestwo.mexmaci' failed.

??? Error using ==> mex at 206
Unable to complete successfully.



%--- Using gfortran:

>> mex timestwo.F
ld: warning, duplicate dylib /usr/local/lib/libgcc_s.1.dylib

HOWEVER when I try to run it, IT CRASHES.


%--- Using ifort:

>> mex timestwo.F
ifort: error #10106: Fatal error in /opt/intel/fce/10.0.016/bin/fpp,
terminated by segmentation violation

mex: compile of 'timestwo.F' failed.

??? Error using ==> mex at 206
Unable to complete successfully.


NOTE:
-The example code can be found typing:
edit([matlabroot '/extern/examples/refbook/timestwo.F']);

-I am using MATLAB Version 7.4.0.287 (R2007a)


Any suggestions?

Thank you very much indeed.

Subject: Problems with fortran mex on MACOSX Leopard

From: Brian Arnold

Date: 2 Nov, 2007 18:11:25

Message: 2 of 9

Hi Ibon,

When we ran our qualification tests, we used g95 (built on Tiger using
Xcode 2.4.1) with MATLAB and Xcode 3 on Leopard for the MEXing.

 From the looks of the g95 failure below, it could be that g95 isn't
built right, or that the version of Xcode on Leopard is wrong. Did you
install Xcode 3 from the DVD?

- Brian

Ibon wrote:
> Recently I upgraded from Tiger to Leopard MACOSX, and when I try to call –
> already tested MEX files on MACOSX Tiger–, they simply crash.
>
> I cannot even compile the first example included in the documentation:
> 'timestwo.F' properly, I used different configuration 'mexopts.sh' files: for
> g95, gfortran and ifort compilers (which works perfectly well with MACOSX
> Tiger):
>
>
> %--- Using g95:
>
>>> mex timestwo.F
> /sw/lib/odcctools590/bin/ld: /usr/lib///libm.dylib unknown flags (type) of
> section 6 (__TEXT,__dof_plockstat) in load command 0
> /sw/lib/odcctools590/bin/ld: /usr/lib///libmx.dylib segment __TEXT
> contains no sections and can't be link-edited
> /sw/lib/odcctools590/bin/ld: /usr/lib///libSystem.dylib unknown flags (type)
> of section 6 (__TEXT,__dof_plockstat) in load command 0
>
> mex: link of 'timestwo.mexmaci' failed.
>
> ??? Error using ==> mex at 206
> Unable to complete successfully.
>
>
>
> %--- Using gfortran:
>
>>> mex timestwo.F
> ld: warning, duplicate dylib /usr/local/lib/libgcc_s.1.dylib
>
> HOWEVER when I try to run it, IT CRASHES.
>
>
> %--- Using ifort:
>
>>> mex timestwo.F
> ifort: error #10106: Fatal error in /opt/intel/fce/10.0.016/bin/fpp,
> terminated by segmentation violation
>
> mex: compile of 'timestwo.F' failed.
>
> ??? Error using ==> mex at 206
> Unable to complete successfully.
>
>
> NOTE:
> -The example code can be found typing:
> edit([matlabroot '/extern/examples/refbook/timestwo.F']);
>
> -I am using MATLAB Version 7.4.0.287 (R2007a)
>
>
> Any suggestions?
>
> Thank you very much indeed.
>
>

Subject: Problems with fortran mex on MACOSX Leopard

From: Ibon

Date: 2 Nov, 2007 23:29:10

Message: 3 of 9

Hi Brian,

Yes, I installed Xcode 3.0 from the DVD, that should not be a problem.
However, you are right, it seems that my g95 is having some issues with
Leopard (http://www.mail-archive.com/fink-
devel@lists.sourceforge.net/msg15794.html) due to its dependency on
odcctools590.

On the other hand, do you have a clue why is 'ifort' crashing?


Many thanks!

Ibon,


Brian Arnold <barnold@mathworks.com> wrote in message
<fgfp8d$p7a$1@fred.mathworks.com>...
> Hi Ibon,
>
> When we ran our qualification tests, we used g95 (built on Tiger using
> Xcode 2.4.1) with MATLAB and Xcode 3 on Leopard for the MEXing.
>
> From the looks of the g95 failure below, it could be that g95 isn't
> built right, or that the version of Xcode on Leopard is wrong. Did you
> install Xcode 3 from the DVD?
>
> - Brian
>
> Ibon wrote:
> > Recently I upgraded from Tiger to Leopard MACOSX, and when I try to
call –
> > already tested MEX files on MACOSX Tiger–, they simply crash.
> >
> > I cannot even compile the first example included in the documentation:
> > 'timestwo.F' properly, I used different configuration 'mexopts.sh' files:
for
> > g95, gfortran and ifort compilers (which works perfectly well with
MACOSX
> > Tiger):
> >
> >
> > %--- Using g95:
> >
> >>> mex timestwo.F
> > /sw/lib/odcctools590/bin/ld: /usr/lib///libm.dylib unknown flags (type)
of
> > section 6 (__TEXT,__dof_plockstat) in load command 0
> > /sw/lib/odcctools590/bin/ld: /usr/lib///libmx.dylib segment __TEXT
> > contains no sections and can't be link-edited
> > /sw/lib/odcctools590/bin/ld: /usr/lib///libSystem.dylib unknown flags
(type)
> > of section 6 (__TEXT,__dof_plockstat) in load command 0
> >
> > mex: link of 'timestwo.mexmaci' failed.
> >
> > ??? Error using ==> mex at 206
> > Unable to complete successfully.
> >
> >
> >
> > %--- Using gfortran:
> >
> >>> mex timestwo.F
> > ld: warning, duplicate dylib /usr/local/lib/libgcc_s.1.dylib
> >
> > HOWEVER when I try to run it, IT CRASHES.
> >
> >
> > %--- Using ifort:
> >
> >>> mex timestwo.F
> > ifort: error #10106: Fatal error in /opt/intel/fce/10.0.016/bin/fpp,
> > terminated by segmentation violation
> >
> > mex: compile of 'timestwo.F' failed.
> >
> > ??? Error using ==> mex at 206
> > Unable to complete successfully.
> >
> >
> > NOTE:
> > -The example code can be found typing:
> > edit([matlabroot '/extern/examples/refbook/timestwo.F']);
> >
> > -I am using MATLAB Version 7.4.0.287 (R2007a)
> >
> >
> > Any suggestions?
> >
> > Thank you very much indeed.
> >
> >

Subject: Problems with fortran mex on MACOSX Leopard

From: Ben Abbott

Date: 29 Dec, 2007 12:35:02

Message: 4 of 9

Brian,

Do I understand correclty, that TMW built g95 on Tiger, and then used it
successfully on Leopard?

In either event, any chance a pure Leopard solution might be forth coming
with 2008a?

I'd personally like to be able to use gfortran since this is the direction that
gnu is headed with their compilers ... but would be happy with g95 0.90
solution.

TiA

Brian Arnold <barnold@mathworks.com> wrote in message
<fgfp8d$p7a$1@fred.mathworks.com>...
> Hi Ibon,
>
> When we ran our qualification tests, we used g95 (built on Tiger using
> Xcode 2.4.1) with MATLAB and Xcode 3 on Leopard for the MEXing.
>
> From the looks of the g95 failure below, it could be that g95 isn't
> built right, or that the version of Xcode on Leopard is wrong. Did you
> install Xcode 3 from the DVD?
>
> - Brian
>

Subject: Problems with fortran mex on MACOSX Leopard

From: Brian Arnold

Date: 2 Jan, 2008 18:01:42

Message: 5 of 9

Hi Ben,

We use the same g95 built for Tiger, out-of-box from the original
sources, using Xcode 2.4.1. Make sure you are using Xcode 2.4.1.

We would prefer to support gfortran, and it is possible to use gfortran
instead. However until very recently, gfortran did not support %val
which many customers (including us) use, on multiple platforms, which is
why we only support g95 on all Unix platforms. Now that gfortran
supports %val as of gcc 4.2.2, it's our intention to qualify and use
gfortran in a future MATLAB release (barring unforeseen disasters).

HTH,

- Brian

Ben Abbott wrote:
> Brian,
>
> Do I understand correclty, that TMW built g95 on Tiger, and then used it
> successfully on Leopard?
>
> In either event, any chance a pure Leopard solution might be forth coming
> with 2008a?
>
> I'd personally like to be able to use gfortran since this is the direction that
> gnu is headed with their compilers ... but would be happy with g95 0.90
> solution.
>
> TiA
>
> Brian Arnold <barnold@mathworks.com> wrote in message
> <fgfp8d$p7a$1@fred.mathworks.com>...
>> Hi Ibon,
>>
>> When we ran our qualification tests, we used g95 (built on Tiger using
>> Xcode 2.4.1) with MATLAB and Xcode 3 on Leopard for the MEXing.
>>
>> From the looks of the g95 failure below, it could be that g95 isn't
>> built right, or that the version of Xcode on Leopard is wrong. Did you
>> install Xcode 3 from the DVD?
>>
>> - Brian
>>
>

Subject: Problems with fortran mex on MACOSX Leopard

From: Ben Abbott

Date: 3 Jan, 2008 03:47:24

Message: 6 of 9

Brian,

I'm presently running Leopard (Xcode 3.0) on both PPC and Intel boxes.
Unfortunately, I don't have a convenient method to run Xcode 2.4.1.

However, as a side note, I was successful with building mex files for PPC and
Intel on Tiger using g77, g95, and gfortran.

I presently use a make file that optionally builds using g95 and gfortran on
Tiger. If it may be of some use, I'm happy to post it.

Regarding "a future MATLAB release", I look forward to it.

Some background on my problem: My mex file crashes when with

dyld: Symbol not found: _mxgetnumberofelements_

Checking libraries all I find is "_mxGetNumberOfElements". Since that is in
CamelCase, there is no way for me to link to it :-(

With this small piece of information, it appears to me that the fortran
interface for 2008b has a problem, but if Xcode 2.4.1 works then that can't
be true.

I'd be appreciative if can you give me some more detail as to what the
problem is with 2007b and Xcode 3.0? Perhaps I can find a work around by
using g95's f2003 bindings (soon to come for gfortran as well).

TiA
Ben


Brian Arnold <barnold@mathworks.com> wrote in message
<477BD186.1040709@mathworks.com>...
> Hi Ben,
>
> We use the same g95 built for Tiger, out-of-box from the original
> sources, using Xcode 2.4.1. Make sure you are using Xcode 2.4.1.
>
> We would prefer to support gfortran, and it is possible to use gfortran
> instead. However until very recently, gfortran did not support %val
> which many customers (including us) use, on multiple platforms, which is
> why we only support g95 on all Unix platforms. Now that gfortran
> supports %val as of gcc 4.2.2, it's our intention to qualify and use
> gfortran in a future MATLAB release (barring unforeseen disasters).
>
> HTH,
>
> - Brian
>
> Ben Abbott wrote:
> > Brian,
> >
> > Do I understand correclty, that TMW built g95 on Tiger, and then used it
> > successfully on Leopard?
> >
> > In either event, any chance a pure Leopard solution might be forth
coming
> > with 2008a?
> >
> > I'd personally like to be able to use gfortran since this is the direction
that
> > gnu is headed with their compilers ... but would be happy with g95 0.90
> > solution.
> >
> > TiA
> >
> > Brian Arnold <barnold@mathworks.com> wrote in message
> > <fgfp8d$p7a$1@fred.mathworks.com>...
> >> Hi Ibon,
> >>
> >> When we ran our qualification tests, we used g95 (built on Tiger using
> >> Xcode 2.4.1) with MATLAB and Xcode 3 on Leopard for the MEXing.
> >>
> >> From the looks of the g95 failure below, it could be that g95 isn't
> >> built right, or that the version of Xcode on Leopard is wrong. Did you
> >> install Xcode 3 from the DVD?
> >>
> >> - Brian
> >>
> >

Subject: Problems with fortran mex on MACOSX Leopard

From: Ben Abbott

Date: 7 Jan, 2008 07:55:07

Message: 7 of 9

Update:

Fink now has g95 for Leopard available.

http://pdb.finkproject.org/pdb/package.php/g95

I haven't done much with it, but I did try one of Mathwork's examples.

>> mex yprimef.F yprimefg.F
ld: warning, duplicate dylib
/Applications/MATLAB_R2007b/bin/maci/libz.1.dylib
>> yprimef(1,1:4)

ans =

    2.0000 8.9685 4.0000 -1.0947

>>

In spite of the linker warning, it appears to work!

Ben

Subject: Problems with fortran mex on MACOSX Leopard

From: Brian Arnold

Date: 7 Jan, 2008 14:46:02

Message: 8 of 9

Woo hoo!

The linker warning is new to Xcode 3's linker, and not specific to g95.
  It is (correctly) warning that there are two libz's on the path. On
startup, MATLAB's libz is loaded first, and MATLAB requires this version
for correct operation. It happens to be the same version (1.2.3)
currently provided by both Tiger and Leopard.

Brian


Ben Abbott wrote:
> Update:
>
> Fink now has g95 for Leopard available.
>
> http://pdb.finkproject.org/pdb/package.php/g95
>
> I haven't done much with it, but I did try one of Mathwork's examples.
>
>>> mex yprimef.F yprimefg.F
> ld: warning, duplicate dylib
> /Applications/MATLAB_R2007b/bin/maci/libz.1.dylib
>>> yprimef(1,1:4)
>
> ans =
>
> 2.0000 8.9685 4.0000 -1.0947
>
>
> In spite of the linker warning, it appears to work!
>
> Ben
>
>

Subject: Problems with fortran mex on MACOSX Leopard

From: Ben Abbott

Date: 8 Jan, 2008 01:10:19

Message: 9 of 9

Unfortunately, I'm still having troubles with my mexmaci builds. I'll spend
some more time on this and either post what words, or post what doesn't.

In any event, if libz is the "the same version (1.2.3)", does it matter which one
is loaded first?

Ben

Brian Arnold <barnold@mathworks.com> wrote in message
<47823B2A.3000006@mathworks.com>...
> Woo hoo!
>
> The linker warning is new to Xcode 3's linker, and not specific to g95.
> It is (correctly) warning that there are two libz's on the path. On
> startup, MATLAB's libz is loaded first, and MATLAB requires this version
> for correct operation. It happens to be the same version (1.2.3)
> currently provided by both Tiger and Leopard.
>
> Brian
>
>
> Ben Abbott wrote:
> > Update:
> >
> > Fink now has g95 for Leopard available.
> >
> > http://pdb.finkproject.org/pdb/package.php/g95
> >
> > I haven't done much with it, but I did try one of Mathwork's examples.
> >
> >>> mex yprimef.F yprimefg.F
> > ld: warning, duplicate dylib
> > /Applications/MATLAB_R2007b/bin/maci/libz.1.dylib
> >>> yprimef(1,1:4)
> >
> > ans =
> >
> > 2.0000 8.9685 4.0000 -1.0947
> >
> >
> > In spite of the linker warning, it appears to work!
> >
> > Ben
> >
> >

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
leopard Ben Abbott 2 Jan, 2008 22:50:04
mexmac Ben Abbott 2 Jan, 2008 22:50:04
mex Ben Abbott 2 Jan, 2008 22:50:04
mac os x Ben Abbott 29 Dec, 2007 07:40:07
g95 Ben Abbott 29 Dec, 2007 07:40:06
gfortran Ben Abbott 29 Dec, 2007 07:40:06
mexmaci Ben Abbott 29 Dec, 2007 07:40:06
g95 ifort mex l... Ibon 2 Nov, 2007 19:31:07
macosx leopard ... Ibon 31 Oct, 2007 10:40:24
rssFeed for this Thread

Contact us at files@mathworks.com