Skip to content

Commit

Permalink
Link with OpenCL by default and expose GNU extensions. (#80)
Browse files Browse the repository at this point in the history
* Link with OpenCL by default and expose GNU extensions.

* Link to specific version and add the OpenCL SDK to the searched paths.

* Specialize library linkage names.
  • Loading branch information
Nihlus authored Aug 15, 2024
1 parent 217b481 commit c7f42e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env.Append(
"WEBRTC_APM_DEBUG_DUMP=0",
"WHISPER_BUILD",
"GGML_BUILD",
"_GNU_SOURCE"
]
)

Expand Down Expand Up @@ -67,13 +68,20 @@ else:
"USE_ICD_LOADER",
]
)

env.Append(LIBPATH=["OpenCL-SDK/install/lib"])

opencl_include_dir = os.environ.get('OpenCL_INCLUDE_DIR')
if opencl_include_dir:
env.Append(CPPDEFINES=[opencl_include_dir])

opencl_library = os.environ.get('OpenCL_LIBRARY')
if opencl_library:
env.Append(LIBS=[opencl_library])
elif env["platform"] == "windows":
env.Append(LIBS=[":OpenCL.dll"])
elif env["platform"] == "linux":
env.Append(LIBS=[":libOpenCL.so.1"])

clblast_sources = [
"thirdparty/clblast/src/database/database.cpp",
Expand Down

0 comments on commit c7f42e6

Please sign in to comment.