Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes

This commit is contained in:
Axel Kohlmeyer 2020-09-20 19:20:42 -04:00
commit 0951fea738
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
7 changed files with 18 additions and 16 deletions

View File

@ -1,3 +1,3 @@
# utility script to call GenerateBinaryHeader function
include(${SOURCE_DIR}/Modules/LAMMPSUtils.cmake)
GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILES})
GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILE})

View File

@ -71,19 +71,15 @@ macro(pkg_depends PKG1 PKG2)
endmacro()
# CMake-only replacement for bin2c and xxd
function(GenerateBinaryHeader varname outfile files)
function(GenerateBinaryHeader varname outfile infile)
message("Creating ${outfile}...")
file(WRITE ${outfile} "// CMake generated file\n")
math(EXPR ARG_END "${ARGC}-1")
foreach(IDX RANGE 2 ${ARG_END})
list(GET ARGV ${IDX} filename)
file(READ ${filename} content HEX)
file(READ ${infile} content HEX)
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," content "${content}")
string(REGEX REPLACE ",$" "" content "${content}")
file(APPEND ${outfile} "const unsigned char ${varname}[] = { ${content} };\n")
file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n")
endforeach()
endfunction(GenerateBinaryHeader)
# fetch missing potential files

View File

@ -309,7 +309,7 @@ elseif(GPU_API STREQUAL "HIP")
endif()
add_custom_command(OUTPUT ${CUBIN_H_FILE}
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILES=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
DEPENDS ${CUBIN_FILE}
COMMENT "Generating ${CU_NAME}_cubin.h")

View File

@ -30,12 +30,12 @@ From: fedora:32
mingw32-expat mingw64-expat \
mingw64-expat-static mingw32-expat-static \
mingw32-sqlite-static mingw64-sqlite-static \
enchant python3-virtualenv doxygen \
enchant python3-virtualenv doxygen latexmk \
texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \
texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \
texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \
texlive-framed texlive-wrapfig texlive-upquote texlive-capt-of \
texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng \
texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng texlive-xindy \
blas-devel lapack-devel libyaml-devel openkim-models kim-api-devel \
zstd libzstd-devel
dnf clean all

View File

@ -64,6 +64,8 @@ From: ubuntu:18.04
texlive-publishers \
texlive-science \
dvipng \
latexmk \
xindy \
vim-nox \
virtualenv \
voro++-dev \

View File

@ -37,7 +37,7 @@ if (Python_EXECUTABLE)
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE} -u)
endif()
else()
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE})
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE} -u)
endif()
add_test(NAME PythonOpen

View File

@ -12,7 +12,11 @@ except:
pass
try:
lmp = lammps()
if 'LAMMPS_MACHINE_NAME' in os.environ:
machine = os.environ['LAMMPS_MACHINE_NAME']
else:
machine = ""
lmp = lammps(name=machine)
has_mpi = lmp.has_mpi_support
lmp.close()
except: