Commit 97ab08d7 authored by Stefan Paquay's avatar Stefan Paquay
Browse files

Merge branch 'master' into fix-active

parents 17886f1e f2789c7d
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -37,6 +37,26 @@
# KIM-API-CMAKE_Fortran_COMPILER
#

function(_KIMAPI_GET_VERSION _OUT_ver _version_hdr)
  if(NOT EXISTS ${_version_hdr})
    message(FATAL_ERROR "Header file ${_version_hdr} not found (check value of KIM-API_INCLUDE_DIR)")
  endif()
  foreach(_var KIM_VERSION_MAJOR KIM_VERSION_MINOR KIM_VERSION_PATCH)  
    file(STRINGS ${_version_hdr} _contents REGEX "#define ${_var}[ \t]+")
    if(_contents)
      string(REGEX REPLACE ".*#define ${_var}[ \t]+([0-9]+).*" "\\1" _${_var} "${_contents}")
      if(${_${_var}} STREQUAL "")
        message(FATAL_ERROR "Version parsing failed for ${_var} in ${_version_hdr}, got empty return!")
      elseif(NOT ${_${_var}} MATCHES "^[0-9]+$")
        message(FATAL_ERROR "Version parsing failed for ${_var} in ${_version_hdr}, excepted a number but got ${_${_var}}!")
      endif()
    else()
      message(FATAL_ERROR "No ${_var} line found in include file ${_version_hdr}")
    endif()
  endforeach()
  set(${_OUT_ver} ${_KIM_VERSION_MAJOR}.${_KIM_VERSION_MINOR}.${_KIM_VERSION_PATCH} PARENT_SCOPE)
endfunction()

if(KIM-API_FIND_QUIETLY)
  set(REQ_OR_QUI "QUIET")
else()
@@ -54,6 +74,12 @@ if(KIM-API_FOUND)
  pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER)
endif()

if(KIM-API_INCLUDEDIR)
  _KIMAPI_GET_VERSION(KIM-API_VERSION ${KIM-API_INCLUDEDIR}/KIM_Version.h)
else()
  set(KIM-API_VERSION 0)
endif()

# handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(KIM-API REQUIRED_VARS KIM-API_LIBRARIES)
find_package_handle_standard_args(KIM-API REQUIRED_VARS KIM-API_LIBRARIES VERSION_VAR KIM-API_VERSION)
+12 −4
Original line number Diff line number Diff line
if(PKG_KIM)
  set(KIM-API_MIN_VERSION 2.1)
  find_package(CURL)
  if(CURL_FOUND)
    include_directories(${CURL_INCLUDE_DIRS})
@@ -7,10 +8,17 @@ if(PKG_KIM)
  endif()
  find_package(KIM-API QUIET)
  if(KIM-API_FOUND)
    if (KIM-API_VERSION VERSION_LESS ${KIM-API_MIN_VERSION})
      if ("${DOWNLOAD_KIM}" STREQUAL "")
        message(WARNING "Unsuitable KIM-API version \"${KIM-API_VERSION}\" found, but required is at least \"${KIM-API_MIN_VERSION}\".  Default behavior set to download and build our own.")
      endif()
      set(DOWNLOAD_KIM_DEFAULT ON)
    else()
      set(DOWNLOAD_KIM_DEFAULT OFF)
    endif()
  else()
    if (NOT DOWNLOAD_KIM)
      message(WARNING "KIM-API package not found.  We will download and build our own")
    if ("${DOWNLOAD_KIM}" STREQUAL "")
      message(WARNING "KIM-API package not found.  Default behavior set to download and build our own")
    endif()
    set(DOWNLOAD_KIM_DEFAULT ON)
  endif()
@@ -42,7 +50,7 @@ if(PKG_KIM)
    set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
    list(APPEND LAMMPS_DEPS kim_build)
  else()
    find_package(KIM-API REQUIRED)
    find_package(KIM-API ${KIM-API_MIN_VERSION} REQUIRED)
  endif()
  list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}")
  include_directories(${KIM-API_INCLUDE_DIRS})
+119 −0
Original line number Diff line number Diff line
# astra_arm - ThunderX2 ARM/OpenMPI Based, use Arm-PL for FFTW

# need to load the following modules:
# 1) arm-based developer pack

SHELL = /bin/sh

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC =            mpicxx
CCFLAGS =       -O3 -funroll-loops -fopenmp -mcpu=thunderx2t99 -mtune=thunderx2t99
DEPFLAGS =      -M
LINK =          mpicxx
LINKFLAGS =     -O3 -fopenmp -mcpu=thunderx2t99 -mtune=thunderx2t99
LIB =           -lstdc++
ARCHIVE =       ar
ARFLAGS =       -rcsv
SIZE =          size

# ---------------------------------------------------------------------
# LAMMPS-specific settings, all OPTIONAL
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"

# LAMMPS ifdef settings
# see possible settings in Section 2.2 (step 4) of manual

LMP_INC =       -DLAMMPS_GZIP

# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC =       
MPI_PATH = 
MPI_LIB =

# FFT library
# see discussion in Section 2.2 (step 6) of manaul
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC =    -DFFT_FFTW2 -armpl
FFT_PATH =   
FFT_LIB =     

# JPEG and/or PNG library
# see discussion in Section 2.2 (step 7) of manual
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library

JPG_INC =       
JPG_PATH = 
JPG_LIB =

# ---------------------------------------------------------------------
# build rules and dependencies
# do not edit this section

include	Makefile.package.settings
include	Makefile.package

EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS)
EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS)

# Path to src files

vpath %.cpp ..
vpath %.h ..

# Link target

$(EXE):	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
	$(SIZE) $(EXE)

# Library targets

lib:	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

shlib:	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
        $(OBJ) $(EXTRA_LIB) $(LIB)

# Compilation rules

%.o:%.cpp $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<

%.d:%.cpp $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@

%.o:%.cu $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<

# Individual dependencies

depend : fastdep.exe $(SRC)
	@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1

fastdep.exe: ../DEPEND/fastdep.c
	cc -O -o $@ $<

sinclude .depend
+119 −0
Original line number Diff line number Diff line
# astra-gcc - ThunderX2 GCC/OpenMPI Based, FFTW

# need to load the following modules:
# 1) arm-based developer pack

SHELL = /bin/sh

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC =            mpicxx
CCFLAGS =       -O3 -funroll-loops -fopenmp -mcpu=thunderx2t99 -mtune=thunderx2t99
DEPFLAGS =      -M
LINK =          mpicxx
LINKFLAGS =     -O3 -fopenmp -mcpu=thunderx2t99 -mtune=thunderx2t99
LIB =           -lstdc++
ARCHIVE =       ar
ARFLAGS =       -rcsv
SIZE =          size

# ---------------------------------------------------------------------
# LAMMPS-specific settings, all OPTIONAL
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"

# LAMMPS ifdef settings
# see possible settings in Section 2.2 (step 4) of manual

LMP_INC =       -DLAMMPS_GZIP

# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC =       
MPI_PATH = 
MPI_LIB =

# FFT library
# see discussion in Section 2.2 (step 6) of manaul
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC =    -DFFT_FFTW2 -I${FFTW_INC}
FFT_PATH =   -I${FFTW_INC}
FFT_LIB =    -L${FFTW_LIB} -lfftw3

# JPEG and/or PNG library
# see discussion in Section 2.2 (step 7) of manual
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library

JPG_INC =       
JPG_PATH = 
JPG_LIB =

# ---------------------------------------------------------------------
# build rules and dependencies
# do not edit this section

include	Makefile.package.settings
include	Makefile.package

EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS)
EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS)

# Path to src files

vpath %.cpp ..
vpath %.h ..

# Link target

$(EXE):	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
	$(SIZE) $(EXE)

# Library targets

lib:	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

shlib:	$(OBJ) $(EXTRA_LINK_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
        $(OBJ) $(EXTRA_LIB) $(LIB)

# Compilation rules

%.o:%.cpp $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<

%.d:%.cpp $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@

%.o:%.cu $(EXTRA_CPP_DEPENDS)
	$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<

# Individual dependencies

depend : fastdep.exe $(SRC)
	@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1

fastdep.exe: ../DEPEND/fastdep.c
	cc -O -o $@ $<

sinclude .depend
+15 −25
Original line number Diff line number Diff line
# knl = Flags for Knights Landing Xeon Phi Processor,Intel Compiler/MPI,MKL FFT
# module load perftools-base perftools
# theta = Flags for Knights Landing Xeon Phi Processor, Intel Compiler, Cray MPI, MKL FFT
# make theta -j 8
# pat_build -g mpi -u ./lmp_theta

SHELL = /bin/sh

@@ -10,24 +8,16 @@ SHELL = /bin/sh
# specify flags and libraries needed for your compiler

CC =        CC -mkl
#OPTFLAGS =       -O0
OPTFLAGS =  -xMIC-AVX512 -O3 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS =   -g -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload \
                -fno-alias -ansi-alias -restrict $(OPTFLAGS)
#CCFLAGS +=      -DLMP_INTEL_NO_TBB
#CCFLAGS +=      -DLAMMPS_BIGBIG
#CCFLAGS +=      -D_USE_PAPI
#CCFLAGS +=      -D_USE_CRAYPAT_API
CCFLAGS +=  -std=c++11
SHFLAGS =   -fPIC
DEPFLAGS =  -M

LINK =      $(CC)
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LINKFLAGS += -dynamic
LIB =
#LIB +=           -L${TBBROOT}/lib/intel64/gcc4.7 -ltbbmalloc
LIB +=           -ltbbmalloc
#LIB +=          /soft/debuggers/forge-7.0-2017-02-16/lib/64/libdmallocthcxx.a -zmuldefs
LINKFLAGS = -g -qopenmp $(OPTFLAGS) -dynamic
LIB =       -ltbbmalloc
SIZE =      size

ARCHIVE =   ar
Loading