mirror of https://github.com/lammps/lammps.git
Merge branch 'fetch-potentials' into feature-cnt
This commit is contained in:
commit
d61d8899ff
|
@ -126,7 +126,7 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE
|
|||
REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK USER-COLVARS
|
||||
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB
|
||||
USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
|
||||
USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
|
||||
USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION
|
||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
|
||||
USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS USER-MESONT)
|
||||
|
@ -365,6 +365,15 @@ target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
|
|||
include(StyleHeaderUtils)
|
||||
RegisterStyles(${LAMMPS_SOURCE_DIR})
|
||||
|
||||
########################################################
|
||||
# Fetch missing external files and archives for packages
|
||||
########################################################
|
||||
foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES})
|
||||
if(PKG_${PKG})
|
||||
FetchPotentials(${LAMMPS_SOURCE_DIR}/${PKG} ${LAMMPS_POTENTIALS_DIR})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
##############################################
|
||||
# add sources of enabled packages
|
||||
############################################
|
||||
|
|
|
@ -85,3 +85,20 @@ function(GenerateBinaryHeader varname outfile files)
|
|||
file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n")
|
||||
endforeach()
|
||||
endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
function(FetchPotentials pkgfolder potfolder)
|
||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||
set(LAMMPS_POTENTIALS_URL "https://download.lammps.org/potentials")
|
||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||
foreach(line ${linelist})
|
||||
string(FIND ${line} " " blank)
|
||||
math(EXPR plusone "${blank}+1")
|
||||
string(SUBSTRING ${line} 0 ${blank} pot)
|
||||
string(SUBSTRING ${line} ${plusone} -1 sum)
|
||||
message(STATUS "Checking external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
||||
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${LAMMPS_POTENTIALS_DIR}/${pot}"
|
||||
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction(FetchPotentials)
|
||||
|
|
|
@ -126,7 +126,7 @@ if(GPU_API STREQUAL "CUDA")
|
|||
elseif(GPU_API STREQUAL "OPENCL")
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
# download and unpack support binaries for compilation of windows binaries.
|
||||
set(LAMMPS_THIRDPARTY_URL "http://download.lammps.org/thirdparty")
|
||||
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty")
|
||||
file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz"
|
||||
EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
|
|
@ -9,7 +9,7 @@ if(DOWNLOAD_EIGEN3)
|
|||
message(STATUS "Eigen3 download requested - we will build our own")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(Eigen3_build
|
||||
URL http://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
|
||||
URL https://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
|
||||
URL_MD5 f2a417d083fe8ca4b8ed2bc613d20f07
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||
)
|
||||
|
|
|
@ -118,7 +118,7 @@ This pair style can only be used via the *pair* keyword of the
|
|||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This style is part of the USER-MISC package. It is only
|
||||
This style is part of the USER-MESONT package. It is only
|
||||
enabled if LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
|
||||
This pair potential requires the :doc:`newton <newton>` setting to be
|
||||
|
|
|
@ -78,7 +78,7 @@ if pathflag:
|
|||
if buildflag:
|
||||
print("Downloading Eigen ...")
|
||||
eigentar = os.path.join(homepath, tarball)
|
||||
url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version
|
||||
url = "https://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version
|
||||
geturl(url, eigentar)
|
||||
|
||||
# verify downloaded archive integrity via md5 checksum, if known.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
C_10_10.mesocnt
|
2006011
potentials/C_10_10.mesocnt
2006011
potentials/C_10_10.mesocnt
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,40 @@
|
|||
# transparently fetch external files for a given package
|
||||
|
||||
fetch_potentials() {
|
||||
pdir="$1"
|
||||
shift
|
||||
|
||||
type curl > /dev/null 2>&1 && have_curl=1 || have_curl=0
|
||||
type wget > /dev/null 2>&1 && have_wget=1 || have_wget=0
|
||||
if [ $have_curl -ne 1 ] && [ $have_wget -ne 1 ]
|
||||
then \
|
||||
echo "Need 'curl' or 'wget' to fetch external potential files"
|
||||
return
|
||||
fi
|
||||
|
||||
while [ $# -gt 1 ]
|
||||
do \
|
||||
file=$1; sum=$2
|
||||
shift; shift
|
||||
|
||||
echo ${sum} ${pdir}/${file} | md5sum -c - > /dev/null 2>&1 \
|
||||
&& need_fetch=0 || need_fetch=1
|
||||
if [ ${need_fetch} -eq 1 ]
|
||||
then \
|
||||
url="https://download.lammps.org/potentials/${file}.${sum}"
|
||||
echo "Fetching external potential file ${file} from ${url}"
|
||||
if [ ${have_curl} ]
|
||||
then \
|
||||
curl -L -o ${pdir}/${file} ${url}
|
||||
elif [ ${have_wget} ]
|
||||
then \
|
||||
wget -O ${pdir}/${file} ${url}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ -f "$1/potentials.txt" ]
|
||||
then
|
||||
fetch_potentials "$1/../../potentials" `sed -e 's/#.*$//' "$1/potentials.txt"`
|
||||
fi
|
|
@ -280,7 +280,7 @@ install-python:
|
|||
tar:
|
||||
@cd STUBS; $(MAKE) clean
|
||||
@cd ..; tar cvzf src/$(ROOT)_src.tar.gz \
|
||||
src/Make* src/Package.sh src/Depend.sh src/Install.sh \
|
||||
src/Make* src/Package.sh src/Depend.sh src/Install.sh src/Fetch.sh \
|
||||
src/MAKE src/DEPEND src/*.cpp src/*.h src/STUBS \
|
||||
$(patsubst %,src/%,$(PACKAGEUC)) $(patsubst %,src/%,$(PACKUSERUC)) \
|
||||
--exclude=*/.svn
|
||||
|
@ -369,6 +369,7 @@ yes-%:
|
|||
cd $(YESDIR); $(SHELL) ../Install.sh 1; cd ..; \
|
||||
$(SHELL) Depend.sh $(YESDIR) 1; \
|
||||
fi;
|
||||
@$(SHELL) Fetch.sh $(YESDIR)
|
||||
|
||||
no-%:
|
||||
@if [ ! -e $(NODIR) ]; then \
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# list of potential files to be fetched when this package is installed
|
||||
# potential file md5sum
|
||||
C_10_10.mesocnt 028de73ec828b7830d762702eda571c1
|
|
@ -76,7 +76,7 @@
|
|||
#if __cplusplus == 201103L || __cplusplus == 201402L
|
||||
# if defined(__clang__)
|
||||
# define FMT_FALLTHROUGH [[clang::fallthrough]]
|
||||
# elif FMT_GCC_VERSION >= 700 && !defined(__PGI)
|
||||
# elif FMT_GCC_VERSION >= 700 && !defined(__PGI) && !defined(__INTEL_COMPILER)
|
||||
# define FMT_FALLTHROUGH [[gnu::fallthrough]]
|
||||
# else
|
||||
# define FMT_FALLTHROUGH
|
||||
|
|
Loading…
Reference in New Issue