1 (edited by grogley 2018-10-10 10:17:47)

Topic: Missing DLL files when moving EXE to new machine; SF 2.41 build 2559

When I move my executable to a new machine, one which does not have SF installed, I get multiple messages that certain DLL are missing from the machine. Here is an example od one of the files it complains about: libgcc_s_seh-1.dll I did try to moved this DLL to the new machine but it just complains about a new one.

I have pthreadGC2-64.dll on this different machine and that was all I needed previously to port an application to a new platform. What am I doing wrong that my executable is no longer portable?

The executable is 64 bit, the OS is 64 bit... what else is there?

Thanks
Rod

Oh, here is the Makefile:
#
# Automagically generated by Approximatrix Simply Fortran 2.41
#
FC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe"
CC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe"
AR="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe"
WRC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe"
RM=rm -f


OPTFLAGS= -O3 -fgraphite-identity -floop-interchange -floop-strip-mine -floop-block -floop-parallelize-all -mtune=broadwell

SPECIALFLAGS=$(IDIR)

RCFLAGS=-O coff

PRJ_FFLAGS= -fopenmp

PRJ_CFLAGS=

PRJ_LFLAGS=-Wl,--stack,1500000000 -lgomp

FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules

CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)

"build\riod.o": ".\riod.f90"
    @echo Compiling .\riod.f90
    @$(FC) -c -o "build\riod.o" $(FFLAGS) ".\riod.f90"

clean: .SYMBOLIC
    @echo Deleting build\riod.o and related files
    @$(RM) "build\riod.o"
    @echo Deleting default icon resource
    @$(RM) "build\sf_default_resource.res"
    @echo Deleting riod.exe
    @$(RM) "riod.exe"

"riod.exe":  "build\riod.o" "build\Riod-MP-F90.prj.target"
    @echo Generating riod.exe
    @$(FC) -o "riod.exe" -static-libgfortran -fopenmp "build\riod.o" $(LDIR) $(PRJ_LFLAGS)

all: "riod.exe" .SYMBOLIC

Re: Missing DLL files when moving EXE to new machine; SF 2.41 build 2559

Rod,

It looks like you're not compiling a truly static executable.  You're linking with the static gfortran runtime library (-static-libgfortran), but you're not using the static libgcc library.  Switching the project to "All Static" in Project Options under the Linker tab should correct the problem in theory.  The makefile should change to say "-static" rather than just "-static-libgfortran" on the linking step.

There shouldn't be any dependency on the pthread library. Our OpenMP implementation does not use it.  There is a possibility, though, that the compiler itself is adding the pthread flag because you're using the "-floop-parallelize-all" flag.  I'll look into the linking options.

Jeff Armstrong
Approximatrix, LLC

3 (edited by grogley 2018-10-12 09:37:35)

Re: Missing DLL files when moving EXE to new machine; SF 2.41 build 2559

Thanks Jeff, I changed that check button back to "All Static" in the Linker project options. and the executable is now portable; no asking for DLLs.

I also appreciate that the pthreadGC2-32.dll or pthreadGC2-64.dll are no longer needed to be portable. That was one of the things I was unhappy about when I first started using SF/GNU FORTRAN.

Now if I can just figure out why my new code has memory fault crashes... but that is for later once I can understand where and when it is happening.

Rod

Oh, and here is the latest Makefile:

#
# Automagically generated by Approximatrix Simply Fortran 2.41
#
FC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe"
CC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe"
AR="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe"
WRC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe"
RM=rm -f


OPTFLAGS= -O3 -fgraphite-identity -floop-interchange -floop-strip-mine -floop-block -floop-parallelize-all -mtune=broadwell

SPECIALFLAGS=$(IDIR)

RCFLAGS=-O coff

PRJ_FFLAGS= -fopenmp

PRJ_CFLAGS=

PRJ_LFLAGS=-Wl,--stack,1500000000 -lgomp

FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules

CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)

"build\riod.o": ".\riod.f90"
    @echo Compiling .\riod.f90
    @$(FC) -c -o "build\riod.o" $(FFLAGS) ".\riod.f90"

clean: .SYMBOLIC
    @echo Deleting build\riod.o and related files
    @$(RM) "build\riod.o"
    @echo Deleting default icon resource
    @$(RM) "build\sf_default_resource.res"
    @echo Deleting riod.exe
    @$(RM) "riod.exe"

"riod.exe":  "build\riod.o" "build\Riod-MP-F90.prj.target"
    @echo Generating riod.exe
    @$(FC) -o "riod.exe" -static -fopenmp "build\riod.o" $(LDIR) $(PRJ_LFLAGS)

all: "riod.exe" .SYMBOLIC