Documente Academic
Documente Profesional
Documente Cultură
LAMMPS is a software for molecular (and particles) dynamics. It can be installed on Mac OS X with several steps. On multi-core Mac, lammps is installed with fftw 3.x and OpenMPI. This document corresponds to lammps-19Sep13. old versions are obtained from below: http://lammps.sandia.gov/tars/ Remark: the package phonon was added on lammps-11Mar13. Remark: the package voronoi was added on lammps-25Jan13. Remark: LAMMPS-19Jan13 24Jan13 got a compile error of msm_omp.cpp with gcc (i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)). then we employed gcc-4.8 from http://hpc.sf.net/. Remark: the package user-molfile was added on lammps-14Jun12. But this document doesn't describe installation of the package. Remark: the package USER-COLVARS was added on lammps-27May12. Remark: built without CUDA package. Remark: OS X 10.6 or later is necessary for GPU/OpenCL package. See Recent LAMMPS News for recent lammps updates. (1) OS X 10.8.x (mountain lion) is employed with MacBook Core2Duo (late 2009). (2) if you employ xcode 4.4 or later, you need to install command line tools for it.
gccmlion.tar.gz (4.8 / updated 2013) for os x 10.8.x Remark: gcc-4.9 of hpc.sf.net does not work well. gcc-4.7 or 4.8 of hpc.sf.net is recommended.
(3) downloading gcc-mlion.tar.gz from http://hpc.sf.net : instruction: (A) $ gunzip gcc-mlion.tar.gz (B) $ sudo tar -xf gcc-mlion.tar -C /
(4) installation of OpenMPI 1.6.x downloading OpenMPI from http://www.open-mpi.org/software/ompi/v1.6/ extracting tar file (double clicking tar.gz file) and: $ ./configure $ make all $ make check $ sudo make install # when it passes all check. (5) installation of FFTW we employ FFTW version 3.x # 29 February 2012 http://www.fftw.org/download.html
extracting tar file (double clicking tar.gz file) and: $ ./configure $ make all $ make check $ sudo make install (6) installing OpenKIM (Open Knowledge base Interatomic Model) --- Option: if you don't employ OpenKIM, skip this step. download KIM API from https://openkim.org/kim_api#download #We employed version 1.2.1 or later. Extract the file at your home directory and On Terminal $ cp Makefile.KIM_Config.example Makefile.KIM_Config modifyng Makefile.KIM_Config as follows:
# # Release: This file is part of the openkim-api-v1.2.1 package. # # # this make file builds/cleans everything # #KIM_DIR = $(HOME)/openkim-api-vX.X.X KIM_DIR=$(HOME)/openkim-api-v1.2.1 #KIM_MODEL_DRIVERS_DIR = #KIM_MODELS_DIR = #KIM_TESTS_DIR = KIM_COMPILERSUITE = GCC KIM_SYSTEMLINKER = darwin KIM_SYSTEMARCH = 64bit KIM_LINK = dynamic-load
On Terminal $ export KIM_DIR=the path to openkim # ending with / # example: KIM_DIR=/Users/user_name/openkim-api-v1.2.1/ $ cd $KIM_DIM $ make examples $ make (7) installing Voro++ (a software library for carrying out threedimensional computations of the Voronoi tessellation) --- Option: if you don't employ Voro++, skip this step. download Vooro++ from http://math.lbl.gov/voro++/download/. #We employed Version 0.4.5 or later. Extract the file and on Terminal moving to the directory: voro++-0.4.5/ $ make $ sudo make install # files will be installed under /usr/local/. (8) Downloading Lammps the latest version is obtained from below: http://lammps.sandia.gov/download.html#tar old versions are obtained from below: http://lammps.sandia.gov/tars/ (9) building LAMMPS Remark: in Makefile, tab is used for spacing. (A) build libraries: awpmd, atc, meam, poem, reax, gpu, colvars.
at awpmd: $ make -f Makefile.openmpi at atc: $ make -f Makefile.g++ at meam: $ make -f Makefile.gfortran at poems: $ make -f Makefile.g++ at reax: $ make -f Makefile.gfortran at gpu # for OpenCL $ make -f Makefile.mac_opencl at colvars $ make -f Makefile.g++ (B) at src/USER-COLVARS modification of Makefile.lammps
# # # # # # # # # # # # # # # # # This file contains the hooks to build and link LAMMPS with the OpenKIM library so that a LAMMPS input script can use a KIM potential, via the pair_style kim command. You should first download KIM from www.openkim.org. Then build its library API in KIM_API, with the models (potentials) you want to use. You should then have the files: openkim-api-vX.X.X/KIM_API/libkim.a openkim-api-vX.X.X/KIM_API/libkim.so When you build LAMMPS with the KIM package installed, it will use the 3 settings in this file. They should be set as follows. kim_SYSINC = a path to the KIM_API directory that contains *.h files kim_SYSLIB = compiler flag to use the KIM library kim_SYSPATH = a path to the KIM library
# ----------------------------------------------------------# Settings that the LAMMPS build will import when this package is installed kim_SYSINC = -I/Users/foo/openkim-api-v1.2.1/KIM_API kim_SYSLIB = -lkim kim_SYSPATH = -L/Users/foo/openkim-api-v1.2.1/KIM_API
LINK = LINKFLAGS = -O
LIB = -lstdc++ -lgfortran -lgomp -framework vecLib # gfortran, OpenMP, apple lapack SIZE = size ARCHIVE = ar ARFLAGS = -rcsv SHLIBFLAGS = -shared # # # # --------------------------------------------------------------------LAMMPS-specific settings specify settings for LAMMPS features you will use if you change any -D setting, do full re-compile after "make clean"
# LAMMPS ifdef settings, OPTIONAL # see possible settings in doc/Section_start.html#2_2 (step 4) LMP_INC = # # # # # # -DLAMMPS_GZIP
MPI library, REQUIRED see discussion in doc/Section_start.html#2_2 (step 5) can point to dummy MPI library in src/STUBS as in Makefile.serial 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, OPTIONAL see discussion in doc/Section_start.html#2_2 (step 6) 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 -DFFT_FFTW3 -lfftw3 # employ fftw 3
(D) generating makefile at src directory $ make yes-all Installing package asphere Installing package body Installing package class2 Installing package colloid Installing package dipole Installing package fld Installing package gpu Installing package granular Installing package kim Installing package kspace updating package GPU Installing package manybody updating package GPU Installing package mc Installing package meam Installing package misc Installing package molecule updating package GPU Installing package opt Installing package peri Installing package poems Installing package reax
Installing Installing Installing Installing Installing Installing Installing Installing Installing updating updating updating updating updating Installing Installing Installing Installing updating updating updating Installing Installing Installing Installing Installing
package replica package rigid package shock package srd package voronoi package xtc package user-atc package user-awpmd package user-cg-cmm package GPU src/pair_lj_sdk_coul_long_gpu.cpp src/pair_lj_sdk_coul_long_gpu.h src/pair_lj_sdk_gpu.cpp src/pair_lj_sdk_gpu.h package user-colvars package user-cuda package user-eff package user-misc package GPU src/pair_lj_sf_dipole_sf_gpu.cpp src/pair_lj_sf_dipole_sf_gpu.h package user-omp package user-molfile package user-phonon package user-reaxc package user-sph
$ make no-user-cuda #deleting CUDA package Uninstalling package user-cuda $ make no-user-molfile #deleting molfile package Uninstalling package user-molfile If you didn't employ OpenKIM: $ make no-kim #deleting OpenKIM package Uninstalling package kim If you didn't employ Voro++: $ make no-voronoi #deleting Voro++ package Uninstalling package voronoi (E)at src build executable binary: lmp_openmpi $ make openmpi (F) setting up example suppose that a directory ~/bin exists. $ cp lmp_openmpi ~/bin/ $ export PATH=$PATH:~/bin # use it in .bash_profile (10) execution of Lammps as multi-process command for multi process: $ mpirun -np N lmp_openmpi < in.lammps.script #N is a number of MPI process #see Lammps manual for details. command for multi threads with OpenMP:
$ mpirun -x OMP_NUM_THREADS=M -np N lmp_openmpi -sf omp -in in.lammps
lammps-19Sep13 running as two openmp threads x two mpi process on macbook (core2duo) via /humi [pixiv] (in japanese) Appendix lammps mailing list: SourceForge.net: LAMMPS: lammps-users My web site: http://math.digi2.jp/ http://math.digi2.jp/math/lammps/ : lammps Scribd - chibaf http://www.scribd.com/chibaf mail: twitter: @chibaf