Unverified Commit 0b25d2fe authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1504 from akohlmey/collected-small-fixes

Collected small bugfixes and changes
parents 1c1491ee fd592d51
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ include(LAMMPSUtils)

get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)


include(PreventInSourceBuilds)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
@@ -51,6 +50,7 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
# these need ot be done early (before further tests).
#####################################################################
include(CheckCCompilerFlag)
include(CheckIncludeFileCXX)

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
@@ -186,10 +186,6 @@ if(LAMMPS_EXCEPTIONS)
  set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -DLAMMPS_EXCEPTIONS")
endif()

option(CMAKE_VERBOSE_MAKEFILE "Verbose makefile" OFF)



# "hard" dependencies between packages resulting
# in an error instead of skipping over files
pkg_depends(MPIIO MPI)
@@ -198,7 +194,6 @@ pkg_depends(USER-LB MPI)
pkg_depends(USER-PHONON KSPACE)
pkg_depends(USER-SCAFACOS MPI)

include(CheckIncludeFileCXX)
find_package(OpenMP QUIET)

# TODO: this is a temporary workaround until a better solution is found. AK 2019-05-30
+0 −1
Original line number Diff line number Diff line
if(PKG_USER-INTEL)
  include(CheckIncludeFile)
  check_include_file_cxx(immintrin.h FOUND_IMMINTRIN)
  if(NOT FOUND_IMMINTRIN)
    message(FATAL_ERROR "immintrin.h header not found, Intel package won't work without it")
+6 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
namespace LAMMPS_NS {
// same as in variable.cpp
enum {INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV,
      SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,PYTHON};
      SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,VECTOR,PYTHON,INTERNAL};

enum {COMPUTES=1<<0,
      DUMPS=1<<1,
@@ -106,7 +106,7 @@ static const int STYLES = ATOM_STYLES | INTEGRATE_STYLES | MINIMIZE_STYLES

static const char *varstyles[] = {
  "index", "loop", "world", "universe", "uloop", "string", "getenv",
  "file", "atomfile", "format", "equal", "atom", "python", "(unknown)"};
  "file", "atomfile", "format", "equal", "atom", "vector", "python", "internal", "(unknown)"};

static const char *mapstyles[] = { "none", "array", "hash" };

@@ -599,6 +599,10 @@ void Info::command(int narg, char **arg)
      int ndata = 1;
      fprintf(out,"Variable[%3d]: %-10s,  style = %-10s,  def =",
              i,names[i],varstyles[style[i]]);
      if (style[i] == INTERNAL) {
        fprintf(out,"%g\n",input->variable->dvalue[i]);
        continue;
      }
      if ((style[i] != LOOP) && (style[i] != ULOOP))
        ndata = input->variable->num[i];
      for (int j=0; j < ndata; ++j)
+4 −4
Original line number Diff line number Diff line
@@ -288,11 +288,11 @@ void Variable::set(int narg, char **arg)

    int maxcopy = strlen(arg[2]) + 1;
    int maxwork = maxcopy;
    char *scopy = new char[maxcopy];
    char *work = new char[maxwork];
    char *scopy = (char *) memory->smalloc(maxcopy,"var:string/copy");
    char *work = (char *) memory->smalloc(maxwork,"var:string/work");
    strcpy(scopy,arg[2]);
    input->substitute(scopy,work,maxcopy,maxwork,1);
    delete [] work;
    memory->sfree(work);

    int ivar = find(arg[0]);
    if (ivar >= 0) {
@@ -310,7 +310,7 @@ void Variable::set(int narg, char **arg)
      data[nvar] = new char*[num[nvar]];
      copy(1,&scopy,data[nvar]);
    }
    delete [] scopy;
    memory->sfree(scopy);

  // GETENV
  // remove pre-existing var if also style GETENV (allows it to be reset)