Skip to content

Commit

Permalink
fix(cuda) library name on Linux
Browse files Browse the repository at this point in the history
Close #884
  • Loading branch information
Spasi committed May 14, 2023
1 parent a032a05 commit 5fa10aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/notes/3.3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This build includes the following changes:

#### Fixes

- CUDA: Fixed library name on Linux. (#884)
- OpenGL: Added support for [libglvnd](https://github.com/NVIDIA/libglvnd). (#880)
* LWJGL will now try to load `libGLX.so.0` before `libGL.so.1` on Linux, matching GLFW.
* Use `Configuration.OPENGL_LIBRARY_NAME` and `GLFWNativeGLX::setPath` to override this behavior.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public class CU {

private static final SharedLibrary NVCUDA = Library.loadNative(CU.class, "org.lwjgl.cuda", Configuration.CUDA_LIBRARY_NAME, "nvcuda");
private static final SharedLibrary NVCUDA = Library.loadNative(CU.class, "org.lwjgl.cuda", Configuration.CUDA_LIBRARY_NAME, Platform.get() == Platform.WINDOWS ? "nvcuda" : "cuda");

/** Contains the function pointers loaded from the NVCUDA {@link SharedLibrary}. */
public static final class Functions {
Expand Down
2 changes: 1 addition & 1 deletion modules/lwjgl/cuda/src/templates/kotlin/cuda/CUDATypes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package cuda

import org.lwjgl.generator.*

val NVCUDA_BINDING = simpleBinding(Module.CUDA, libraryName = "NVCUDA", libraryExpression = "Configuration.CUDA_LIBRARY_NAME, \"nvcuda\"")
val NVCUDA_BINDING = simpleBinding(Module.CUDA, libraryName = "NVCUDA", libraryExpression = "Configuration.CUDA_LIBRARY_NAME, Platform.get() == Platform.WINDOWS ? \"nvcuda\" : \"cuda\"")
val NVCUDA_BINDING_DELEGATE = NVCUDA_BINDING.delegate("CU.getLibrary()")

internal fun Func.versioned(version: Int = 2): Func = NativeName("__CUDA_API_VERSION(\"${this.name}\", $version)")..this
Expand Down

0 comments on commit 5fa10aa

Please sign in to comment.