{"id":27940584,"url":"https://github.com/khronosgroup/spir","last_synced_at":"2025-05-07T10:18:40.919Z","repository":{"id":12402575,"uuid":"15055832","full_name":"KhronosGroup/SPIR","owner":"KhronosGroup","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-24T15:09:37.000Z","size":108375,"stargazers_count":179,"open_issues_count":17,"forks_count":49,"subscribers_count":70,"default_branch":"spir_12","last_synced_at":"2025-05-07T10:18:19.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhronosGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-09T18:46:48.000Z","updated_at":"2025-05-01T17:03:20.000Z","dependencies_parsed_at":"2022-09-23T06:30:32.878Z","dependency_job_id":null,"html_url":"https://github.com/KhronosGroup/SPIR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FSPIR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FSPIR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FSPIR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FSPIR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/SPIR/tar.gz/refs/heads/spir_12","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856570,"owners_count":21814858,"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":[],"created_at":"2025-05-07T10:18:39.550Z","updated_at":"2025-05-07T10:18:40.908Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"SPIR generator/Clang Installation Instructions\n==============================================\n\nThese instructions describe how to build, install and operate SPIR generator Clang.\n\n-----------------------\nStep 1: Organization\n-----------------------\n\nSPIR generator/Clang is designed to be built as part of an LLVM build.\n\nSPIR generator/Clang is based on LLVM/Clang version 3.2.\n\nThe LLVM source code could be downloaded from \u003chttp://www.llvm.org/releases/3.2/llvm-3.2.src.tar.gz\u003e.\n\nIt is also available directly from the LLVM svn server:\n\n```bash\n  svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_32/final llvm\n```\n\nOr could be cloned from LLVM git repository:\n\n```bash\n  git clone http://llvm.org/git/llvm.git llvm\n  cd llvm\n  git checkout --track -b release_32 remotes/origin/release_32\n```\n\nAssuming that the LLVM source code is located at **$LLVM_SRC_ROOT**, then the clang\nsource code should be installed as: **$LLVM_SRC_ROOT/tools/clang**.\n\nThe directory is not required to be called clang, but doing so will allow the\nLLVM build system to automatically recognize it and build it along with LLVM.\n\n```bash\n  cd $LLVM_SRC_ROOT/tools\n  git clone https://github.com/KhronosGroup/SPIR clang\n  cd clang\n  git checkout --track -b spir_12 remotes/origin/spir_12\n```\n\n--------------------------------\nStep 2: Configure and Build LLVM\n--------------------------------\n\nConfigure and build your copy of LLVM (see **$LLVM_SRC_ROOT/GettingStarted.html** for more information).\n\nAssuming you installed clang at **$LLVM_SRC_ROOT/tools/clang** then Clang will\nautomatically be built with LLVM. Otherwise, run `make` in the Clang source\ndirectory to build Clang.\n\n* **Note**: currently there might be failures in check_clang project.\n\n------------------------------------\nStep 3: (Optional) Verify Your Build\n------------------------------------\n\nIt is a good idea to run the Clang tests to make sure your build works\ncorrectly. From inside the Clang build directory, run `make test` to run the\ntests.\n\n---------------------\nStep 4: Install Clang\n---------------------\n\nIf you wish to run Clang from the generated binary directory, you may skip this\nsection.\n\nFrom inside the Clang build directory, run `make install` to install the Clang\ncompiler and header files into the prefix directory selected when LLVM was\nconfigured.\n\nThe Clang compiler is available as `clang` and `clang++`. It supports a gcc\nlike command line interface. See the man page for clang (installed into\n$prefix/share/man/man1) for more information.\n\n------------------------------\nStep 5: Creating SPIR binaries\n------------------------------\n\nTo create a SPIR binary from a valid OpenCL-C file (.cl), use the following\ncommand lines:\n\n```bash\n  clang -cc1 -emit-llvm-bc -triple \u003ctriple\u003e \u003cOpenCL compile options\u003e -cl-spir-compile-options \"\u003cOpenCL compile options\u003e\" -include \u003copencl_spir.h\u003e -o \u003coutput\u003e \u003cinput\u003e\n```\n\n* `\u003ctriple\u003e`: for 32 bit SPIR use spir-unknown-unknown, for 64 bit SPIR use spir64-unknown-unknown.\n* **Note**: `\u003cOpenCL compile options\u003e` appears twice. The command line option `-cl-spir-compile-options \"\u003cOpenCL compile options\u003e\"` specifies the compile options that occur in the SPIR metadata.\n* \u003copencl_spir.h\u003e: download opencl_spir.h from https://github.com/KhronosGroup/SPIR-Tools/blob/master/headers/opencl_spir.h\n* -O: -O0 (default) is the only tested option value at the moment. It's assumed by design that all optimizations are executed by SPIR consumer.\n\n----------------\nReporting issues\n----------------\n\nBugs/feature requests can be filed via [github](https://github.com/KhronosGroup/SPIR/issues) or [Khronos Bugzilla](https://www.khronos.org/bugzilla/) bug tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fspir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fspir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fspir/lists"}