cfmaker


Namecfmaker JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA lightweight compilation tool for Fortran and C projects, primarily targeting the Intel oneAPI compilers, ifort and ifx.
upload_time2024-07-27 08:56:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords oneapi fortran project c compiler
VCS
bugtrack_url
requirements networkx
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # fmaker

简易的用于intel oneapi fortran与c项目的编译,适用于小项目
若oneapi又发疯改一堆编译选项,可以自定义设置编译和链接等选项

## Getting Started

1. write 'maker.py'

```python
from cfmaker import compile_manager, ProjectConfig

config = ProjectConfig(
  f_srcs=['src/**'],
  c_srcs=['src/**'],
  project_build_dir='./build',
  f_exe_name='example.exe',
  c_lib_name='example.lib',
  static_libraries=['example.lib']
)

config.auto_add_intel_mpi()
config.auto_set_cc_options()
config.auto_set_fc_options()

compile_manager(config).make()
```

2. execute 'maker.py'

```python
python maker.py #默认以debug模式编译
python maker.py debug #以debug模式编译
python maker.py release #以release模式编译
python maker.py debug update #更新源文件列表后进行debug模式编译
python maker.py release update #更新源文件列表后进行release模式编译
python maker.py clear #删除中间文件
python maker.py clear rmexe #删除中间文件和exe
```

## Advanced

```python
from cfmaker import inner_flag_opt
config.fc_options_debug = '-g -O0'  #设置fortran debug编译选项

#修改输出exe的选项
config.f_flag_exe = inner_flag_opt('/Fe', '', ispath=True, isList=False )
#修改输出include的选项
config.f_flag_include = inner_flag_opt('-I', '', ispath=True, isList=True )

```

## Contributing

```
pip install build installer
python -m build
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cfmaker",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "oneapi, fortran, project, c, compiler",
    "author": null,
    "author_email": "littlestar <littlestar002@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9b/b3/19b715f3fd54007a914936a987ccd3ac67df53147c5db23c2c957ad628d7/cfmaker-0.2.0.tar.gz",
    "platform": null,
    "description": "# fmaker\r\n\r\n\u7b80\u6613\u7684\u7528\u4e8eintel oneapi fortran\u4e0ec\u9879\u76ee\u7684\u7f16\u8bd1\uff0c\u9002\u7528\u4e8e\u5c0f\u9879\u76ee\r\n\u82e5oneapi\u53c8\u53d1\u75af\u6539\u4e00\u5806\u7f16\u8bd1\u9009\u9879\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u8bbe\u7f6e\u7f16\u8bd1\u548c\u94fe\u63a5\u7b49\u9009\u9879\r\n\r\n## Getting Started\r\n\r\n1. write 'maker.py'\r\n\r\n```python\r\nfrom cfmaker import compile_manager, ProjectConfig\r\n\r\nconfig = ProjectConfig(\r\n  f_srcs=['src/**'],\r\n  c_srcs=['src/**'],\r\n  project_build_dir='./build',\r\n  f_exe_name='example.exe',\r\n  c_lib_name='example.lib',\r\n  static_libraries=['example.lib']\r\n)\r\n\r\nconfig.auto_add_intel_mpi()\r\nconfig.auto_set_cc_options()\r\nconfig.auto_set_fc_options()\r\n\r\ncompile_manager(config).make()\r\n```\r\n\r\n2. execute 'maker.py'\r\n\r\n```python\r\npython maker.py #\u9ed8\u8ba4\u4ee5debug\u6a21\u5f0f\u7f16\u8bd1\r\npython maker.py debug #\u4ee5debug\u6a21\u5f0f\u7f16\u8bd1\r\npython maker.py release #\u4ee5release\u6a21\u5f0f\u7f16\u8bd1\r\npython maker.py debug update #\u66f4\u65b0\u6e90\u6587\u4ef6\u5217\u8868\u540e\u8fdb\u884cdebug\u6a21\u5f0f\u7f16\u8bd1\r\npython maker.py release update #\u66f4\u65b0\u6e90\u6587\u4ef6\u5217\u8868\u540e\u8fdb\u884crelease\u6a21\u5f0f\u7f16\u8bd1\r\npython maker.py clear #\u5220\u9664\u4e2d\u95f4\u6587\u4ef6\r\npython maker.py clear rmexe #\u5220\u9664\u4e2d\u95f4\u6587\u4ef6\u548cexe\r\n```\r\n\r\n## Advanced\r\n\r\n```python\r\nfrom cfmaker import inner_flag_opt\r\nconfig.fc_options_debug = '-g -O0'  #\u8bbe\u7f6efortran debug\u7f16\u8bd1\u9009\u9879\r\n\r\n#\u4fee\u6539\u8f93\u51faexe\u7684\u9009\u9879\r\nconfig.f_flag_exe = inner_flag_opt('/Fe', '', ispath=True, isList=False )\r\n#\u4fee\u6539\u8f93\u51fainclude\u7684\u9009\u9879\r\nconfig.f_flag_include = inner_flag_opt('-I', '', ispath=True, isList=True )\r\n\r\n```\r\n\r\n## Contributing\r\n\r\n```\r\npip install build installer\r\npython -m build\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightweight compilation tool for Fortran and C projects, primarily targeting the Intel oneAPI compilers, ifort and ifx.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/Littlestar007/fmaker",
        "Issues": "https://github.com/Littlestar007/fmaker/issues"
    },
    "split_keywords": [
        "oneapi",
        " fortran",
        " project",
        " c",
        " compiler"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b27207747e64a7af3f0e41ea1508e9464a23a67175c19ca12a1a99b0506ca30a",
                "md5": "895fbb59a9acda537933dc32f3edb4e4",
                "sha256": "04f4f74a48a2c2da99c55131825d89807bca7c7d526a84c432d1c09c4d02afbb"
            },
            "downloads": -1,
            "filename": "cfmaker-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "895fbb59a9acda537933dc32f3edb4e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 13111,
            "upload_time": "2024-07-27T08:56:09",
            "upload_time_iso_8601": "2024-07-27T08:56:09.892030Z",
            "url": "https://files.pythonhosted.org/packages/b2/72/07747e64a7af3f0e41ea1508e9464a23a67175c19ca12a1a99b0506ca30a/cfmaker-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9bb319b715f3fd54007a914936a987ccd3ac67df53147c5db23c2c957ad628d7",
                "md5": "14de29f3956f502ca92fa2fa22276021",
                "sha256": "75e30b04ea069808dee8d213db713821b72d4135cb0fef6df00c772aa6459306"
            },
            "downloads": -1,
            "filename": "cfmaker-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "14de29f3956f502ca92fa2fa22276021",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12145,
            "upload_time": "2024-07-27T08:56:11",
            "upload_time_iso_8601": "2024-07-27T08:56:11.836277Z",
            "url": "https://files.pythonhosted.org/packages/9b/b3/19b715f3fd54007a914936a987ccd3ac67df53147c5db23c2c957ad628d7/cfmaker-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-27 08:56:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Littlestar007",
    "github_project": "fmaker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "networkx",
            "specs": []
        }
    ],
    "lcname": "cfmaker"
}
        
Elapsed time: 1.67885s