forked from lammps/lammps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert plugin functionality into a package
- Loading branch information
Showing
16 changed files
with
198 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This directory has a Makefile.lammps file with settings that allows | ||
LAMMPS to dynamically link LAMMPS plugins. More details about this | ||
are in the manual. | ||
|
||
In order to be able to dynamically load and execute the plugins from | ||
inside LAMMPS, you need to link with a system library containing functions | ||
like dlopen(), dlsym() and so on for dynamic linking of executable code | ||
into an executable. This library is defined by setting the plugin_SYSLIB | ||
variable in the Makefile.lammps file in this dir. For this mechanism | ||
to work, LAMMPS must be built as a shared library (i.e. with mode=shared). | ||
|
||
For Linux and most current unix-like operating systems, this can be | ||
kept at the default setting of "-ldl" (on some platforms this library | ||
is called "-ldld"). The Windows platform is currently not supported. | ||
|
||
See the header of Makefile.lammps for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ DEPFLAGS = -M | |
|
||
LINK = mpicxx | ||
LINKFLAGS = -g -O3 | ||
LIB = -ldl | ||
LIB = | ||
SIZE = size | ||
|
||
ARCHIVE = ar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ DEPFLAGS = -M | |
|
||
LINK = g++ | ||
LINKFLAGS = -g -O | ||
LIB = -ldl | ||
LIB = | ||
SIZE = size | ||
|
||
ARCHIVE = ar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Install/unInstall package files in LAMMPS | ||
# mode = 0/1/2 for uninstall/install/update | ||
|
||
mode=$1 | ||
|
||
# enforce using portable C locale | ||
LC_ALL=C | ||
export LC_ALL | ||
|
||
# arg1 = file, arg2 = file it depends on | ||
|
||
action () { | ||
if (test $mode = 0) then | ||
rm -f ../$1 | ||
elif (! cmp -s $1 ../$1) then | ||
if (test -z "$2" || test -e ../$2) then | ||
cp $1 .. | ||
if (test $mode = 2) then | ||
echo " updating src/$1" | ||
fi | ||
fi | ||
elif (test -n "$2") then | ||
if (test ! -e ../$2) then | ||
rm -f ../$1 | ||
fi | ||
fi | ||
} | ||
|
||
# all package files with no dependencies | ||
|
||
for file in *.cpp *.h; do | ||
test -f ${file} && action $file | ||
done | ||
|
||
# edit 2 Makefile.package files to include/exclude package info | ||
|
||
if (test $1 = 1) then | ||
|
||
if (test -e ../Makefile.package) then | ||
sed -i -e 's/[^ \t]*plugin[^ \t]* //' ../Makefile.package | ||
sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(plugin_SYSINC) |' ../Makefile.package | ||
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(plugin_SYSLIB) |' ../Makefile.package | ||
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(plugin_SYSPATH) |' ../Makefile.package | ||
fi | ||
|
||
if (test -e ../Makefile.package.settings) then | ||
sed -i -e '/^include.*plugin.*$/d' ../Makefile.package.settings | ||
# multiline form needed for BSD sed on Macs | ||
sed -i -e '4 i \ | ||
include ..\/..\/lib\/plugin\/Makefile.lammps | ||
' ../Makefile.package.settings | ||
fi | ||
|
||
elif (test $1 = 0) then | ||
|
||
if (test -e ../Makefile.package) then | ||
sed -i -e 's/[^ \t]*plugin[^ \t]* //' ../Makefile.package | ||
fi | ||
|
||
if (test -e ../Makefile.package.settings) then | ||
sed -i -e '/^include.*plugin.*$/d' ../Makefile.package.settings | ||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This package provides a plugin command that can load LAMMPS | ||
styles linked into shared object files into a LAMMPS binary | ||
at run time without having to recompile and relink LAMMPS. | ||
For more details please see the LAMMPS manual. | ||
|
||
To be able to dynamically load and execute the plugins from inside | ||
LAMMPS, you need to link with an appropriate system library, which | ||
is done using the settings in lib/plugin/Makefile.lammps. See | ||
that file and the lib/plugin/README file for more details. | ||
|
||
The person who created this package is Axel Kohlmeyer at Temple U | ||
(akohlmey at gmail.com). Contact him directly if you have questions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.