Giter Site home page Giter Site logo

C interface about librefprop.so HOT 6 CLOSED

jowr avatar jowr commented on August 16, 2024
C interface

from librefprop.so.

Comments (6)

jowr avatar jowr commented on August 16, 2024

TODO:

  • Write the C interface
  • Change all function names in the other files
  • Remove additional header files
  • Test the code and makefile

from librefprop.so.

ibell avatar ibell commented on August 16, 2024

I have an even better solution.

In the PASS_FTN.for file, add BIND(C, NAME="SETUPdll") to the end of each subroutine. For instance, setup function would become

c ======================================================================
      subroutine SETUPdll (i,hfld,hfm,hrf,ierr,herr) BIND(C, NAME="SETUPdll")
      include 'commons.for'
cDEC$ ATTRIBUTES DLLEXPORT, Decorate, Alias: "SETUPdll"::SETUPdll
cDEC$ ATTRIBUTES STDCALL, REFERENCE::SETUPdll
c     dll_export SETUPdll
      integer*4 i
      character*10000 hfld
      character*255 hfm, herr
      character*3 hrf
      call SETUP0 (i,hfld,hfm,hrf,ierr,herr)
      end

which would then get exported by gfortran as SETUPdll when compiled with fortran 2003. I'm in contact with Eric Lemmon and I think we can get this change made upstream.

It's pretty easy to search the PASS_FTN.for file to find the subroutine lines, parse them, and then add the BIND(C, ...) output.

from librefprop.so.

jowr avatar jowr commented on August 16, 2024

I'll give it a try. Thanks for the suggestion. I guess everyone except my group works with fairly new Fortran versions...

This potentially solves so many pitfalls regarding header files and function names for cross-platform development.

from librefprop.so.

ibell avatar ibell commented on August 16, 2024

Turns out its not quite so straightforward. You have to worry about C
style and FORTRAN style strings. But I think that I am mostly done.

On Wed, Oct 1, 2014 at 7:32 AM, Jorrit Wronski [email protected]
wrote:

I'll give it a try. Thanks for the suggestion. I guess everyone except my
group works with fairly new Fortran versions...

This potentially solves so many pitfalls regarding header files and
function names for cross-platform development.


Reply to this email directly or view it on GitHub
#17 (comment).

from librefprop.so.

jowr avatar jowr commented on August 16, 2024

Thanks. You are mostly done? Means I should hold my horses? Looking
forward to have a solution presented by you ;-)

from librefprop.so.

jowr avatar jowr commented on August 16, 2024

I would say that this has been solved by the new header files.

from librefprop.so.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.