Article View: comp.soft-sys.matlab
Article #202Re: g++: Shared library, mapfiles, execution speed
From: Fred Ma
Date: Fri, 14 Mar 2003 16:17
Date: Fri, 14 Mar 2003 16:17
35 lines
3120 bytes
3120 bytes
Cheryl Jones wrote: > The gccopts for sol2 in R13 uses the compiler to link. It is always > better to use the compiler to link because only the compiler knows what > libraries it wants to link against. > > The map file shipped with MATLAB is used to mark only the functions > mexFunction and mexVersion as accessible from outside the MEX > executable. It does not affect runtime at all. You can successfully > build MEX-files without using it. I need the mexFunction gateway function. I guess one could do without it, if one were a guru in under-the-hood details of interfacing matlab and C/C++, so that excludes me. > On Solaris, you can build shared libraries that are not pic but in the > distant past I have gotten into trouble with them so since that time, > MEX-files by default are built pic. SUN's always builds their own > shared libraries as pic. Yes, I was thinking of PIC and shared libraries as synonymous, even though I am told that they are not. I'm not too interested in their differences, I was just curious about whether my code will run any slower when compiled via the mex way, but I'll find out once I've finished recoding (getting familiar with passing/returning structs and extracting parameters, changing all references to cout and cerr to use matlab printing functions, changing all exit(EXIT_FAILURES) to throws that are caught by my toplevel function, etc..). I was hoping to get an idea of whether the interfacing was all worth it, since my matlab modules only do graphing to monitor progress, and digesting results returned by many runs of my C++ number cruncher. Responses in the other newsgroups seem to indicate that PIC doesn't adversely affect speed. Fred
Technical Details
Message-ID:
<3E72008C.278477DD@doe.carleton.ca>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mailReferences:
<3E70F170.B4EE8B07@doe.carleton.ca> <3E71FA77.7050803@mathworks.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,e2dd6c17ce56ca38 X-Google-Attributes: gid11318c,public X-Google-Thread: 106e3f,e2dd6c17ce56ca38 X-Google-Attributes: gid106e3f,public X-Google-Thread: fc89c,e2dd6c17ce56ca38 X-Google-Attributes: gidfc89c,public X-Google-Thread: 11035d,e2dd6c17ce56ca38 X-Google-Attributes: gid11035d,public X-Google-ArrivalTime: 2003-03-14 08:25:01 PST Message-ID: <3E72008C.278477DD@doe.carleton.ca> From: Fred Ma <fma@doe.carleton.ca> X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.soft-sys.matlab,gnu.gcc.help,comp.unix.programmer,comp.unix.solaris Subject: Re: g++: Shared library, mapfiles, execution speed References: <3E70F170.B4EE8B07@doe.carleton.ca> <3E71FA77.7050803@mathworks.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 36 Date: Fri, 14 Mar 2003 11:17:16 -0500 NNTP-Posting-Host: 64.230.51.92 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1047658860 64.230.51.92 (Fri, 14 Mar 2003 11:21:00 EST) NNTP-Posting-Date: Fri, 14 Mar 2003 11:21:00 EST Organization: Bell Sympatico Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail