Re: how to call C (non-intel C compiler) from ifort (intel fortran)?



ktrchang@xxxxxxxxx wrote:
| Hi there,
|
| I need to call C within fortran code. I could compile and link using
| Visual Fortran
| and Visual C++.
|
| Fortran code is like:
| .
| CALL SUB1(arg1, .......)
| .
| .
| C code is like:
| #define sub1 __stdcall SUB1
| .
| void sub1 ( arg1, ........)
| .
| .
| Now I have to use another machine with Intel Fortran (ifort) with .NET
| (Visual Studio
| 2005). When I linked, I got error message "unresolved external symbol
| _SUB1".
| What is the right way to do? (For using ifort with icc, an example is
| shown in
|
http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/Intel64Cluster/Doc/fortrancallc.html)
|
| Any help is very much appreciated.

Intel changed the default calling convention from __stdcall to __cdecl,
when it took over the CVF. So, either adjust it on C side, or change the
calling convention on Fortran side. In addition, the way how CHARACTER
arguments are passed is also changed -- the hidden length is now passed
at the end of argument-list rather than immediately following the string
argument.

--
Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.

.



Relevant Pages

  • Re: Windows to Linux Fortran code
    ... I am to "convert" a program written in fortran under windows, ... are called from DOS script files that act upon menus written in some ... Local "environment variables" have been set ... If you do decide to use OS system calls from within your Fortran code ...
    (comp.lang.fortran)
  • Re: TYPE declaration/statement in Fortran 77 code
    ... I have a piece of code (Fortran 77) that contains a lot of these ... As such, it doesn't compile with any compiler I tried (gfortran, ... makes it compilable with ifort. ... I couldn't find anything related to TYPE declarations in this ...
    (comp.lang.fortran)
  • TYPE declaration/statement in Fortran 77 code
    ... I have a piece of code (Fortran 77) that contains a lot of these TYPE ... As such, it doesn't compile with any compiler I tried (gfortran, g95 ... makes it compilable with ifort. ... I couldn't find anything related to TYPE declarations in this context, ...
    (comp.lang.fortran)
  • Re: Making a time series analysis package in python - advice or assistance sought
    ... Also I have loads of software in such languages as FORTRAN ... The Fortran code, which I assume is Fortran 77 or earlier, should run ... and high-res graphics and easy to use. ... Able to read time series data in a variety of formats. ...
    (comp.lang.python)
  • Re: DFPORT
    ... I am trying to compile some example code written in Fortran77 that uses ... It's a compatibility library from Digital Fortran. ... If you're not using DVF, CVF, or ifort, then the answer to "where can I get it from" depends on your compiler. ... Some compilers include many of the things in IFPORT as intrinsics. ...
    (comp.lang.fortran)