From 53906b5f968531f135db166f2739ed143273a4c7 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 11 Mar 2015 15:27:19 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13222 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Section_python.html | 3 +-- doc/Section_python.txt | 3 +-- doc/Section_start.html | 48 ++++++++++++++++++----------------------- doc/Section_start.txt | 48 ++++++++++++++++++----------------------- doc/variable.html | 2 +- doc/variable.txt | 2 +- 6 files changed, 46 insertions(+), 60 deletions(-) diff --git a/doc/Section_python.html b/doc/Section_python.html index 82addb5052..efacb615c5 100644 --- a/doc/Section_python.html +++ b/doc/Section_python.html @@ -86,8 +86,7 @@ this is a library file that ends in ".so", not ".a".

From the src directory, type

-
make makeshlib
-make -f Makefile.shlib foo 
+
make foo mode=shlib 
 

where foo is the machine target name, such as linux or g++ or serial. This should create the file liblammps_foo.so in the src directory, as diff --git a/doc/Section_python.txt b/doc/Section_python.txt index 7be127ef9f..edf4e0e128 100644 --- a/doc/Section_python.txt +++ b/doc/Section_python.txt @@ -82,8 +82,7 @@ this is a library file that ends in ".so", not ".a". From the src directory, type -make makeshlib -make -f Makefile.shlib foo :pre +make foo mode=shlib :pre where foo is the machine target name, such as linux or g++ or serial. This should create the file liblammps_foo.so in the src directory, as diff --git a/doc/Section_start.html b/doc/Section_start.html index 98e33fc5f7..a9b63ac6e4 100644 --- a/doc/Section_start.html +++ b/doc/Section_start.html @@ -1048,50 +1048,44 @@ more info on wrapping and running LAMMPS from Python.

To build LAMMPS as a static library (*.a file on Linux), type

-
make makelib
-make -f Makefile.lib foo 
+
make foo mode=lib 
 

where foo is the machine name. This kind of library is typically used to statically link a driver application to LAMMPS, so that you can -insure all dependencies are satisfied at compile time. Note that -inclusion or exclusion of any desired optional packages should be done -before typing "make makelib". The first "make" command will create a -current Makefile.lib with all the file names in your src dir. The -second "make" command will use it to build LAMMPS as a static library, -using the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The -build will create the file liblammps_foo.a which another application can -link to. +insure all dependencies are satisfied at compile time. This will use +the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The build +will create the file liblammps_foo.a which another application can +link to. It will also create a soft link liblammps.a, which will +point to the most recently built static library.

Shared library:

To build LAMMPS as a shared library (*.so file on Linux), which can be dynamically loaded, e.g. from Python, type

-
make makeshlib
-make -f Makefile.shlib foo 
+
make foo mode=shlib 
 

where foo is the machine name. This kind of library is required when wrapping LAMMPS with Python; see Section_python -for details. Again, note that inclusion or exclusion of any desired -optional packages should be done before typing "make makelib". The -first "make" command will create a current Makefile.shlib with all the -file names in your src dir. The second "make" command will use it to -build LAMMPS as a shared library, using the SHFLAGS and SHLIBFLAGS -settings in src/MAKE/Makefile.foo. The build will create the file -liblammps_foo.so which another application can link to dyamically. It -will also create a soft link liblammps.so, which the Python wrapper uses -by default. +for details. This will use the SHFLAGS and SHLIBFLAGS settings in +src/MAKE/Makefile.foo and perform the build in the directory +Obj_shared_foo. This is so that each file can be compiled with the +-fPIC flag which is required for inclusion in a shared library. The +build will create the file liblammps_foo.so which another application +can link to dyamically. It will also create a soft link liblammps.so, +which will point to the most recently built shared library. This is +the file the Python wrapper loads by default.

Note that for a shared library to be usable by a calling program, all the auxiliary libraries it depends on must also exist as shared libraries. This will be the case for libraries included with LAMMPS, such as the dummy MPI library in src/STUBS or any package libraries in -lib/packges, since they are always built as shared libraries with the --fPIC switch. However, if a library like MPI or FFTW does not exist -as a shared library, the second make command will generate an error. -This means you will need to install a shared library version of the -package. The build instructions for the library should tell you how -to do this. +lib/packages, since they are always built as shared libraries using +the -fPIC switch. However, if a library like MPI or FFTW does not +exist as a shared library, the shared library build will generate an +error. This means you will need to install a shared library version +of the auxiliary library. The build instructions for the library +should tell you how to do this.

As an example, here is how to build and install the MPICH library, a popular open-source version of MPI, distributed by diff --git a/doc/Section_start.txt b/doc/Section_start.txt index 544004e8de..a33f41b9ae 100644 --- a/doc/Section_start.txt +++ b/doc/Section_start.txt @@ -1040,50 +1040,44 @@ more info on wrapping and running LAMMPS from Python. To build LAMMPS as a static library (*.a file on Linux), type -make makelib -make -f Makefile.lib foo :pre +make foo mode=lib :pre where foo is the machine name. This kind of library is typically used to statically link a driver application to LAMMPS, so that you can -insure all dependencies are satisfied at compile time. Note that -inclusion or exclusion of any desired optional packages should be done -before typing "make makelib". The first "make" command will create a -current Makefile.lib with all the file names in your src dir. The -second "make" command will use it to build LAMMPS as a static library, -using the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The -build will create the file liblammps_foo.a which another application can -link to. +insure all dependencies are satisfied at compile time. This will use +the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The build +will create the file liblammps_foo.a which another application can +link to. It will also create a soft link liblammps.a, which will +point to the most recently built static library. [Shared library:] :h5 To build LAMMPS as a shared library (*.so file on Linux), which can be dynamically loaded, e.g. from Python, type -make makeshlib -make -f Makefile.shlib foo :pre +make foo mode=shlib :pre where foo is the machine name. This kind of library is required when wrapping LAMMPS with Python; see "Section_python"_Section_python.html -for details. Again, note that inclusion or exclusion of any desired -optional packages should be done before typing "make makelib". The -first "make" command will create a current Makefile.shlib with all the -file names in your src dir. The second "make" command will use it to -build LAMMPS as a shared library, using the SHFLAGS and SHLIBFLAGS -settings in src/MAKE/Makefile.foo. The build will create the file -liblammps_foo.so which another application can link to dyamically. It -will also create a soft link liblammps.so, which the Python wrapper uses -by default. +for details. This will use the SHFLAGS and SHLIBFLAGS settings in +src/MAKE/Makefile.foo and perform the build in the directory +Obj_shared_foo. This is so that each file can be compiled with the +-fPIC flag which is required for inclusion in a shared library. The +build will create the file liblammps_foo.so which another application +can link to dyamically. It will also create a soft link liblammps.so, +which will point to the most recently built shared library. This is +the file the Python wrapper loads by default. Note that for a shared library to be usable by a calling program, all the auxiliary libraries it depends on must also exist as shared libraries. This will be the case for libraries included with LAMMPS, such as the dummy MPI library in src/STUBS or any package libraries in -lib/packges, since they are always built as shared libraries with the --fPIC switch. However, if a library like MPI or FFTW does not exist -as a shared library, the second make command will generate an error. -This means you will need to install a shared library version of the -package. The build instructions for the library should tell you how -to do this. +lib/packages, since they are always built as shared libraries using +the -fPIC switch. However, if a library like MPI or FFTW does not +exist as a shared library, the shared library build will generate an +error. This means you will need to install a shared library version +of the auxiliary library. The build instructions for the library +should tell you how to do this. As an example, here is how to build and install the "MPICH library"_mpich, a popular open-source version of MPI, distributed by diff --git a/doc/variable.html b/doc/variable.html index 0efada5337..867744dc42 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -147,7 +147,7 @@ since it evaluates another variable when it is invoked.

IMPORTANT NOTE: When a variable command is encountered in the input script and the variable name has already been specified, the command is ignored. This means variables can NOT be re-defined in an input -script (with 2 exceptions, read further). This is to allow an input +script (with two exceptions, read further). This is to allow an input script to be processed multiple times without resetting the variables; see the jump or include commands. It also means that using the command-line switch diff --git a/doc/variable.txt b/doc/variable.txt index 30d9da6525..1655b4269e 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -141,7 +141,7 @@ since it evaluates another variable when it is invoked. IMPORTANT NOTE: When a variable command is encountered in the input script and the variable name has already been specified, the command is ignored. This means variables can NOT be re-defined in an input -script (with 2 exceptions, read further). This is to allow an input +script (with two exceptions, read further). This is to allow an input script to be processed multiple times without resetting the variables; see the "jump"_jump.html or "include"_include.html commands. It also means that using the "command-line switch"_Section_start.html#start_7