-2

Is there a tool that converts C++ code into fortran? Please state any possible deficiency of the tool you use.

I know it sounds silly but I do have a C++ code that calls a big Fortran code inside and I need to to use OpenMP. I am trying to keep the parallel region only inside Fortran (because there are many COMMON blocks and EQUIVALENCEs used) so I have to translate a few hundreds of lines of C++ functions to Fortran.

Yousef
  • 7
  • 1
  • 2

1 Answers1

3

Depending on the compiler (such as the GNU compilers), you're actually able to compile C, C++, Fortran, etc. code together. This is so you don't actually have to translate or rewrite that code. C++ Forum Answer

Russley Shaw
  • 441
  • 2
  • 9
  • In fact compiling together is what I am doing here. The problem is that I cannot initiate all the variables used in the FORTRAN parallel region in the C++ part beforehand. Therefore I have to keep the parallel part in Fortran only. – Yousef Mar 10 '16 at 21:07