{"id":17382909,"url":"https://github.com/zhyang-dev/wmake_with_bear","last_synced_at":"2026-03-15T12:13:12.165Z","repository":{"id":256331149,"uuid":"854988942","full_name":"zhyang-dev/wmake_with_bear","owner":"zhyang-dev","description":"wmake with bear to generate compile_commands.json for language server like clangd or ccls","archived":false,"fork":false,"pushed_at":"2024-09-11T14:28:34.000Z","size":361,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T05:26:28.651Z","etag":null,"topics":["openfoam","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhyang-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-10T05:35:04.000Z","updated_at":"2024-09-12T03:45:00.000Z","dependencies_parsed_at":"2024-09-10T07:04:07.396Z","dependency_job_id":null,"html_url":"https://github.com/zhyang-dev/wmake_with_bear","commit_stats":null,"previous_names":["zhyang-dev/wmake_with_bear"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhyang-dev/wmake_with_bear","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyang-dev%2Fwmake_with_bear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyang-dev%2Fwmake_with_bear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyang-dev%2Fwmake_with_bear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyang-dev%2Fwmake_with_bear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhyang-dev","download_url":"https://codeload.github.com/zhyang-dev/wmake_with_bear/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhyang-dev%2Fwmake_with_bear/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28002328,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["openfoam","shell"],"created_at":"2024-10-16T07:39:49.146Z","updated_at":"2025-12-24T12:19:51.722Z","avatar_url":"https://github.com/zhyang-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# wmake_with_bear\n[中文](./README.zh_CN.md) | [English](./README.md)\n\n## Project Description\n\nThe `compile_commands.json` file is often used to help various language servers (such as clangd, ccls, etc.) understand how to compile a project, enabling features like code navigation, completion, and analysis.\n\nThis project aims to help OpenFOAM generate `compile_commands.json`. The `bear` tool is specifically used to generate this file, as it wraps the build command `make` to capture various compilation options. Since OpenFOAM's native build tool `wmake` is a wrapper around `make`, it makes sense to combine `wmake` with `bear` to generate `compile_commands.json`.\n\nIn fact, the com version of OpenFOAM has already considered this and provides a `-with-bear` option to invoke `bear`. However, this project seeks to be more general, supporting both the com and org versions, as well as the foam-extend version. The good news is that these three main branches share some common logic in the underlying `wmake` toolchain.\n\n## Installation and Usage\n### Dependencies\n\nThis project clearly depends on Bear. You can usually install it using the system's package manager or through tools like Conda for precompiled versions. Of course, you can also compile it from source. For more details, refer to [rizsotto/Bear](https://github.com/rizsotto/Bear).\n\n### Installation\n\nThe installation is straightforward:\n\n```bash\n# Activate your OpenFOAM environment, then clone the project and run the install script\n$ git clone --depth 1 https://github.com/zhyang-dev/wmake_with_bear.git\n$ cd wmake_with_bear \u0026\u0026 ./install\n```\n\n### Usage\n\nThe installation command above will create a `wmake_with_bear` and alias `bwmake` in the `$WM_PROJECT_DIR/wmake` directory. To generate `compile_commands.json` in a project, use `bwmake` instead of `wmake`.\n\n### Testing\n\nThe following tests use icoFoam as an example.\n\nThe usage of `bwmake` is basically the same as `wmake`, but `bwmake` can generate `compile_commands.json`. In OpenFOAM-v2012, using `bwmake` to compile icoFoam produces the result shown below.\n\n![](./assets/test_bwmake_with_of2012.png)\n\nUsing `clangd` as the language server in VSCode, you can see that code suggestions work correctly.\n\n![](./assets/vscode_clangd_icoFoam_bwmake.png)\n\nTested environments:\n- OpenFOAM-v2406 on Ubuntu-24.04 with bear 3.1.3\n- OpenFOAM-v2012 on Ubuntu-20.04 with bear 2.4.3\n- OpenFOAM-v2012 on Ubuntu-16.04 with bear 2.1.5\n- OpenFOAM-11 on Ubuntu-20.04 with bear 2.4.3\n- OpenFOAM-6 on Ubuntu-18.04 with bear 2.3.11\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhyang-dev%2Fwmake_with_bear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhyang-dev%2Fwmake_with_bear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhyang-dev%2Fwmake_with_bear/lists"}