Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/adobe/css-tools-4.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andeplane authored Sep 15, 2024
2 parents 19d8d9f + 15b82a6 commit 8d0738c
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 183 deletions.
2 changes: 1 addition & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LAMMPS_OBJ_FILES := $(addprefix obj/,$(notdir $(LAMMPS_SOURCE:.cpp=.o)))
#LD_FLAGS := -O1 --pre-js locateFile.js --no-entry -gsource-map --source-map-base="http://localhost:3000/atomify/" -lembind
#CC_FLAGS := -O0 -DLAMMPS_EXCEPTIONS -DLAMMPS_SMALLSMALL -gsource-map # -DNDEBUG
LD_FLAGS := -Oz --pre-js locateFile.js --no-entry -lembind
CC_FLAGS := -Oz -DLAMMPS_EXCEPTIONS -DLAMMPS_SMALLSMALL -s NO_DISABLE_EXCEPTION_CATCHING=1
CC_FLAGS := -Oz -DLAMMPS_EXCEPTIONS -DLAMMPS_SMALLSMALL -s NO_DISABLE_EXCEPTION_CATCHING=1 -DCOLVARS_LAMMPS
INCLUDE_FLAGS := -Ilammps/src
SYMBOLS := -s ENVIRONMENT='web' \
-s NO_DISABLE_EXCEPTION_CATCHING=1 \
Expand Down
9 changes: 8 additions & 1 deletion cpp/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def copy_mpi_files_and_patch():
shutil.copyfile("lammpsweb/fix_atomify.cpp", "lammps/src/fix_atomify.cpp")
shutil.copyfile("lammpsweb/fix_atomify.h", "lammps/src/fix_atomify.h")

def copy_colvars_files():
colvars_lib_dir = 'lammps/lib/colvars'
for file in os.listdir(colvars_lib_dir):
if file.endswith('.h') or file.endswith('.cpp'):
shutil.copyfile(f"{colvars_lib_dir}/{file}", f"lammps/src/{file}")

def file_content(path):
if not os.path.exists(path):
return ""
Expand Down Expand Up @@ -50,14 +56,15 @@ def copy_voronoi_files():
copy_mpi_files_and_patch() # First compile, it is not with emscripten, so we should not include lammpsweb
copy_moltemplate_files()
copy_voronoi_files()
copy_colvars_files()

cwd = os.getcwd()
print("Changing directory ...")
os.chdir('lammps/src')
print("Applying patch ...")
subprocess.call("git apply lammps.patch", shell=True)
print("Installing LAMMPS packages ...")
subprocess.call("make yes-rigid yes-class2 yes-manybody yes-mc yes-molecule yes-granular yes-kspace yes-shock yes-misc yes-qeq yes-reaxff yes-extra-molecule yes-voronoi", shell=True)
subprocess.call("make yes-rigid yes-class2 yes-manybody yes-mc yes-molecule yes-granular yes-kspace yes-shock yes-misc yes-qeq yes-reaxff yes-extra-molecule yes-voronoi yes-colvars", shell=True)

if os.path.isfile('fix_imd.cpp'):
print("Deleting non-functioning files fix_imd ...")
Expand Down
Loading

0 comments on commit 8d0738c

Please sign in to comment.