Hi Guys,
I am really new to PASCAL and fpc. I am working on a project where I have to make the PASCAL code as a shared library and then load into FORTRAN.
I have successfully made the .so and using dlopen command I am able to load the .so in my FORTRAN. In PASCAL, I used exports command to expose some functions and they return results correctly in FORTRAN.
Now, I have to load multiple instances of this .so in my FORTRAN in a loop with different initial conditions. Also, these are loaded using openmp thread.
Here comes my problem. I could see that variables are getting shared between threads in FORTRAN and hence my results are wrong.
I tried many things in FORTRAN and PASCAL. In PASCAL, I tried threadvar, -Cg compiler flag but still no luck.
I need to implement this immediately and I am completely lost
Can anyone please let me know what I can do? Thanks in advance
Note: My PASCAL code is huge and hence I can’t make any big code change or refactoring.