From: James on
Hello,

I have MEX code I want to compile for use on RedHat, which uses GCC 4.1 and libgfortran1. I want to do the compile with GCC 4.4.1 on my Ubuntu box, and be able to just copy the MEX file over. (The reasons I want to do this particular set of operations isn't all that important, lets just say I have to do it this way). Right now, GCC 4.4.1 links to shared versions of libgfortran2 or libgfortran3, depending. Is there a way to force the MEX file to use NO shared libraries at all? I've tried a couple GCC options like --no-shared and --static-only (or similar, I don't them in front me as I write this), but this does not do it.

I assume part of the problem could be that I don't have static (lib*.a) versions of libgfortran, any hints on how I can go about getting it? Its not in the repo-provided files, or in the Hardy CD install like it was supposed to be, and I'd rather not end up compiling GCC/gfortran from source.

I also thought about compiling with GCC 4.1 on my Ubuntu box, but of course it does not use libgfortran1 like the RedHat version of GCC 4.1, and I haven't had much luck wading through the GCC CVS to try to find it and then compile it.

Bottom line: How can I compile with only static libraries so that the MEX code is entirely self-contained in terms of libraries, except for maybe the MEX library for use on two computers that don't share GCC/libgfortran versions.

Thanks!