1 (edited by davidb 2015-09-11 09:52:14)

Topic: Program compiled with OpenMP enabled won't run

My program is compiled with -fopenmp.

It used to work fine (in Windows 8.1) but now (in Windows 10) I get the following error when I try to run.

"The application was unable to start correctly (0xc0000142). Click OK to close the application."

I am using SF 2.24 Build 1921 (which I think is the latest).

--
David

Re: Program compiled with OpenMP enabled won't run

David,

I would guess that your path is not properly configured.  OpenMP-compiled programs must be  able to find pthreadGC2-32.dll or pthreadGC2-64.dll on the path. Simply Fortran installs  these to:

C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin

by default.  You can try copying one or both DLLs to your project directory to see if it fixes the problem.

If you upgraded your machine from 8.1 to 10, I would guess that the upgrade process may have deleted some path changes.  Reinstalling Simply Fortran would fix the problem.

Jeff Armstrong
Approximatrix, LLC

Re: Program compiled with OpenMP enabled won't run

Jeff,

Thank you for your reply. My Path is correct and includes C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin.
I can also confirm that the two DLLs you mention are in this directory.

I have also tried copying the DLLs to the project directory, but that didn't work either.

Is it possible that these two DLLs don't work in Windows 10?

I have also tried doing a Static build, which won't use the DLLs, and that worked. But I would like the non-static build to work as well.

--
David

Re: Program compiled with OpenMP enabled won't run

David,

It looks like there is a problem when not statically linking, which seems odd.  I'll have to investigate things a bit more.  A segmentation fault occurs in the pthread DLL initialization code.  Apparently this bug was never manifested on earlier versions of Windows.

For now I would suggest proceeding with statically linking or disabling OpenMP until I have a bug fix available.

Jeff Armstrong
Approximatrix, LLC

5 (edited by davidb 2015-09-14 17:22:33)

Re: Program compiled with OpenMP enabled won't run

Jeff,

Thanks for confirming my own thoughts.

Certainly things have changed in Windows 10 somewhat, which is causing a fair bit of problems with various software I have installed.

I will wait for a bug fix from your good self.

--
David

Re: Program compiled with OpenMP enabled won't run

David,

I wanted to provide an update on this bug.  I currently am working on an updated compiler build for Simply Fortran 2.25, and using OpenMP should no longer require pthreads at all.  I've moved most everything to native Windows thread API calls, and it should alleviate the issue you've reported.  I might ask you to try out version 2.25 when it is packaged prior to release if you're willing to test the new OpenMP backend with your code.

Jeff Armstrong
Approximatrix, LLC

7 (edited by davidb 2015-09-28 20:40:30)

Re: Program compiled with OpenMP enabled won't run

Jeff,

Thanks. I would be happy to test it with my OpenMP codes.

I have sent you an email.

Regards,
David.

--
David

Re: Program compiled with OpenMP enabled won't run

David,

I've sent you a private message with the download link for the pre-release version of Simply Fortran 2.25.  If you don't get it, feel free to email me directly at support@approximatrix.com.

Jeff Armstrong
Approximatrix, LLC

Re: Program compiled with OpenMP enabled won't run

I have downloaded the file and will try it out as soon as I can.

It might be a few days though.

--
David

Re: Program compiled with OpenMP enabled won't run

David,

Thank you for evaluating the latest version.  Simply Fortran 2.25 has been released with the changes to our OpenMP implementation.

Jeff Armstrong
Approximatrix, LLC