git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4447 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-08-05 23:31:17 +00:00
parent 779fb84fd5
commit 01227fec67
2 changed files with 103 additions and 1 deletions

102
src/MAKE/Makefile.mingw Normal file
View File

@ -0,0 +1,102 @@
# mingw = Windows 32bit, cross-compiled on Linux, gcc-4.4.1, MinGW x-compiler
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = i686-pc-mingw32-g++
CCFLAGS = -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized
DEPFLAGS = -M
LINK = i686-pc-mingw32-g++
LINKFLAGS = -O
LIB = -lwsock32 # -lwsock32 is needed for USER-IMD which uses tcp/ip sockets.
ARCHIVE = ar
ARFLAGS = -rcsv
SIZE = i686-pc-mingw32-size
# ---------------------------------------------------------------------
# LAMMPS-specific settings
# specify settings for LAMMPS features you will use
# LAMMPS ifdef options, see doc/Section_start.html
LMP_INC = -DLAMMPS_XDR # -DLAMMPS_GZIP -DMALLOC_MEMALIGN=64
# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -I../STUBS
MPI_PATH =
MPI_LIB = mpi.o
# FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package
# INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC = -DFFT_NONE #-DFFT_SINGLE
FFT_PATH =
FFT_LIB = #-lfftw
# additional system libraries needed by LAMMPS package libraries
# these settings are IGNORED if the corresponding LAMMPS package
# (e.g. gpu, meam) is NOT included in the LAMMPS build
# SYSLIB = names of libraries
# SYSPATH = paths of libraries
gpu_SYSLIB = -lcudart
meam_SYSLIB = -lifcore -lsvml -lompstub -limf
reax_SYSLIB = -lifcore -lsvml -lompstub -limf
user-atc_SYSLIB = -lblas -llapack
gpu_SYSPATH = -L$(HOME)/cuda/lib64 -Wl,-rpath,$(HOME)/cuda/lib64
meam_SYSPATH = -L/opt/intel/fce/10.0.023/lib
reax_SYSPATH = -L/opt/intel/fce/10.0.023/lib
user-atc_SYSPATH =
# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section
include Makefile.package
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(PKG_SYSLIB)
# Link target
$(EXE): $(EXE).exe ../MAKE/mingw_cross.nsis
makensis ../MAKE/mingw_cross.nsis
(cd ..; zip -0 lammps-icms-win.zip lammps-icms-win.exe)
touch $(EXE)
$(EXE).exe: $(OBJ) mpi.o
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE).exe
$(SIZE) $(EXE).exe
# Library target
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
# Individual dependencies
mpi.o: ../STUBS/mpi.c ../STUBS/mpi.h
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)

View File

@ -39,7 +39,7 @@ void Shell::command(int narg, char **arg)
} else if (strcmp(arg[0],"mkdir") == 0) {
if (narg < 2) error->all("Illegal shell command");
#ifndef WINDOWS
#if !defined(WINDOWS) && !defined(__MINGW32_VERSION)
if (me == 0)
for (int i = 1; i < narg; i++)
mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);