Mixed language programming with FORTRAN for tcl/tk extension
I have been working on this for a while, and got a lot of help from
Arjen (thanks to Arjen). I am bumping into some compiling programming
problems now and probably some of you can help me. I have tried many
different approaches and decided this may be the best way for me. I
think the try itself maybe interesting, so I will describe it in
details
1. The objective
I have a lot of fortran subroutines, which has been used for more than
10 years. They are stable and I don't want to touch them or transfer
them into C either (at least not for now). Recently my customer need
GUI, scripting and such things upon my FORTRAN subroutines. After long
discussion with everyone, I decided the best way is to embed my fortran
codes into the original Tcl/tk source code as some extension command.
2. What I have tried
I have tried many different things (including Arjen's Ftcl, which is
The compiling is actually more different than coding (for me).
Originally I was coding under VC++. However the customers asked me to
port everything into visual studio. Finally I have to modify the
NMAKE.VC supplied with tcl.tk source distribution. I extend the .obj
files list in the file, and specify the souece for these obj (which are
used for the extension)
I tested simple C code first (without FORTRAN). It works.
3. The compilation problem
Now it comes the problems. In order to use VS we will have to use Intel
FORTRAN, which is embedded into VS. The document say the fortran has to
be separated into static library projects These are all fine. Compiling
fortran into static libraries is not a problem
But, I can never get the C main program of tcl/tk to "see" the FORTRAN.
First I just wrote a simple C program to call my fortran, and I tried
to put FOREAN project into the VC project. It never worked out
(actually I don't know what I am doing here). Anyway, it should be a
simple problem of how to use Visual Studio. However my customer has
never done this before so we were stocked here.
Even if this problem is solved, how can we embeded the FORTRAN project
into the Tcl source distribution ? (NMAKE,VC)
Any help will be greatly appreciated.
Regards
S-Y. Chen
|