diff --git a/lib/gpu/Makefile.mingw32-cross b/lib/gpu/Makefile.mingw32-cross index c0f9d4aad7..6f77634755 100644 --- a/lib/gpu/Makefile.mingw32-cross +++ b/lib/gpu/Makefile.mingw32-cross @@ -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 diff --git a/lib/gpu/Makefile.mingw32-cross-mpi b/lib/gpu/Makefile.mingw32-cross-mpi index 85da481392..94099cd90b 100644 --- a/lib/gpu/Makefile.mingw32-cross-mpi +++ b/lib/gpu/Makefile.mingw32-cross-mpi @@ -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 diff --git a/lib/gpu/Makefile.mingw64-cross b/lib/gpu/Makefile.mingw64-cross index c65e8a9a5f..54f6af8c65 100644 --- a/lib/gpu/Makefile.mingw64-cross +++ b/lib/gpu/Makefile.mingw64-cross @@ -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 diff --git a/lib/gpu/Makefile.mingw64-cross-mpi b/lib/gpu/Makefile.mingw64-cross-mpi index 3cd1d7f8fe..2ff72d98b1 100644 --- a/lib/gpu/Makefile.mingw64-cross-mpi +++ b/lib/gpu/Makefile.mingw64-cross-mpi @@ -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 diff --git a/tools/colvars/Makefile b/tools/colvars/Makefile index a1f1b4c4b0..9131555389 100644 --- a/tools/colvars/Makefile +++ b/tools/colvars/Makefile @@ -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) $< diff --git a/tools/mingw-cross/build-mingw-cross.sh b/tools/mingw-cross/build-mingw-cross.sh index 91fa82fc7f..fa2ac01aa5 100755 --- a/tools/mingw-cross/build-mingw-cross.sh +++ b/tools/mingw-cross/build-mingw-cross.sh @@ -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 diff --git a/tools/msi2lmp/src/Makefile b/tools/msi2lmp/src/Makefile index 26ced8c31a..b7d3b6668d 100644 --- a/tools/msi2lmp/src/Makefile +++ b/tools/msi2lmp/src/Makefile @@ -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 $<