作为Scheme函数调用Fortran例程 [英] Calling a fortran routine as a Scheme function

查看:151
本文介绍了作为Scheme函数调用Fortran例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将Fortran程序作为Scheme函数调用?我可以通过搜索网站找到任何东西。

Is it possible to call a Fortran routine as a Scheme function? I could find nothing by searching the web.

推荐答案

可能吗?技术上,是的。大多数现代Fortran编译器(例如ifort,gfortran)支持由Fortran 2003标准定义的ISO C互操作性功能集。因此,应该可以使用Fortran语言为Fortran库编写一个C兼容API。一旦你有了C API,你应该可以使用你的方案实现提供的标准C FFI。当然,调用C函数的所有常见注意事项也适用于此。

Is it possible? Technically, yes. Most modern Fortran compilers (e.g. ifort, gfortran) support the ISO C Interoperability feature set defined by the Fortran 2003 standard. Thus, it should be possible to write a C compatible API for the fortran libraries you need using the Fortran language. Once you have the C API in place, you should be able to use the standard C FFI provided by your scheme implementation. Of course, all of the usual caveats of calling a C function will also apply here.

这篇关于作为Scheme函数调用Fortran例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆