Topic: Windows Openmp exe crashes with message of missing pthreadGC-32.dll
Hello, I am new to Simply Fortran and trying to build an openmp project. As background I will say I am not a programmer. I learned Fortran in the "before time". I think it was Fortran 66 in those days. My coding method is to hack around until it works, then refine as needed. I understand little of the jargon programmers use so I would as for patience with my dumb questions. Ultimately I want to update a simulation code to use the Openmp extensions to allow use of multi-processor Windows machines to increase speed of execution and scale of projects I can try. Thanks in advance for your help.
Right now I am working with sample program for openmp that I have played with a bit and even got it to work with MinGW compiler. In fact, now if I do the following on the command line:
gfortran workshare.f -o workshare -O2 -fopenmp
the program complies and will execute causing all 8 processors in my machine to go busy during the execution. This is good and what I want to have happen.
However, under Simply Fortran, I compile using the -fopenmp compiler option and the linker options -lgomp -lpthread options, the code compiles and links with the following:
==============================================================================
Open Watcom Make Version 1.9 (Built on May 17 2012)
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
"F:\SimplyFortran\mingw-w64\bin\gfortran.exe" -c -o build\workshare.o -g -m32 -IF:/SimplyFortran/mingw-w64/include/ -O2 -fopenmp -Jmodules .\workshare.f
"F:\SimplyFortran\mingw-w64\bin\gfortran.exe" -o f:\riod\temp\workshare.exe -static -m32 build\workshare.o -LF:/SimplyFortran/mingw-w64/lib/ -lgomp -lpthread
* Complete *
This looks normal build from what I can tell.
However, when I run the executable, a Windows pop up comes telling me the following:
"The program can't start because pthreadGC2-32.dll is missing from your computer. Try reinstalling the program to fix this problem."
The above dll is in my path and is in the bin directory of the SF install directory.
More information, the computer is a Win7 pro 64 bit system, the executable is to be 32 bit. The program I am compiling started as an example found on the web for openmp which I modified a bit make it more CPU intensive to test the SMP execution; here is the source code:
C FILE: omp_workshare1.f
C DESCRIPTION:
C OpenMP Example - Loop Work-sharing - Fortran Version
C In this example, the iterations of a loop are scheduled dynamically
C across the team of threads. A thread will perform CHUNK iterations
C at a time before being scheduled for the next CHUNK of work.
C AUTHOR: Blaise Barney 5/99
C LAST REVISED: 01/09/04
C******************************************************************************
PROGRAM WORKSHARE1
INTEGER NTHREADS, TID, OMP_GET_NUM_THREADS,
+ OMP_GET_THREAD_NUM, CHUNKSIZE, ICHNK
integer*8 N, I
PARAMETER (N=10000)
PARAMETER (CHUNKSIZE=50)
REAL*8 A(N), B(N), C(N), alp
alp=dfloat(N)/10.0d0
! Some initializations
DO I = 1, N
A(I) = dfloat(I-1)/ (2.0d0*3.141592654d0*alp)
B(I) = dfloat(I-1)/(alp)
ENDDO
ICHNK = CHUNKSIZE
!$OMP PARALLEL SHARED(A,B,C,NTHREADS,ICHNK) PRIVATE(I,J,TID)
TID = OMP_GET_THREAD_NUM()
IF (TID .EQ. 0) THEN
NTHREADS = OMP_GET_NUM_THREADS()
PRINT *, 'Number of threads =', NTHREADS
END IF
PRINT *, 'Thread',TID,' starting...'
!$OMP DO SCHEDULE(DYNAMIC,ICHNK)
do J=1,40000
DO I = 1, N
C(I) = dsqrt(dcos(A(I)) * dexp(-B(I))*dcos(A(I)))
C(I)=C(I)*C(I)
! WRITE(*,100) TID,I,C(I)
! 100 FORMAT(' Thread',I2,': C(',I7,')=',F10.5)
ENDDO
enddo
!$OMP END DO NOWAIT
PRINT *, 'Thread',TID,' done.'
!$OMP END PARALLEL
END