this article comes from "http://www.fesb.hr/~psarajce/photran.html"
----------------------------------------------------------------
Photran Tutorial
Photran is a full featured Fortran IDE for Linux OS (IDE - Integrated Development Environment). It can be bundled with various Fortran compilers (e.g. Intel Fortran Compiler, F compiler, G95, gfortran, etc.), which means that it is not dependent upon any particular Fortran compiler. It is completely GUI interfaced, with included front-end for underlaying fortran debugger. Project development is maintained through the use of standard "make" utility and a user written makefiles. This means that user writes its own makefile and uses underlying Fortran compiler present on his system to build and execute programs, directly from the Photran IDE. Latest version of the Photran IDE at the time of writing this is 4.0, which includes a Managed Make Fortran Projects, which means that Photran automatically creates makefiles for new Fortran projects. By using the version 4.0 of Photran IDE user doesn't need to write his own makefile (Photran automatically creates one for his project), as will be explained later. This is only the case with Intel Fortran Compiler and Gnu Fortran compiler. This Fortran IDE is based on Eclipse and hence highly adaptable. Its editor has a syntax highlighting for Fortran 90/95 programming language (including the brackets matching feature). It has also syntax highlighting support for the built in makefile editor, which simplifies the process of writing makefiles, without leaving this application. It can be said that Photran IDE supports FORTRAN 77 syntax as well and thus can be used to develop these type of Fortran projects. Due to the fact that Fortran 90/95 routines could flawlessly call routines written in FORTRAN 77, legacy code could be easily exploited through "mixed language" (F90/95 + F77) source code projects, developed within this Fortran environment. This environment is called the Workbench . The term Workbench refers to the desktop development environment. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources. Each Workbench window contains one or more perspectives. Perspectives contain views and editors and control what appears in certain menus and tool bars. More than one Workbench window can exist on the desktop at any given time.
Photran application (Workbench) can be extensively configured by positioning its window parts in a manner desired by the user itself. Example of the window positions / configurations is given in the figure above. On the left side of that figure the files included in the project are alphabetically listed. Central area in the mentioned figure features a pane / window where the source files are displayed for editing. Photran editor supports tabs for editing several source code files simultaneously. It is in fact a full-featured Fortran programming language editor with syntax highlighting (as can be seen from the above figure). It fully supports Fortran 90/95 programming language! Multiple source code files could be opened in the editor, which are shown in the form of tabs above the editors window. User jumps from one source code file to the other just by clicking on the desired tab. Active tab is shown in blue. Bottom part of the figure shows a build window where the compiler information is displayed during the build process. All compiler warnings and errors are shown in this window, including the line number in the source code where the error is detected. By clicking on the error line in this window a cursor is positioned on the source code line in editor window where the error is found. This greatly simplifies the process of hunting down compilation errors. Several other windows could be opened and positioned according to the users needs. One possible configuration is presented in the above figure.
Photran software package has different workspace perspectives; one for the Fortran project development (writing source code and building application) which is opened by default, and the other for debugging the fortran project / application. Workspace persppective for developing fortran application is shown in the above figure, which is signified with the active Fortran tab on the upper right corner of the application / workbench window. Photran supports debuggers for the Fortran programming language, which are bundled with this IDE. Hence, one can debug his Fortran projects directly from the Photran IDE! Debugging process initiates a new workspace perspective designed for debugging a Fortran projects / programs. This perspective can be extensively configured as well.
When using Photran, your code is organized into workspaces and projects. A project usually will contain the code for one complete program, consisting of a main program, several subprograms and possibly some modules organized in several source code files. These files, and others used by the Photran system, usually are stored in one directory whose name is the name of the project. A workspace consists of projects; it uses a directory whose name is the name of the workspace to store the project directories. A workspace might contain only one project or several of them. Only single project can be active at any given time. You can freely open and close projects within the workspace, but only the currently active project can be modified. In order to use Photran for Fortran 90/95 development, you must create a project, which is part of some workspace. You then add source code files to that project, either by copying existing files into the project or by creating new source code files and typing in the code. Then, using the Photran, the project can be built, run, and debugged.
As a conclusion of the introduction to the main Photran features it can be stated that extensive documentation regarding Eclipse platform can be obtained within this application (Help => Workbench user guide ). All of this documentation regarding the Eclipse workspace (Workbench) organization and usage is directly applicable to the Photran environment.
User is advised to get familiar with this documentation which is bundled directly into the Help system of the Photran software package. Above figure presents this Help system with documentation regarding The Workbench. Here user can find extensive description of all concepts and get detailed step-by-step instructions on creating and managing projects and files. As a part of this official Photran Help system there is a C/C++ Development User Guide (which can be seen on the above figure). This guide can be applied (with minor modifications on the lines described in this document) to Fortran 90/95 development.
Installation procedure
Installation process for the Photran IDE application on Linux platform is very easy. One only needs to download the application from eclipse project web pages. Best is to use the Full versions, such as: Full Photran for Linux/GTK (32 bit architectures) or Full Photran for Linux/GTK x86/64 (64 bit architectures). It is a "tar ball" which needs to be extracted somewhere. By extracting this tar ball a new directory is created named: eclipse and the process of installation of Photran is finished! Application is executed by running the program: eclipse in the same directory. You can make a symbolic link to the executable file: eclipse to make it more convenient to launch the application.
If you already have eclipse or eclipse and CDT installed on your system you can for example create a new directory called: Photran and extract this tar ball here, in order not to collide with the existing directory called: eclipse (which contains your standard eclipse application). |
In newer versions of Photran, installation procedure is somewhat different from tha described above. To install Photran 4.0 beta 5,
- you must have Eclipse 3.4 (Ganymede) installed,
- you must have the C/C++ Development Tools (CDT) 5.0 installed,
- Eclipse must be running on a Java 1.5 or later JVM (to get reasonable performance, we recommend Sun [1] or IBM's [2] JVM), and
- if you want to compile and build Fortran applications, you must have a make utility and a Fortran compiler in your system path. Many Linux/Unix systems include these; details on installing them in Windows are below.
Firstly you need to download and install Eclipse version 3.4. Installation instructions for Eclipse could be found on their web site. It is a very straightforward task, which basically involves an extraction of a tar ball somewhere in your home directory. You end up with an eclipse directory which containes project directories and executable (called eclipse). You might want to put a simbolic link to this executable in order to be able to access it more rapidly. Once that has been taken care of you can proceed with the installation of Photran plugin. To install Photran, start Eclipse 3.4, then...
- Download the latest Photran zip file from [3]
- Click on Help => Software Updates...
- Click on the "Available Software" tab
- Click on "Add Site..."
- Click Archive...
- Choose the zip file you downloaded from [4]
- Click OK to close the Add Site dialog
- The zip file should appear in the list as jar:file:/path/to/photran-master-4.0.5-something. Expand it.
- Expand "Photran (Eclipse Fortran Development Tools)" and check the box next to "Photran (Eclipse Fortran Development Tools) (Eclipse Technology Incubation)"
- If you have Intel Fortran installed on Linux then expand "Photran Compiler Support" and select the appropriate compiler as well.
- Click on the "Install..." button in the upper-right corner of the dialog box.
Installation has been tested by the author of this file on openSUSE Linux distribution (several versions of openSUSE, e.g. 10.0, 10.2, 10.3 and with different versions of Linux kernel) and can be reported to work without any problems. Photran, once installed, just "picks up" any Fortran 90/95 compiler which is present on the system, through the provided makefile. It has been tested by the author with the Intel Fortran Compiler for Linux (several versions, e.g. 8.1, 9.0, 9.1) and can be reported to work flawlessly. It has been also tested with the gfortran (which is a part of the GCC) and G95 Fortran compiler and works without any problems.
Building projects
This part of the Tutorial is intended for the 3.2.0 version of the Photran IDE. Tutorial for the Photran 4.0 version is given later in the text. Process of building a new Fortran 90/95 project in Photran IDE is very similar to the project building process in any other Development Environment (including those on Windows OS, e.g. Compaq Visual Fortran Development Environment). One starts with the: File => New => Project... which opens a dialogue box presented in the following figure.
In this dialogue, under the Fortran category one must select: Standard Make Fortran Project and press on the Next> button. A new dialogue box, presented in the following figure, opens. It needs to be said that at this stage of Photran IDE development Managed Make Fortran Projects are NOT supported (in the version 3.2.0 of the Photran IDE)!
Here one needs to define the name of the project (e.g. HelloWorld is the name selected for the project considered in this tutorial) and the directory to hold this project. Projects could be saved / accumulated in the default workspace directory of the eclipse application. This is recommended practice. Press on the Next> button and then on the dialogue box which opens select the Make Builder tab , as shown in the following figure.
Here, specify Build command (make), Incremental build (all) and Clean (clean) as shown in the above figure. This will be used in combination with the makefile to build the project (or incrementally build it, or clean the project for the so-called clean build). Other tabs shown in the above figure are not crucial (significant) for the creation of the project and can be left with default values. Once the project is created these values can be changed by choosing: Project => Properties and selecting the category: C/C++ Make Projects (in the version 3.2.0 of the Photran IDE). Press on the Finish button and you have just created a new Fortran project, which is completely empty. Hence, you need to add some source code fi
les and finally a makefile.
If you already have Fortran 90/95 source files somewhere on the system you can import them into this newly created project. This can be accomplished by selecting the: File -> Import... which opens the import dialogue box (same thing could be accomplished by right clicking on the Project icon in the left side pane and selecting the Import ... command from the drop down menu. Otherwise you need to create new Fortran 90/95 source code files. |
To add new Fortran source code files into this project select: File => New => Source File which opens the dialogue box presented in the following figure.
Enter the name of the source code file, including the file extension .f90 and the press the Finish button. This source code file is automatically opened in the Fortran editor ready to be edited. This process can be repeated for any number of source code files which will comprise the final project.
In order to build this project one needs to create a makefile . In order to create a new makefile select: File => New => File which opens the following dialogue box, presented in the figure below.
In the file name field enter: makefile and press Finish button. A new makefile is opened in the editor window of the Photran IDE application ready to be edited / created.
If you already have a makefile created for this project (or some other makefile which you will edit for this project) somewhere on the system, you can import it into this newly created project. This can be accomplished by selecting the: File => Import... which opens the import dialogue box (same thing could be accomplished by right clicking on the Project icon in the left side pane and selecting the Import ... command from the drop down menu. |
Makefile must be created in the distinct way (as will be explained later in this section) in order to be compatible with the commands selected on the Make Builder dialogue box during the process of creating the Fortran project. This is in regard with the use of all and clean parts of the makefile. Strict rules need to be followed, as explained below, otherwise project might not compile or link properly.
Let us say for example that one has only one source code file called: hello.f90 containing all the source code for the project. In that case the makefile could be something like this:
# This makefile uses Intel Fortran Compiler for Linux # Start of the makefile all: hello hello: hello.o ifort -o hello hello.o hello.o: hello.f90 ifort -c hello.f90 # Cleaning the project clean: rm hello.o hello # End of the makefile |
In the makefile above a name hello is selected for the executable file. More advanced makefiles which include variables and other advanced features could be crated as well. It should be noted that the rule all must be the first rule in the makefile, with Make Builder configured as explained earlier.
Once the source code file(s) is(are) edited / created and a particular makefile is created for the project in question, one can proceed with the actual building of the project. Building procedure consists of the compile and link stages, which are defined through the makefile. In order to build the project choose: Project => Build All . Any compiler errors and warnings will be displayed in the Problems
pane of the Photran application window. This pane is usualy positioned at the bottom of the Photran IDE window and can be activated by selecting its tab. By selecting the line with the displayed compiler warning in the Problems pane the cursor is automatically positioned in the source code line in editor window where that error is found. This greatly simplifies the process of hunting down bugs in the compilation phase of the Fortran project development.
Running the successfully built (compiled and linked) application is accomplished by selecting: Run => Run As => Run Local C/C++ Application which executes that Fortran application. Yes it says Run Local C/C++ Application by you are running the Fortran Application (in the version 3.2.0 of the Photran IDE)! It should automatically open the console window and display any Fortran application text that is sent to default output stream. If the console window is not opened click on the console window icon (whose position depends on the organization of the Photran workspace) and console window will open. Console window is usualy positioned at the bottom portion of the Photran IDE window and can be activated by clicking on its tab.
Interaction of the user with the Fortran program can be accomplished through the console window and / or data files, which could be created and maintained directly within Photran workspace. To add new data file (with any extension which is supported by Fortran language) for the input data, select: File => New => File and in the opened dialogue enter the file name with the extension (e.g. input.dat). A new file will automatically open in the editor window, where you can input the necessary data. Output files could be browsed from the Photran workspace as well. Just choose Navigator pane and double click on the file that holds output data. It will display in the editor.
Several Fortran projects could be managed at the same time in the Photran workspace. Once you have temporarily finished working with one project close it and open the other one for editing (or create a new project). Only a single active project can be edited and / or executed at any given time.
Photran version 4.0
This version of Photran uses CDT 4.0.1 and Eclipse 3.3.1 and have some additional useful features which weren't present with previous versions (e.g. version 3.2.0 of the Photran IDE). This version (Photran 4.0.1) includes the Managed Make Fortran Projects for the Intel Fortran Compiler for Linux and GNU Fortran compiler. This means that the Photran IDE is automatically creating makefile for the user. Hence, one only needs to create or import source code files and Photran takes care of the makefile. This is a useful feature for those Fortran programmers / developers which are not used to writing their own makefiles. For those Fortran programmers / developers which are used to writing their own makefiles, this version can be used in the manner described above. Photran software package, due to the fact that it is a part of the Eclipse project, is under constant development and improvement. Hence, each new version is more user friendly with additional built-in functionality. It needs to be said that Photran 4.0 has more than enough functionality even for the advanced user (software developer) and could be considered as fully functional Fortran 90/95 IDE for Linux OS. Every newer version will bring additional functionality and hence could certainly satisfy Fortran developers.
For example, if one would want to create a Managed Make Fortran Project with Photran 4.0 IDE and have an Intel Fortran Compiler for Linux (link ) installed on the system, it can proceed as follows: File => New => Project... which open the followng dialogue box shown in the figure below. From that dialogue select the Fortran Project under the Fortran category as shown in the figure below.
Press the Next> button, which will open the following dialogue box, preseneted in the figure below.
Under the Project types on the opened dialogue box select the Executable (Intel(R) Fortran) , as shown in the figure above. Under the Project name enter the name of the Fortran project (e.g. HelloWorld is selected for the Fortran project used in this example). Press the Finish button and a new Fortran project is created. Now all one needs is to add new (or import) source code file(s) and build the project. Makefile for the project is automatically created by the Photran IDE! Building the Fortran project is the same as has been previously described. It needs to be said that Intel Fortran Compiler for Linux is available free of charge for non-commercial development. This is a great, extremely fast compiler, especially tuned for Intel processors (dual and quad core, 32 and 64 bit). This compiler supports OpenMP as well as automatic vectorization and parallel optimization of the source code (through various compiler options).
If you want to use the "standard" procedure with user created makefile, from the above presented dialogue box, under the Project types: append the Executable category and select the Empty project ! Now you need to create or import source code files and a makefile for the Fortran project. |
Running the successfully built (compiled and linked) application is accomplished by selecting: Run => Run As => Run Local C/C++ Application which executes that Fortran application. It should automatically open the console window and display any Fortran application text that is sent to default output stream.
Managing data files is accomplished in the exactly the same way as previously described. Several Fortran projects could be managed at the same time in the Photran workspace. Once you have temporarily finished working with one project close it and open the other one for editing (or create a new project). Only a single active project can be edited and / or executed at any given time.
Final notes
I would definitely recommend an upgrade to the newest version of the Photran, which is at the time of this writing Photran 4.0 with CDT 4.0.1 and Eclipse 3.3.1. This Fortran IDE, through the Managed Make Fortran Projects feature, simplifies the procedure of building Fortran projects. For those Fortran programmers / developers which are used to building their own makefiles, everything is the same as has been with the older versions. Though, user interface for defining Fortran project features is more user friendly in this version. Photran 4.0 IDE has been tested with openSUSE 10.3 (KDE) and Intel Fotran Compiler 10.1. It works without any problems, including Managed Make Fortran Projects feature. Debugging Fortran projects is also tested and works just fine. Finally, Photran software package, due to the fact that it is a part of the Eclipse project, is under constant development and improvement. Hence, each new version is more user friendly with additional built-in functionality. As a final note it needs to be said that Photran 4.0 has more than enough functionality even for the advanced user (software developer) and could be considered as fully functional Fortran 90/95 IDE for Linux OS.
相关推荐
- **Windows**:Code::Blocks、Simply Fortran、Eclipse/Photran等。 - **Linux**:Code::Blocks、Eclipse/Photran等。 - **安装方式**:在Linux系统上,可以通过包管理器安装`gfortran`,例如使用`sudo yum ...
http://photran.me/elyrics/ ========================== MIT 许可证 (MIT) 版权所有 (c) 2015 Pho Tran 特此授予任何人免费获得本软件和相关文档文件(“软件”)副本的许可,不受限制地处理本软件,包括但不...
dnSpy-net-win32-222.zip
和美乡村城乡融合发展数字化解决方案.docx
如何看待“适度宽松”的货币政策.pdf
NCO 3.0.18 64位
法码滋.exe法码滋2.exe法码滋3.exe
* GPS IMU经典15维ESKF松组合 * VRU/AHRS姿态融合算法 * 捷联惯导速度位置姿态解算例子 * UWB IMU紧组合融合 * 每个例子自带数据集
在现代社会生活与生产活动下,不可避免的会产生巨量且多样的垃圾。我国的人口和经济总量均位居世界前列,因此,必然面临着庞大数量的垃圾处理的难题。如何通过人工智能来对垃圾进行有效分类,成为当前备受关注的研究热点。本文为展开基于深度网络的垃圾识别与分类算法研究,先使用PyTorch框架中的transforms方法对数据进行预处理操作,后经过多次调参实验,对比朴素贝叶斯模型、Keras卷积神经网络模型、ResNeXt101模型的垃圾分类效果。确定最佳分类模型是ResNeXt101,该模型在GPU环境下的分类准确率达到了94.7%。最后利用postman软件来测试API接口,完成图片的在线预测。在微信开发者工具的基础上,利用一些天行数据的垃圾分类的API接口再结合最佳模型的API接口,开发出了一个垃圾分类微信小程序。本文的研究内容丰富和完善了垃圾图像分类的相关研究,也为后续的研究提供了一定的参考价值。
一、上位机简介 在单片机项目开发中,上位机也是一个很重要的部分,主要用于数据显示(波形、温度等)、用户控制(LED,继电器等),下位机(单片机)与 上位机之间要进行数据通信的两种方式都是基于串口的: USB转串口 —— 上位机和下位机通过USB转串口连接线直接相连进行数据交互 串口转WIFI(ESP8266)—— 上位机和下位机基于TCP/IP协议通过以太网或者WIFI传输数据 串口转蓝牙(HC-06)—— 不多用,暂不介绍 Windows上位机(EXE可执行程序),最早用VB语言开发,后来由于C++的发展,采用MFC开发,近几年,微软发布了基于.NET框架的面向对象语言C#,更加稳定安全,再配合微软强大的VS进行开发,效率奇高。 本文使用Visual Studio 2022作为开发环境,上位机开发主要有WPF框架与Winform框架,他们都是基于.NET框架 WPF需要C/S基础,使用XAML来构建应用UI,界面比较美观,但是内存开销大 Winform可以使用窗口控件来构建应用,比较简单易学 二、开发环境设置 1. 安装Visual Studio 首先,确保你已经
course_s4_ALINX_ZYNQ_MPSoC开发平台Linux驱动教程V1.04.pdf
基于JavaWeb的毕业季旅游一站式定制服务平台_88z1j4jp_208-wx-(1).zip
Apeaksoft Data Recovery for Mac v1.6.16
cms测试练习项目(linux系统部署),可以用来进行python的测试练手项目
数据集简介:大学录取结果分析 概述 大学录取结果数据集包含了有关大学录取过程的信息,包括关键变量,可用于分析不同学术因素与申请者是否被录取之间的关系。该数据集非常适合进行探索性数据分析、训练预测模型以及研究影响录取决策的因素。 数据集列描述 admit:指示申请者是否被录取(1=被录取,0=未录取)。 paes:申请者在高等教育能力测试(PAES)中获得的分数。 nem:中学教育成绩平均分,评分范围从1.0到7.0。 rank:申请者在其班级中的排名,数值越低表示排名越好。 数据集目的 本数据集旨在让用户探索学术指标(如PAES分数、GPA和排名)与大学录取成功率之间的关系。这可以用于: 开发预测模型:基于学术表现预测录取可能性。 识别趋势:找出影响录取的关键学术因素。 生成可视化图表:理解分数分布及录取结果的关系。 数据集规模 记录数:1813条。 列数:5列。
STM32F427+rtthread下的bootload 网口(webclient)+串口(ymodem)传输,代码无质量,谨慎使用
1. 用户管理功能 用户注册与登录:用户可以通过手机号、邮箱等方式注册账户,并且可以通过账号登录系统进行购票、查看历史订单等操作。 个人信息管理:用户可以查看和修改个人信息(如姓名、手机号、邮箱等),并进行密码重置等操作。 实名认证:部分电影院购票系统要求用户进行实名认证,确保用户身份的真实性。 2. 电影信息展示功能 电影排片查询:用户可以查看当前和未来一段时间内的电影排片表,包括电影名称、上映时间、影片时长、类型、导演、演员等详细信息。 电影详情页:点击具体电影后,用户可以查看电影的详细信息,如剧情介绍、影评、评分、预告片等内容。 电影评分与评论:用户可以查看其他观众的评分和评论,也可以对已观看的电影进行评分和评论。 3. 座位选择与预定功能 影厅座位图:系统展示每场次的影厅座位图,用户可以通过座位图查看当前座位的状态(如可选、已选、已售出、VIP座位等)。 座位选择:用户可以选择自己喜欢的座位,系统会实时更新座位的可用状态,避免重复选择。 座位偏好设置:用户可以设置自己的座位偏好,如选择前排、中排或后排,靠窗或靠过道等。 4. 电影票购买与支付功能 票价展示:系统会展示每个座位的
Bukkit-BETA1.8.1服务端核心
内容概要:本文详细介绍了快速排序算法的原理和在Go语言中的高效实现方法。首先解释了快速排序的基本思想和实现步骤,接着提供了Go语言中实现快速排序的核心代码,并讨论了性能优化策略。最后,通过具体的应用场景实例,展示了快速排序在实际项目中的高效应用。 适合人群:具备一定编程基础,特别是对Go语言感兴趣的开发人员。 使用场景及目标:①理解快速排序算法的基本原理和分治策略;②学习如何在Go语言中高效实现快速排序;③掌握快速排序在实际项目中的应用实例。 阅读建议:本文不仅详细讲解了快速排序的原理,还提供了具体的实现代码和优化策略,建议读者在阅读过程中尝试实现和调试代码,以便更好地理解和掌握相关知识点。
项目包含完整前后端源码和数据库文件,均测试可正常运行 环境说明: 开发语言:Java 框架:ssm,mybatis JDK版本:JDK1.8 数据库:mysql 5.7 数据库工具:Navicat11 开发软件:eclipse/idea Maven包:Maven3.3 部署容器:tomcat7