Skip to content

Commit 2a234cd

Browse files
committed
Merge branch 'develop' into maintenance
# Conflicts: # USER-REBOMOS/CMakeLists.txt
2 parents fc5093c + 7dbe3f9 commit 2a234cd

File tree

14 files changed

+765
-2328
lines changed

14 files changed

+765
-2328
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ include(LAMMPSInterfacePlugin)
2020
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
2121

2222
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
23-
add_custom_target(package DEPENDS package-USER-AEAM package-USER-REBOMOS package-USER-VCSGC)
23+
add_custom_target(package DEPENDS package-USER-AEAM package-USER-BFIELD package-USER-REBOMOS)
2424
endif()
2525
add_subdirectory(USER-AEAM)
26+
add_subdirectory(USER-BFIELD)
2627
add_subdirectory(USER-REBOMOS)
27-
add_subdirectory(USER-VCSGC)

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
This repository contains source code written for LAMMPS from
22
various sources that is not part of the LAMMPS distribution
33
for a number of reasons, but ported to be compatible with the
4-
23 June 2022 LAMMPS release and converted to create plugins.
4+
2 August 2023 LAMMPS release and converted to create plugins.
55

6-
| Folders | Origin of source code |
7-
|--------------|----------------------------------------------------|
8-
| USER-AEAM | https://github.com/psaidi/AEAM |
9-
| USER-REBOMOS | https://matsci.org/t/pair-rebomos/30503 |
10-
| USER-VCSGC | https://gitlab.com/materials-modeling/vcsgc-lammps |
6+
| Folders | Origin of source code |
7+
|--------------|-----------------------------------------------------------------------------|
8+
| USER-AEAM | https://github.com/psaidi/AEAM |
9+
| USER-BFIELD | https://matsci.org/t/discrepency-beween-old-version-and-new-version/50014/5 |
10+
| USER-REBOMOS | https://matsci.org/t/pair-rebomos/30503 |
11+
12+
As of the 22 December 2022 LAMMPS release, the USER-VCSGC package
13+
code has been merged with upstream and the corresponding fix is now
14+
available in the MC package. The plugin package has thus been removed.
1115

1216
To compile and configure all plugins
1317

USER-AEAM/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,17 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
4848
set(mytarget package)
4949
endif()
5050
if(BUILD_MPI)
51-
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI aeamplugin.nsis
52-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
53-
DEPENDS aeamplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/aeamplugin.nsis
54-
BYPRODUCTS ${CMAKE_BINARY_DIR}/LAMMPS-USER-AEAM-plugin-${LAMMPS_VERSION}-MPI.exe)
51+
if(USE_MSMPI AND CMAKE_CROSSCOMPILING)
52+
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MSMPI aeamplugin.nsis
53+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
54+
DEPENDS aeamplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/aeamplugin.nsis
55+
BYPRODUCTS ${CMAKE_BINARY_DIR}/LAMMPS-USER-AEAM-plugin-${LAMMPS_VERSION}-MSMPI.exe)
56+
else()
57+
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI aeamplugin.nsis
58+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
59+
DEPENDS aeamplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/aeamplugin.nsis
60+
BYPRODUCTS ${CMAKE_BINARY_DIR}/LAMMPS-USER-AEAM-plugin-${LAMMPS_VERSION}-MPI.exe)
61+
endif()
5562
else()
5663
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION} aeamplugin.nsis
5764
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}

USER-BFIELD/CMakeLists.txt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
##########################################
2+
# CMake build system for plugin examples.
3+
# The is meant to be used as a template for plugins that are
4+
# distributed independent from the LAMMPS package.
5+
##########################################
6+
7+
cmake_minimum_required(VERSION 3.10)
8+
if(POLICY CMP0077)
9+
cmake_policy(SET CMP0077 NEW)
10+
endif()
11+
12+
project(bfieldplugin VERSION 1.0 LANGUAGES CXX)
13+
14+
if(NOT LAMMPS_SOURCE_DIR)
15+
message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR variable")
16+
endif()
17+
set(CMAKE_MODULE_PATH "${LAMMPS_SOURCE_DIR}/../cmake/Modules")
18+
if (NOT TARGET lammps)
19+
include(CheckIncludeFileCXX)
20+
include(LAMMPSInterfacePlugin)
21+
endif()
22+
23+
##########################
24+
# building the plugins
25+
26+
add_library(bfieldplugin MODULE bfieldplugin.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fix_bfield.cpp)
27+
target_link_libraries(bfieldplugin PRIVATE lammps)
28+
set_target_properties(bfieldplugin PROPERTIES PREFIX "" SUFFIX ".so")
29+
30+
# MacOS seems to need this
31+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
32+
set_target_properties(bfieldplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
33+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
34+
# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers
35+
set_target_properties(bfieldplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
36+
if(CMAKE_CROSSCOMPILING)
37+
set_target_properties(bfieldplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
38+
endif()
39+
40+
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
41+
find_program(MAKENSIS_PATH makensis)
42+
if(MAKENSIS_PATH)
43+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../lammps.ico
44+
${CMAKE_CURRENT_SOURCE_DIR}/../lammps-text-logo-wide.bmp ${CMAKE_CURRENT_SOURCE_DIR}/bfieldplugin.nsis ${CMAKE_BINARY_DIR})
45+
if(TARGET package)
46+
set(mytarget package-USER-BFIELD)
47+
else()
48+
set(mytarget package)
49+
endif()
50+
if(BUILD_MPI)
51+
if(USE_MSMPI AND CMAKE_CROSSCOMPILING)
52+
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MSMPI bfieldplugin.nsis
53+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
54+
DEPENDS bfieldplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/bfieldplugin.nsis
55+
BYPRODUCTS ${CMAKE_BINARY_DIR}/LAMMPS-USER-BFIELD-plugin-${LAMMPS_VERSION}-MSMPI.exe)
56+
else()
57+
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI bfieldplugin.nsis
58+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
59+
DEPENDS bfieldplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/bfieldplugin.nsis
60+
BYPRODUCTS ${CMAKE_BINARY_DIR}/LAMMPS-USER-BFIELD-plugin-${LAMMPS_VERSION}-MPI.exe)
61+
endif()
62+
else()
63+
add_custom_target(${mytarget} ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION} bfieldplugin.nsis
64+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
65+
DEPENDS bfieldplugin ${CMAKE_BINARY_DIR}/lammps.ico ${CMAKE_BINARY_DIR}/lammps-text-logo-wide.bmp ${CMAKE_BINARY_DIR}/bfieldplugin.nsis
66+
BYPRODUCTS LAMMPS-USER-BFIELD-plugin-${LAMMPS_VERSION}.exe)
67+
endif()
68+
endif()
69+
else()
70+
set_target_properties(bfieldplugin PROPERTIES LINK_FLAGS "-rdynamic")
71+
endif()
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11

22
#include "lammpsplugin.h"
3+
34
#include "version.h"
45

5-
#include "fix_semigrandcanonical_mc.h"
6+
#include "fix_bfield.h"
67

78
using namespace LAMMPS_NS;
89

9-
static Fix *fix_vcscg_creator(LAMMPS *lmp, int argc, char **argv)
10+
static Fix *bfieldcreator(LAMMPS *lmp, int argc, char **argv)
1011
{
11-
return new FixSemiGrandCanonicalMC(lmp, argc, argv);
12+
return new FixBfield(lmp, argc, argv);
1213
}
1314

1415
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
1516
{
1617
lammpsplugin_t plugin;
1718
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
1819

19-
// register pace pair style
20+
// register bfield fix style
2021
plugin.version = LAMMPS_VERSION;
2122
plugin.style = "fix";
22-
plugin.name = "sgcmc";
23-
plugin.info = "VCSGC plugin fix style v1.0";
23+
plugin.name = "bfield";
24+
plugin.info = "fix bfield plugin v1.0";
2425
plugin.author = "Axel Kohlmeyer ([email protected])";
25-
plugin.creator.v2 = (lammpsplugin_factory2 *) &fix_vcscg_creator;
26+
plugin.creator.v2 = (lammpsplugin_factory2 *) &bfieldcreator;
2627
plugin.handle = handle;
2728
(*register_plugin)(&plugin, lmp);
2829
}

USER-VCSGC/vcsgcplugin.nsis renamed to USER-BFIELD/bfieldplugin.nsis

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ ${If} $0 != "admin"
3131
${EndIf}
3232
!macroend
3333

34-
!define VCSGCPLUGIN "LAMMPS USER-VCSGC Plugin ${VERSION}"
35-
OutFile "LAMMPS-USER-VCSGC-plugin-${VERSION}.exe"
34+
!define BFIELDPLUGIN "LAMMPS USER-BFIELD Plugin ${VERSION}"
35+
OutFile "LAMMPS-USER-BFIELD-plugin-${VERSION}.exe"
3636

37-
Name "${VCSGCPLUGIN}"
38-
InstallDir "$LOCALAPPDATA\${VCSGCPLUGIN}"
37+
Name "${BFIELDPLUGIN}"
38+
InstallDir "$LOCALAPPDATA\${BFIELDPLUGIN}"
3939

4040
ShowInstDetails show
4141
ShowUninstDetails show
@@ -55,7 +55,7 @@ function .onInit
5555
# Determine if LAMMPS was already installed and check whether it was in 32-bit
5656
# or 64-bit. Then look up path to uninstaller and offer to uninstall or quit
5757
SetRegView 32
58-
ReadRegDWORD $0 HKCU "Software\LAMMPS-USER-VCSGC" "Bits"
58+
ReadRegDWORD $0 HKCU "Software\LAMMPS-USER-BFIELD" "Bits"
5959
SetRegView LastUsed
6060
${If} $0 == "32"
6161
SetRegView 32
@@ -65,12 +65,12 @@ function .onInit
6565
SetRegView 64
6666
${EndIf}
6767
ClearErrors
68-
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" "UninstallString"
68+
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" "UninstallString"
6969
SetRegView LastUsed
7070
${If} ${Errors}
71-
DetailPrint "LAMMPS USER-VCSGC plugin not (yet) installed"
71+
DetailPrint "LAMMPS USER-BFIELD plugin not (yet) installed"
7272
${Else}
73-
MessageBox MB_YESNO "LAMMPS USER-VCSGC plugin ($0 bit) is already installed. Uninstall existing version?" /SD IDYES IDNO Quit
73+
MessageBox MB_YESNO "LAMMPS USER-BFIELD plugin ($0 bit) is already installed. Uninstall existing version?" /SD IDYES IDNO Quit
7474
Pop $R1
7575
StrCmp $R1 2 Quit +1
7676
Exec $R0
@@ -80,42 +80,42 @@ function .onInit
8080
setShellVarContext all
8181
functionEnd
8282

83-
Section "${VCSGCPLUGIN}" SecVcsgcplugin
83+
Section "${BFIELDPLUGIN}" SecPaceplugin
8484
SectionIn RO
8585
# Write LAMMPS installation bitness marker. Always use 32-bit registry view
8686
SetRegView 32
8787
IntFmt $0 "0x%08X" 64
88-
WriteRegDWORD HKCU "Software\LAMMPS-USER-VCSGC" "Bits" $0
88+
WriteRegDWORD HKCU "Software\LAMMPS-USER-BFIELD" "Bits" $0
8989

9090
# Switch to "native" registry view
9191
SetRegView 64
9292
SetShellVarContext current
9393

9494
SetOutPath "$INSTDIR"
9595
File lammps.ico
96-
File vcsgcplugin.so
96+
File bfieldplugin.so
9797

9898
# Register Application and its uninstaller
99-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
100-
"DisplayName" "${VCSGCPLUGIN}"
101-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
102-
"Publisher" "The LAMMPS and USER-VCSGC Developers"
103-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
104-
"URLInfoAbout" "vcsgc-lammps.materialsmodeling.org"
105-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
99+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
100+
"DisplayName" "${BFIELDPLUGIN}"
101+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
102+
"Publisher" "The LAMMPS and USER-BFIELD Developers"
103+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
104+
"URLInfoAbout" "lammps.org"
105+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
106106
"DisplayIcon" "$INSTDIR\lammps.ico"
107-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
107+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
108108
"DisplayVersion" "${VERSION}"
109-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
109+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
110110
"InstallLocation" "$INSTDIR"
111-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
111+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
112112
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
113-
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
113+
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
114114
"QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
115115

116116
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
117117
IntFmt $0 "0x%08X" $0
118-
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC" \
118+
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD" \
119119
"EstimatedSize" "$0"
120120

121121
# update path variables
@@ -133,20 +133,20 @@ functionEnd
133133
Section "Uninstall"
134134
# remove LAMMPS bitness/installation indicator always in 32-bit registry view
135135
SetRegView 32
136-
DeleteRegKey HKCU "Software\LAMMPS-USER-VCSGC"
136+
DeleteRegKey HKCU "Software\LAMMPS-USER-BFIELD"
137137

138138
# unregister extension, and uninstall info
139139
SetRegView 64
140140
SetShellVarContext current
141141
# unregister installation
142-
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-VCSGC"
142+
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-USER-BFIELD"
143143

144144
# update path variables
145145
EnVar::SetHKCU
146146
# remove entry from LAMMPS plugin search path
147147
EnVar::DeleteValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
148148

149-
Delete /REBOOTOK "$INSTDIR\vcsgcplugin.so"
149+
Delete /REBOOTOK "$INSTDIR\bfieldplugin.so"
150150
Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
151151
Delete /REBOOTOK "$INSTDIR\lammps.ico"
152152
RMDir /REBOOTOK "$INSTDIR"

0 commit comments

Comments
 (0)