Hi,
I just built amber12 with configure -mpi pgi,
and i think configure is performing sensibly:
it all boils down to what one's mpif90 does - in the unusual case
that mpi was built to force static linking then that will be reflected
in amber's building since it uses mpif90.
Specific comments below.
On Mon, Aug 02, 2010 at 08:07:16PM -0400, case wrote:
> On Mon, Aug 02, 2010, Lachele Foley wrote:
> > Some local folks are installing Amber for us to use on a Dell system running RHEL 4 with Xeon cpu's & PGI compilers.
> >
> > I got the following question, and I don't know how to answer. Obviously, she thinks the -mpi pgi option is compiling statically by default. I agree with her that it shouldn't be. I'm trusting that she knows her system well enough to know how the compilation happened.
To reiterate my above, i see no evidence that configure -mpi pgi
forces static linking.
> > ==============================================
> > I was just wondering if you know how I can easily configure
> > the Amber11 installation to use shared libraries. When I look
> > at the configure file in the AmberTools/src directory, it seems
> > to me that the default compilation should use shared libs and
> > the addition of the -static option would cause static linking.
> > However, I configured with
> >
> > ./configure -mpi pgi
> >
> > and the build uses static linking. I guess I could change the
> > config.h file manually to add -fPIC in the appropriate flags
this does not seem necessary:
-fpic (Linux only) Instructs the compiler to generate position-
independent code which can be used to create shared object files
(dynamically linked libraries).
> > and -shared in the final link step, but I thought perhaps there
this does not seem necessary:
-shared
(Linux only) Passed to the linker. Instructs the linker to generate
a shared object file (dynamically linked library). Implies -fpic.
> > is already an option to get this configuration done automatically.
>
> When it sees "-static", Amber's configure script adds "-Bstatic" to the pgi
> loader flags, and not much else. The opposite of "-Bstatic" for pgi seems
> to be "-Bdynamic". I'm not clear on the distinction pgi makes between
> "shared" and "dynamic", but my ignorance is not very surprising.
it seems to me that amber's configure's behavior is sensible:
-Bstatic
(Linux only) Passed to the linker to specify static binding.
-Bstatic_pgi
(Linux only) Statically link in the PGI libraries, while using
dynamic linking for the system libraries; implies -Mnorpath.
-Mrpath (default) -Mnorpath
The default is to add -rpath to the link line giving the
directories containing the PGI shared objects. Use -Mnorpath to
instruct the driver not to add any -rpath switches to the link
line.
> The short answer is that editing the config.h file as outlined above is
> what is needed here, and in other cases where our configure script doesn't do
> the right thing. We also welcome suggestions from users about what the
> configure script *should* do, especially since I don't think many Amber
> developers are using PGI.
my answer is that the installers mpi is the source of their static/dynamic
problems.
scott
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Fri Aug 27 2010 - 22:30:03 PDT