Scons 教程,重点是 Fortran

发布于 2024-12-19 21:23:02 字数 588 浏览 3 评论 0原文

当我用谷歌搜索标题中的内容时,我发现最好的是一些半有用的、快速编写的教程。是否有权威的 scons 教程(或者更好,一本书!)来处理整个问题 - 从正确安装到编写“makefile”。如果它能处理一些 Fortran 方面(依赖关系),那就更好了?

ps 这是一个主题吗,还是应该交给程序员?在超级用户上,这可能没问题,但我怀疑那里的目标人群与这里的人们一样多地使用 SCons。


编辑:使用模块编译示例 fortran 程序

中的程序源文件c:\some-project\source\

main.f90 (program)
constants.f90 (module with subroutines)
interpolation.f90 (subroutines)

a) 构建模块
b) 在 c:\some-project\build\
中构建程序(因此 .exe 结束) c) 之后清理 .obj 文件

如何使用 Scons + ifort (或任何其他编译器 - 之后我将修改开关)来做到这一点?

When I google for the items in the title, the best I'm finding are some semi-useful, quick-written tutorials. Is there an authoritative scons tutorial (or even better, a book!) that deals with the whole matter - from correct installation, to writing "makefiles". It would be even better if it dealt with some of the fortran aspects (dependencies)?

p.s. Is this ontopic here, or should have it gone to programmers? On SuperUser it would probably be okey, but I doubt the target population there uses SCons as much as people here.


Edit: Compiling an example fortran program with modules

Program source files in c:\some-project\source\

main.f90 (program)
constants.f90 (module with subroutines)
interpolation.f90 (subroutines)

a) build modules
b) build program (so .exe winds up) in c:\some-project\build\
c) clean up .obj files afterwards

How to do it with Scons + ifort (or any other compiler - I'll modify the switches afterwards)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

時窥 2024-12-26 21:23:02

SCons 有两个权威参考,手册页用户指南。据我所知,还没有关于 SCons 的出版书籍。

SCons 并不意味着很难,事实上它是专门为使基本构建变得简单而设计的。事实上,设置 fortran 项目的工作方式应该与设置 ac 项目的方式完全相同。

env = DefaultEnvironment()
env.Program( 'hello-world', ['hello.f','world.f'] )

可能会改变的是您用来指定编译器选项的环境选项。如果您不确定如何调整哪些选项,可以调用 env.Dump() 来获取环境中所有键和关联值的列表。

There are two authoratative references for SCons, the man page, and the user guide. To the best of my knowledge there are no published books on SCons.

SCons isn't meant to be hard, in fact it is specifically designed be make doing basic builds simple. In fact, setting up a fortran project should work in exactly the same way as it does for a c project.

env = DefaultEnvironment()
env.Program( 'hello-world', ['hello.f','world.f'] )

What may change are the environment options that you use to specify options to the compiler. If you are unsure how which options to adjust, you can call env.Dump() to get a list of all the keys and associated values inside the environment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文