[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mkoctfile problems with Octave 3.4.0, OSX 10.6.7
From: |
Julien Salort |
Subject: |
Re: mkoctfile problems with Octave 3.4.0, OSX 10.6.7 |
Date: |
Thu, 21 Apr 2011 21:23:29 +0200 |
Le 21 avr. 2011 à 21:11, Scott Wardle a écrit :
> Hello Julien,
>
> Thanks for the latest build. However, when using mkoctfile with the --mex
> option (which I invoke using the "mex" command),
> I'm still getting these warning and these undefined symbols:
>
> octave-3.4.0:7> mex bitparitycheck.c -o bit_parity_check.mex
> ld: warning: in /Applications/Octave.app/Contents/Resources/bin/octave-3.4.0,
> file was built for i386 which is not the architecture being linked (x86_64)
> Perhaps these undefined symbols are due to the wrong architecture (x86_64) as
> opposed to i386?
This is definitely the problem.
It is important to pass -arch i386 to both the compiler and the linker,
otherwise -arch x86_64 is chosen by default.
Since octave and its libraries are compiled for i386, this can't work.
I've added -arch i386 everywhere I've thought of at octave compile time (ie.
CFLAGS, FFLAGS, LDFLAGS, CXXFLAGS) and checked that they were still there in
pkg.m and mkoctfile and mkoctfile-3.4.0 shell scripts. Compiling packages and
oct files works here and the -arch option is everywhere:
% ./mkoctfile --print ALL_CFLAGS
-I/Applications/Octave.app/Contents/Resources/include/octave-3.4.0/octave/..
-I/Applications/Octave.app/Contents/Resources/include/octave-3.4.0/octave
-I/Applications/Octave.app/Contents/Resources/include -O1 -g -isysroot
/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch i386 -msse3
-msse2 -msse -sse -sse2 -m32
-I/Applications/Octave.app/Contents/Resources/include
-I/usr/X11/include/fontconfig
-I/Applications/Octave.app/Contents/Resources/include/readline -D_THREAD_SAFE
-pthread
% ./mkoctfile --print ALL_LDFLAGS
-fPIC -arch i386 -L/Applications/Octave.app/Contents/Resources/lib
-B/Applications/Octave.app/Contents/Resources/lib/gcc -L/usr/lib -lz -lbz2
-lxml2
I don't understand why mkoctfile calls the right arguments when compiling oct
file and not when compiling mex file.
- Can you send me a code snippet example of mex files so that I can try it too ?
(I've never used MEX files, only OCT files personally)
Julien