more support for static compilation with cross-compiler.
This commit is contained in:
@ -3,7 +3,7 @@ CUDA_HOME = ../../tools/mingw-cross/OpenCL
|
||||
OCL_CPP = i686-w64-mingw32-g++ -O2 -march=i686 -mtune=generic -mfpmath=387 \
|
||||
-mpc64 -DMPI_GERYON -DUCL_NO_EXIT -I../../src/STUBS \
|
||||
-I$(CUDA_HOME)/include
|
||||
OCL_LINK = -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic -L../../src/STUBS -lmpi_mingw32
|
||||
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic -L../../src/STUBS -lmpi_mingw32
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
OCL_TUNE = -DFERMI_OCL
|
||||
EXTRAMAKE = Makefile.lammps.mingw-cross
|
||||
|
||||
@ -4,7 +4,7 @@ OCL_CPP = i686-w64-mingw32-g++ -O2 -march=i686 -mtune=generic -mfpmath=387 \
|
||||
-mpc64 -DMPI_GERYON -DUCL_NO_EXIT -I$(CUDA_HOME)/include \
|
||||
-I../../tools/mingw-cross/mpich2-win32/include/ \
|
||||
-DMPICH_IGNORE_CXX_SEEK
|
||||
OCL_LINK = -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
-L../../tools/mingw-cross/mpich2-win32/lib -lmpi
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
OCL_TUNE = -DFERMI_OCL
|
||||
|
||||
@ -3,7 +3,7 @@ CUDA_HOME = ../../tools/mingw-cross/OpenCL
|
||||
OCL_CPP = x86_64-w64-mingw32-g++ -O3 -march=core2 -mtune=core2 -mpc64 \
|
||||
-msse2 -DMPI_GERYON -DUCL_NO_EXIT -I../../src/STUBS \
|
||||
-I$(CUDA_HOME)/include
|
||||
OCL_LINK = -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
-L../../src/STUBS -lmpi_mingw64
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
OCL_TUNE = -DFERMI_OCL
|
||||
|
||||
@ -5,7 +5,7 @@ OCL_CPP = x86_64-w64-mingw32-g++ -O3 -march=core2 -mtune=core2 -mpc64 \
|
||||
-I../../tools/mingw-cross/mpich2-win64/include/ \
|
||||
-DMPICH_IGNORE_CXX_SEEK
|
||||
|
||||
OCL_LINK = -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
|
||||
-L../../tools/mingw-cross/mpich2-win64/lib -lmpi
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
OCL_TUNE = -DFERMI_OCL
|
||||
|
||||
@ -3,6 +3,7 @@ SHELL=/bin/sh
|
||||
# adjust as needed
|
||||
CXX=g++
|
||||
CXXFLAGS=-Wall -O2
|
||||
LDFLAGS=
|
||||
# set to .exe for windows
|
||||
EXT=
|
||||
#########################
|
||||
@ -13,7 +14,7 @@ clean:
|
||||
-rm *~ *.o abf_integrate$(EXT) *.exe
|
||||
|
||||
abf_integrate$(EXT): abf_integrate.o abf_data.o
|
||||
$(CXX) -o $@ $(CXXFLAGS) $^
|
||||
$(CXX) $(LDFLAGS) -o $@ $(CXXFLAGS) $^
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -o $@ -c $(CXXFLAGS) $<
|
||||
|
||||
@ -81,34 +81,34 @@ TOOLDIR=lammps-current/tools
|
||||
MINGW32FLAGS="-DLAMMPS_SMALLSMALL -O2 -march=i686 -mtune=generic -mfpmath=387 -mpc64 "
|
||||
MINGW64FLAGS="-DLAMMPS_SMALLBIG -O2 -march=core2 -mtune=core2 -mpc64 -msse2"
|
||||
|
||||
i686-w64-mingw32-g++ ${MINGW32FLAGS} -o mingw32/restart2data.exe ${TOOLDIR}/restart2data.cpp
|
||||
x86_64-w64-mingw32-g++ ${MINGW64FLAGS} -o mingw64/restart2data.exe ${TOOLDIR}/restart2data.cpp
|
||||
i686-w64-mingw32-g++ ${MINGW32FLAGS} -static -o mingw32/restart2data.exe ${TOOLDIR}/restart2data.cpp
|
||||
x86_64-w64-mingw32-g++ ${MINGW64FLAGS} -static -o mingw64/restart2data.exe ${TOOLDIR}/restart2data.cpp
|
||||
|
||||
i686-w64-mingw32-g++ ${MINGW32FLAGS} -o mingw32/binary2txt.exe ${TOOLDIR}/binary2txt.cpp
|
||||
x86_64-w64-mingw32-g++ ${MINGW64FLAGS} -o mingw64/binary2txt.exe ${TOOLDIR}/binary2txt.cpp
|
||||
i686-w64-mingw32-g++ ${MINGW32FLAGS} -static -o mingw32/binary2txt.exe ${TOOLDIR}/binary2txt.cpp
|
||||
x86_64-w64-mingw32-g++ ${MINGW64FLAGS} -static -o mingw64/binary2txt.exe ${TOOLDIR}/binary2txt.cpp
|
||||
|
||||
i686-w64-mingw32-gfortran ${MINGW32FLAGS} -o mingw32/chain.exe ${TOOLDIR}/chain.f
|
||||
x86_64-w64-mingw32-gfortran ${MINGW64FLAGS} -o mingw64/chain.exe ${TOOLDIR}/chain.f
|
||||
i686-w64-mingw32-gfortran ${MINGW32FLAGS} -static -o mingw32/chain.exe ${TOOLDIR}/chain.f -lquadmath
|
||||
x86_64-w64-mingw32-gfortran ${MINGW64FLAGS} -static -o mingw64/chain.exe ${TOOLDIR}/chain.f -lquadmath
|
||||
|
||||
i686-w64-mingw32-gfortran ${MINGW32FLAGS} -o mingw32/createatoms.exe \
|
||||
${TOOLDIR}/createatoms/createAtoms.f
|
||||
x86_64-w64-mingw32-gfortran ${MINGW64FLAGS} -o mingw64/createatoms.exe \
|
||||
${TOOLDIR}/createatoms/createAtoms.f
|
||||
i686-w64-mingw32-gfortran ${MINGW32FLAGS} -static -o mingw32/createatoms.exe \
|
||||
${TOOLDIR}/createatoms/createAtoms.f -lquadmath
|
||||
x86_64-w64-mingw32-gfortran ${MINGW64FLAGS} -static -o mingw64/createatoms.exe \
|
||||
${TOOLDIR}/createatoms/createAtoms.f -lquadmath
|
||||
|
||||
make -C ${TOOLDIR}/msi2lmp/src TARGET=${PWD}/mingw32/msi2lmp.exe \
|
||||
CC=i686-w64-mingw32-gcc CFLAGS="${MINGW32FLAGS}" clean
|
||||
make -C ${TOOLDIR}/msi2lmp/src TARGET=${PWD}/mingw32/msi2lmp.exe \
|
||||
CC=i686-w64-mingw32-gcc CFLAGS="${MINGW32FLAGS}"
|
||||
CC=i686-w64-mingw32-gcc CFLAGS="${MINGW32FLAGS}" LDFLAGS=-static
|
||||
make -C ${TOOLDIR}/msi2lmp/src TARGET=${PWD}/mingw64/msi2lmp.exe \
|
||||
CC=x86_64-w64-mingw32-gcc CFLAGS="${MINGW64FLAGS}" clean
|
||||
make -C ${TOOLDIR}/msi2lmp/src TARGET=${PWD}/mingw64/msi2lmp.exe \
|
||||
CC=x86_64-w64-mingw32-gcc CFLAGS="${MINGW64FLAGS}"
|
||||
CC=x86_64-w64-mingw32-gcc CFLAGS="${MINGW64FLAGS}" LDFLAGS=-static
|
||||
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe clean
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe CXX=i686-w64-mingw32-g++ CXXFLAGS="${MINGW32FLAGS}"
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe CXX=i686-w64-mingw32-g++ CXXFLAGS="${MINGW32FLAGS}" LDFLAGS=-static
|
||||
cp ${TOOLDIR}/colvars/*.exe ${PWD}/mingw32/
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe clean
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe CXX=x86_64-w64-mingw32-g++ CXXFLAGS="${MINGW64FLAGS}"
|
||||
make -C ${TOOLDIR}/colvars EXT=.exe CXX=x86_64-w64-mingw32-g++ CXXFLAGS="${MINGW64FLAGS}" LDFLAGS=-static
|
||||
cp ${TOOLDIR}/colvars/*.exe ${PWD}/mingw64/
|
||||
|
||||
# assemble and customize installer scripts
|
||||
|
||||
@ -18,13 +18,14 @@ HEADERS = msi2lmp.h Forcefield.h
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -O -Wall -W -g
|
||||
LDFLAGS =
|
||||
FRCFILE = cvff.frc
|
||||
FRCFILE2 = cff91.frc
|
||||
README = README
|
||||
MKFILE = Makefile
|
||||
|
||||
$(TARGET) : $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) -lm
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $(TARGET) $(OBJS) -lm
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
Reference in New Issue
Block a user