Article View: comp.soft-sys.matlab
Article #207C++ & matlab engine, gcc versus SUNWspro cc
From: Shing-Fat Fred Ma
Date: Mon, 13 Jan 2003 08:07
Date: Mon, 13 Jan 2003 08:07
43 lines
2350 bytes
2350 bytes
Hello,
I know I can call the matlab engine from C/C++
using:
gcc -o engdemo \
-I/opt/matlab13/extern/include \
engdemo.c \
-L /opt/matlab13/extern/lib/sol2 \
-leng /opt/matlab13/bin/sol2 -lmx
But that's really a mouthful. I'd rather use the
mex script, and specify my own options. I
compared engopt.sh parameters for linux/gcc
and solaris/SUNspro-cc. I'll be using specifications
from both parameter sets, since I'm using gcc on
solaris. Some of the different parameters are easy
to resolve, since they don't necessarily have a
counter part. The hard differences to resolve are
the -D<NAME>, since they define stuff that is
meant to be recognized inside the source code
(somewhere).
For example, linux/gcc parameters include
-D_GNU_SOURCE in the compile flags,
while the SUNWspro-cc parameters include
-D__EXTENSIONS__ . Should I include
any/both of these when using gcc on solaris?
What about the linux/gcc -ansi compile flag?
It seems that the SUNWspro-cc counterpart is
one of -Xa, -Xc, -Xs, or -Xt. But none of
these show up in the SUNWspro-cc compile flags.
Thanks for any wisdom about this.
Fred
--
Fred Ma, fma@doe.carleton.ca
Carleton University, Dept. of Electronics
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6
Technical Details
Message-ID:
<3E2273CD.50300@doe.carleton.ca>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!cunews!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,5b60b5f5adec6f3a,start X-Google-Attributes: gid11318c,public X-Google-Thread: 106e3f,5b60b5f5adec6f3a,start X-Google-Attributes: gid106e3f,public X-Google-Thread: 11035d,5b60b5f5adec6f3a,start X-Google-Attributes: gid11035d,public X-Google-ArrivalTime: 2003-01-13 00:10:04 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!cunews!not-for-mail From: Shing-Fat Fred Ma <fma@doe.carleton.ca> Newsgroups: comp.soft-sys.matlab,comp.unix.solaris,gnu.gcc.help Subject: C++ & matlab engine, gcc versus SUNWspro cc Date: 13 Jan 2003 08:07:45 GMT Organization: Carleton University, Ottawa, Canada Lines: 44 Message-ID: <3E2273CD.50300@doe.carleton.ca> NNTP-Posting-Host: malawi.doe.carleton.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-Accept-Language: en-us, en