{"id":20721362,"url":"https://github.com/calvinneo/cfortrantranslator","last_synced_at":"2025-04-05T10:08:12.982Z","repository":{"id":89526389,"uuid":"43305759","full_name":"CalvinNeo/CFortranTranslator","owner":"CalvinNeo","description":"A translator from Fortran to C++. We provide statement-wise translation to improve readability.","archived":false,"fork":false,"pushed_at":"2024-12-09T15:57:17.000Z","size":4580,"stargazers_count":125,"open_issues_count":5,"forks_count":27,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-29T09:10:38.586Z","etag":null,"topics":["compiler","converter","cpp","fortran","fortran-to-cpp","parser","transpiler"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CalvinNeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-28T14:26:17.000Z","updated_at":"2025-03-17T13:31:00.000Z","dependencies_parsed_at":"2025-02-27T12:23:47.986Z","dependency_job_id":"af4b617d-2ad3-40f9-819a-24efcbfcdd72","html_url":"https://github.com/CalvinNeo/CFortranTranslator","commit_stats":{"total_commits":166,"total_committers":3,"mean_commits":"55.333333333333336","dds":"0.012048192771084376","last_synced_commit":"148504915205f4aeac07912da0c0dd6acdaaa6f0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FCFortranTranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FCFortranTranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FCFortranTranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalvinNeo%2FCFortranTranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CalvinNeo","download_url":"https://codeload.github.com/CalvinNeo/CFortranTranslator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","converter","cpp","fortran","fortran-to-cpp","parser","transpiler"],"created_at":"2024-11-17T03:27:12.483Z","updated_at":"2025-04-05T10:08:12.961Z","avatar_url":"https://github.com/CalvinNeo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# CFortranTranslator\n\nA translator from Fortran90/Fortran77(ISO/IEC 1539:1991) to C++\n\nFortran is an efficient tool in scientific calculation. However sometimes translating old fortran codes to C++ will enable more programming abstraction, better GUI framework support, higher performance IDE and easier interaction.\n\nThis translator is not intended to improve existing codes, but to make convenience for those who need features of C++ and remain fortran traits and performance as much as possible.\n\n[![Build Status](https://travis-ci.org/CalvinNeo/CFortranTranslator.svg?branch=master)](https://travis-ci.org/CalvinNeo/CFortranTranslator)  [![Coverage Status](https://coveralls.io/repos/github/CalvinNeo/CFortranTranslator/badge.svg?branch=master)](https://coveralls.io/github/CalvinNeo/CFortranTranslator?branch=master)\n\n## Features\n\n1. Convert Fortran90/Fortran77 code to C++14\n2. Parse codes mixed with fixed form and free form automaticlly\n3. C++ implemetation of some Fortran's type and functions\n4. Generated C++ code remains abstract level of the origin code\n\n    e.g. implied-do will not expand to a for-loop directly, but to a `ImpliedDo` struct\n\n\n## License\nThe whole project, including both the translator itself and fortran standrad library implementation is distributed under GNU GENERAL PUBLIC LICENSE Version 2\n\n                        GNU GENERAL PUBLIC LICENSE\n                           Version 2, June 1991\n\n    Calvin Neo\n    Copyright (C) 2016  Calvin Neo\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n# Install\n## Build project in Windows\n### Dependencies\n1. MSVC(e.g. Visual Studio 2015)\n2. win\\_flex(win\\_flex\\_bison 2.4.5, flex 2.5.37)\n3. win\\_bison(win\\_flex\\_bison 2.4.5, bison 2.7)\n4. boost(1.60)\n\n### Configure boost\n- build boost\n```\nbjam --toolset=msvc-14.0 address-model=64\n```\n\n- configure boost\n    1. Add **boost\\_dir** directory to additional include library\n    2. Add **boost\\_dir/libs** and **boost\\_dir/stage/lib** to additional library directory\n\n### Configure winflex and winbison\n1. On the Project menu, choose Project Dependencies.\n2. Select Custom Build Tools\n3. Add [/src/grammar/custom\\_build\\_rules/win\\_flex\\_bison\\_custom\\_build.props](/src/grammar/custom\\_build\\_rules/win\\_flex\\_bison\\_custom\\_build.props)\n\n### Build by MSBuild\nRun [/build/vcbuild.cmd](/build/vcbuild.cmd)\n\nYou can get Visual C++ Build Tools [here(Not available now)](http://landinghub.visualstudio.com/visual-cpp-build-tools) or [here](https://visualstudio.microsoft.com/zh-hans/downloads/)\n\nAll built production will be in [/bin](/bin)\n\n### Build by NMake\nRun [/build/winmake.cmd](/build/winmake.cmd) to get a x64 Release binary\n\n### Build By Visual Studio\nOpen [/vsbuild/CFortranTranslator.sln](/vsbuild/CFortranTranslator.sln)\n\n## Build project in Ubuntu\n### Dependencies\n1. g++(e.g. g++ 5.4.0)\n2. bison\n3. boost\n\n### Configure boost\nInstall boost by\n\n\tsudo apt-get install libboost-all-dev\n### Configure bison\nInstall bison by\n\n\tsudo apt-get install bison\n### Make\n\n\tcd build \u0026\u0026 make\n\tmake install\n\n## Fortran standard library(for90std)\n**for90std** is a simple implementation of fortran's library and is yet to be done\n\nfor90std requires compiler support at least C++14 standard(with several C++17 std functions)\n\nWith the following statement to include for90std module\n\n    #include \"for90std/for90std.h\"\n\n### cpptest\n[cpptest](/cpptest) is a C++ project template for you to test for90std.\n\n## Run CFortranTranslator with arguments\n\n    -f file_name : translate file_name into C++\n        **Currently, Unicode encoding is not supported**\n    -d : use debug mode\n    -C : use c-style array\n    -F 90/77 : specify Fortran standard, by default the translator accept a mixed Fortran77/90 codes\n\n# Demo\n## The \"hello world\" demo\n1. Use the following command to generate target C++ code\n    ```\n    CFortranTranslator.exe -Ff demos/helloworld.f90 \u003e target.cpp\n    ```\n2. Build *target.cpp*, modify `#include \"../for90std/for90std.h\"` to ensure you include the right path of for90std library.\n\tYou can either use [/cpptest/winmake.cmd](/cpptest/winmake.cmd) to build your code, or build them in cpptest project.\n\n## More demos\n### Translator Demos\nSeveral demos are provided in [/demos](/demos).\nRun [/demos/merge_test.py](/demos/merge_test.py) to generate a `*.form.test` file by merging codes from all `.for`/`.f90` files in a certain folder. Then you can convert the merged Fortran code into C++.\n\n### for90std Demos\nSeveral demos are provided in [/demos/for90std](/demos/for90std).\nMake sure you have google-test library before test.\n\n# Debug\nOnly fatal errors hindering parsing will be reported by translator. \n\nDebuging origin fortran code or generated C++ code is recommended.\n\n# Docs\nsee [/docs/brief.md](/docs/brief.md)\n\n## Develop details guide\nsee [/docs/Develop.md](/docs/Develop.md) to have an general understanding of implementation of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinneo%2Fcfortrantranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinneo%2Fcfortrantranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinneo%2Fcfortrantranslator/lists"}