|
From: | Peter O'Gorman |
Subject: | Re: darwin/Fortran: -single_module |
Date: | Fri, 18 Nov 2005 22:53:16 +0900 |
User-agent: | Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
Ralf Wildenhues wrote:
Hello everybody, This topic starts here: http://www.lam-mpi.org/MailArchives/lam/2005/11/11516.php http://www.lam-mpi.org/MailArchives/lam/2005/11/11519.php * Jack Howarth wrote on Fri, Nov 18, 2005 at 05:28:07AM CET:I found a description of the problem I was seeing with the mpi enabled gromacs 3.3 build on MacOS X 10.4 in the following message... http://gcc.gnu.org/ml/gcc/2005-06/msg00186.html Using their suggestion, I patched gromacs as follows...+LIBS = @LIBS@ -Wl,-single_modulewhich causes the linkage of libgmx_mpi.4.dylib to avoid the -multi-module default. However the lam developers may want to look carefully at the to see if the problem can be avoided in future releases of gromacs without resorting to this hack.Libtool currently adds -single_module for C++ code only. I guess we should do that for Fortran as well. What do you think? A test for this in CVS HEAD would be cool, too..
Hi Ralf, Jack.When libtool is used to build shared libraries on darwin it pases the -fno-common flag to gcc. It is possible that Jack is trying to link a static library into a shared one, and the static library has common symbols. The solution is to rebuild the static library with -fno-common. Another solution is to initialize all variables in the static library before they are used, the rebuild it. e.g. write int foo=0; instead of int foo;
-single_module is only there for c++ because on Mac OS X 10.3 and earlier the dynamic linker would not call static initializers in tranlation units which did not have any other symbols referenced. It is not the default because nobody has persuaded me that making your shared library much more difficult to debug is worth whatever gain the -single_module flag gives.
Peter
[Prev in Thread] | Current Thread | [Next in Thread] |