<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=133</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=133&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Windows Openmp exe crashes with message of missing pthreadGC-32.dll.]]></description>
		<lastBuildDate>Mon, 14 Jan 2013 14:08:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=468#p468</link>
			<description><![CDATA[<p>Rod,</p><p>A DLL would have to be converted to a static library first to statically link the DLL into the executable.&nbsp; &nbsp;While there are tools to convert libraries, it is significantly simpler to actually compile a static library in the first place.&nbsp; </p><p>As for others not encountering the problem, it could be that those users who are working with OpenMP on Simply Fortran are doing both development and the analyses using the resultant program all on the same machine.&nbsp; Also, there&#039;s a good chance that some users silently discovered and solved the problem themselves without having mentioned it on the forums.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 14 Jan 2013 14:08:12 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=468#p468</guid>
		</item>
		<item>
			<title><![CDATA[Re: Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=467#p467</link>
			<description><![CDATA[<p>Thanks Jeff, I can live with this constraint for now since I am struggling with understanding what the openmp directives do in my simulation. I will probably open a new thread in the forum to ask questions about that. However, I need to do some more homework on this I think.</p><p>That said, I am surprised the no one else has had an issue with executable portability and the need to have that DLL on the local machine. Isn&#039;t there some way to link that DLL in the build step?</p><p>Much appreciation for the help!<br />Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Sun, 13 Jan 2013 15:55:08 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=467#p467</guid>
		</item>
		<item>
			<title><![CDATA[Re: Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=466#p466</link>
			<description><![CDATA[<p>Rod,</p><p>You are correct in that you&#039;ll need that DLL to be shipped with your executable to run the code on another machine.&nbsp; I&#039;ll look into building a statically linked version of the library that could eliminate this issue.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Sun, 13 Jan 2013 15:30:53 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=466#p466</guid>
		</item>
		<item>
			<title><![CDATA[Re: Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=464#p464</link>
			<description><![CDATA[<p>Thanks for the response Jeff. </p><p>Ok, so I put a copy of the DLL in the directory I execute the program in and it does now run. I realized that I made a rookie mistake. The CMD prompts that I had open, were opened before the installation of Simply Fortran. Thus they never picked up the new path. Opening a new CMD window picks up the correct path, d&#039;oh! </p><p>However, the above behavior disturbs me since I want to eventually create an executable that is completely self contained; without the constraint of having this DLL or not on computer that is executing the program. I want to the executable to be portable. Am I correct in my understanding that this DLL must be on the computer to run? If so, is there a way to pull the contents of the DLL into my code?</p><p>Thanks again,<br />Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Sun, 13 Jan 2013 15:02:42 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=464#p464</guid>
		</item>
		<item>
			<title><![CDATA[Re: Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=463#p463</link>
			<description><![CDATA[<p>From the sounds of it, you shouldn&#039;t be experiencing any issues since the Simply Fortran <em>mingw-w64\bin</em> directory is on the path.&nbsp; However, you clearly are having an issue.&nbsp; One thing you can try is copying <em>pthreadGC2-32.dll</em> from the <em>mingw-w64\bin</em> directory to your project directory and try running the program again.&nbsp; When a DLL is needed, Windows first searches the directory where the executable exists, then the path.&nbsp; Hopefully the example will run if the DLL is in the same directory as the executable.</p><p>Let us know if you succeed in getting the example to work.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Sun, 13 Jan 2013 14:33:54 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=463#p463</guid>
		</item>
		<item>
			<title><![CDATA[Windows Openmp exe crashes with message of missing pthreadGC-32.dll]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=462#p462</link>
			<description><![CDATA[<p>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 &quot;before time&quot;. 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.</p><p>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:</p><p>gfortran workshare.f -o workshare -O2 -fopenmp</p><p>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. </p><p>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:</p><p>==============================================================================<br />Open Watcom Make Version 1.9 (Built on May 17 2012)<br />Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.<br />Source code is available under the Sybase Open Watcom Public License.<br />See <a href="http://www.openwatcom.org/">http://www.openwatcom.org/</a> for details.<br />&nbsp; &nbsp; &quot;F:\SimplyFortran\mingw-w64\bin\gfortran.exe&quot; -c -o build\workshare.o -g -m32 -IF:/SimplyFortran/mingw-w64/include/ -O2 -fopenmp -Jmodules .\workshare.f<br />&nbsp; &nbsp; &quot;F:\SimplyFortran\mingw-w64\bin\gfortran.exe&quot; -o f:\riod\temp\workshare.exe -static -m32 build\workshare.o -LF:/SimplyFortran/mingw-w64/lib/ -lgomp -lpthread</p><p>* Complete *</p><p>This looks normal build from what I can tell.</p><p>However, when I run the executable, a Windows pop up comes telling me the following:</p><p>&quot;The program can&#039;t start because pthreadGC2-32.dll is missing from your computer. Try reinstalling the program to fix this problem.&quot; </p><p>The above dll is in my path and is in the bin directory of the SF install directory. </p><p>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:</p><p>C FILE: omp_workshare1.f<br />C DESCRIPTION:<br />C&nbsp; &nbsp;OpenMP Example - Loop Work-sharing - Fortran Version<br />C&nbsp; &nbsp;In this example, the iterations of a loop are scheduled dynamically<br />C&nbsp; &nbsp;across the team of threads.&nbsp; A thread will perform CHUNK iterations<br />C&nbsp; &nbsp;at a time before being scheduled for the next CHUNK of work.<br />C AUTHOR: Blaise Barney&nbsp; 5/99<br />C LAST REVISED: 01/09/04<br />C******************************************************************************</p><p>&nbsp; &nbsp; &nbsp; PROGRAM WORKSHARE1</p><p>&nbsp; &nbsp; &nbsp; INTEGER NTHREADS, TID, OMP_GET_NUM_THREADS,<br />&nbsp; &nbsp; &nbsp;+&nbsp; OMP_GET_THREAD_NUM, CHUNKSIZE, ICHNK<br />&nbsp; &nbsp; &nbsp; integer*8 N, I<br />&nbsp; &nbsp; &nbsp; PARAMETER (N=10000)<br />&nbsp; &nbsp; &nbsp; PARAMETER (CHUNKSIZE=50)<br />&nbsp; &nbsp; &nbsp; REAL*8 A(N), B(N), C(N), alp</p><p>&nbsp; &nbsp; &nbsp; alp=dfloat(N)/10.0d0<br />!&nbsp; &nbsp; &nbsp;Some initializations<br />&nbsp; &nbsp; &nbsp; DO I = 1, N<br />&nbsp; &nbsp; &nbsp; &nbsp; A(I) = dfloat(I-1)/ (2.0d0*3.141592654d0*alp)<br />&nbsp; &nbsp; &nbsp; &nbsp; B(I) = dfloat(I-1)/(alp)<br />&nbsp; &nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; &nbsp; ICHNK = CHUNKSIZE</p><p>!$OMP PARALLEL SHARED(A,B,C,NTHREADS,ICHNK) PRIVATE(I,J,TID)</p><p>&nbsp; &nbsp; &nbsp; TID = OMP_GET_THREAD_NUM()<br />&nbsp; &nbsp; &nbsp; IF (TID .EQ. 0) THEN<br />&nbsp; &nbsp; &nbsp; &nbsp; NTHREADS = OMP_GET_NUM_THREADS()<br />&nbsp; &nbsp; &nbsp; &nbsp; PRINT *, &#039;Number of threads =&#039;, NTHREADS<br />&nbsp; &nbsp; &nbsp; END IF<br />&nbsp; &nbsp; &nbsp; PRINT *, &#039;Thread&#039;,TID,&#039; starting...&#039;</p><p>!$OMP DO SCHEDULE(DYNAMIC,ICHNK)<br />&nbsp; &nbsp; &nbsp; do J=1,40000<br />&nbsp; &nbsp; &nbsp; DO I = 1, N<br />&nbsp; &nbsp; &nbsp; &nbsp; C(I) = dsqrt(dcos(A(I)) * dexp(-B(I))*dcos(A(I)))<br />&nbsp; &nbsp; &nbsp; &nbsp; C(I)=C(I)*C(I)<br />!&nbsp; &nbsp; &nbsp; &nbsp; WRITE(*,100) TID,I,C(I)<br />! 100&nbsp; &nbsp; FORMAT(&#039; Thread&#039;,I2,&#039;: C(&#039;,I7,&#039;)=&#039;,F10.5)<br />&nbsp; &nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; &nbsp; enddo<br />!$OMP END DO NOWAIT</p><p>&nbsp; &nbsp; &nbsp; PRINT *, &#039;Thread&#039;,TID,&#039; done.&#039;</p><p>!$OMP END PARALLEL</p><p>&nbsp; &nbsp; &nbsp; END</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Sat, 12 Jan 2013 16:55:13 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=462#p462</guid>
		</item>
	</channel>
</rss>
