Building OSX Binaries

@Marco13

I’m working on getting OS X binaries built for cuda 7.5. I’ve got everything working on my machine, cuda samples compile and run, etc.

I’m able to build all the dylibs with no problem, but when I go to build the JAR (as instructed in the jcuda-main repo) I get the test errors posted below.

It looks like a seg fault in the native code. Anything obvious that I’m doing wrong?


[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jcuda
[INFO] jcublas
[INFO] jcufft
[INFO] jcurand
[INFO] jcusparse
[INFO] jcusolver
[INFO] jcuda-main
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jcuda 0.7.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jcuda ---
[INFO] Deleting /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jcuda ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/cc/repos/jcuda-main/JCuda/JCudaJava/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jcuda ---
[INFO] Compiling 122 source files to /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jcuda ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/cc/repos/jcuda-main/JCuda/JCudaJava/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jcuda ---
[INFO] Compiling 2 source files to /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ jcuda ---
[INFO] Surefire report directory: /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running jcuda.test.JCudaBasicBindingTest
#
# A fatal error has been detected by the Java Runtime Environment:
#
SUREFIRE-859: #  SIGSEGV (0xb) at pc=0x00007fff913aaa07, pid=3864, tid=4867
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libGL.dylib+0x1a07]  glGetError+0xd
#
SUREFIRE-859: # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/cc/repos/jcuda-main/jcuda/JCudaJava/hs_err_pid3864.log
#
SUREFIRE-859: # If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
/bin/sh: line 1:  3864 Abort trap: 6           /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries -jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] jcuda .............................................. FAILURE [  2.842 s]
[INFO] jcublas ............................................ SKIPPED
[INFO] jcufft ............................................. SKIPPED
[INFO] jcurand ............................................ SKIPPED
[INFO] jcusparse .......................................... SKIPPED
[INFO] jcusolver .......................................... SKIPPED
[INFO] jcuda-main ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.957 s
[INFO] Finished at: 2015-09-24T12:55:53-04:00
[INFO] Final Memory: 23M/314M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcuda: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /Users/cc/repos/jcuda-main/JCuda/JCudaJava && /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries -jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcuda: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/cc/repos/jcuda-main/JCuda/JCudaJava && /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries -jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/cc/repos/jcuda-main/JCuda/JCudaJava && /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries -jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 20 more
Caused by: java.lang.RuntimeException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/cc/repos/jcuda-main/JCuda/JCudaJava && /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries -jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:515)
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:380)
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:167)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:990)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:824)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Hm. That’s odd. The error happened in the “libGL.dylib”. This means that, most likely, one of the GL-related functions of the native library does not work as expected.

In fact, this might not even be an issue: The “Basic Binding Tests” simply call ALL the native methods of the class, with nulls and default values as their parameters - just to verify that all native methods are implemented and no UnsatisfiedLinkError occurs. But of course, it should not crash like this, even with these completely invalid method arguments.

Can you have a look at the file that is mentioned there,
/Users/cc/repos/jcuda-main/jcuda/JCudaJava/hs_err_pid3864.log
to see which method exactly causes this error?

Sure!

pasted below is what I THINK is the relevant bit (minus register dump etc). The whole thing is too long to post so I’ve put up a gist with the full contents: https://gist.github.com/anonymous/be05732b8c8c7c598b73


** ~/r/j/j/JCudaJava (master ☡=) cat hs_err_pid3864.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff913aaa07, pid=3864, tid=4867
#
# JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libGL.dylib+0x1a07]  glGetError+0xd
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007f9d82813000):  JavaThread "main" [_thread_in_native, id=4867, stack(0x000000010b8c1000,0x000000010b9c1000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000

Stack: [0x000000010b8c1000,0x000000010b9c1000],  sp=0x000000010b9be980,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libGL.dylib+0x1a07]  glGetError+0xd
C  [libcuda_310.41.35_mercury.dylib+0x181658]  cuiGLRegisterResource+0x818
C  [libcuda_310.41.35_mercury.dylib+0x186b5a]  graphicsResourceRegister+0x4a
C  [libcuda_310.41.35_mercury.dylib+0x17fd39]  cuapiGLRegisterBufferObject+0xc9
C  [libcuda_310.41.35_mercury.dylib+0x1f967]  cuGLRegisterBufferObject+0x57
C  [libJCudaRuntime-apple-x86_64.dylib+0x1826b]  cudart::cudaApiGLRegisterBufferObject(unsigned int)+0x6b
C  [libJCudaRuntime-apple-x86_64.dylib+0x3d11f]  cudaGLRegisterBufferObject+0x13f
C  [libJCudaRuntime-apple-x86_64.dylib+0xe753]  Java_jcuda_runtime_JCuda_cudaGLRegisterBufferObjectNative+0x33
j  jcuda.runtime.JCuda.cudaGLRegisterBufferObjectNative(I)I+0
j  jcuda.runtime.JCuda.cudaGLRegisterBufferObject(I)I+1
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2e01e2]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6ae
V  [libjvm.dylib+0x4b4066]  Reflection::invoke(instanceKlassHandle, methodHandle, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0xdf8
V  [libjvm.dylib+0x4b4580]  Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0x16c
V  [libjvm.dylib+0x3303b8]  JVM_InvokeMethod+0x166
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  jcuda.test.BasicBindingTest.testMethod(Ljava/lang/reflect/Method;)Z+62
j  jcuda.test.BasicBindingTest.testBinding(Ljava/lang/Class;)Z+66
j  jcuda.test.JCudaBasicBindingTest.testJCuda()V+2
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2e01e2]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6ae
V  [libjvm.dylib+0x4b4066]  Reflection::invoke(instanceKlassHandle, methodHandle, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0xdf8
V  [libjvm.dylib+0x4b4580]  Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0x16c
V  [libjvm.dylib+0x3303b8]  JVM_InvokeMethod+0x166
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  org.junit.runners.model.FrameworkMethod$1.runReflectiveCall()Ljava/lang/Object;+15
j  org.junit.internal.runners.model.ReflectiveCallable.run()Ljava/lang/Object;+1
j  org.junit.runners.model.FrameworkMethod.invokeExplosively(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+10
j  org.junit.internal.runners.statements.InvokeMethod.evaluate()V+12
j  org.junit.runners.ParentRunner.runLeaf(Lorg/junit/runners/model/Statement;Lorg/junit/runner/Description;Lorg/junit/runner/notification/RunNotifier;)V+17
j  org.junit.runners.BlockJUnit4ClassRunner.runChild(Lorg/junit/runners/model/FrameworkMethod;Lorg/junit/runner/notification/RunNotifier;)V+32
j  org.junit.runners.BlockJUnit4ClassRunner.runChild(Ljava/lang/Object;Lorg/junit/runner/notification/RunNotifier;)V+6
j  org.junit.runners.ParentRunner$3.run()V+12
j  org.junit.runners.ParentRunner$1.schedule(Ljava/lang/Runnable;)V+1
j  org.junit.runners.ParentRunner.runChildren(Lorg/junit/runner/notification/RunNotifier;)V+40
j  org.junit.runners.ParentRunner.access$000(Lorg/junit/runners/ParentRunner;Lorg/junit/runner/notification/RunNotifier;)V+2
j  org.junit.runners.ParentRunner$2.evaluate()V+8
j  org.junit.runners.ParentRunner.run(Lorg/junit/runner/notification/RunNotifier;)V+20
j  org.apache.maven.surefire.junit4.JUnit4Provider.execute(Ljava/lang/Class;Lorg/junit/runner/notification/RunNotifier;[Ljava/lang/String;)V+106
j  org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(Ljava/lang/Class;Lorg/junit/runner/notification/RunNotifier;[Ljava/lang/String;)V+18
j  org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(Ljava/lang/Class;Lorg/apache/maven/surefire/report/RunListener;Lorg/junit/runner/notification/RunNotifier;)V+72
j  org.apache.maven.surefire.junit4.JUnit4Provider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+161
j  org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Ljava/lang/Object;Ljava/lang/Object;Lorg/apache/maven/surefire/booter/ProviderConfiguration;ZLorg/apache/maven/surefire/booter/StartupConfiguration;Z)Lorg/apache/maven/surefire/suite/RunResult;+23
j  org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Ljava/lang/Object;Lorg/apache/maven/surefire/booter/StartupConfiguration;Lorg/apache/maven/surefire/booter/ProviderConfiguration;Ljava/io/PrintStream;)Lorg/apache/maven/surefire/suite/RunResult;+14
j  org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+183
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2e01e2]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6ae
V  [libjvm.dylib+0x3168ee]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x1bf
V  [libjvm.dylib+0x30f668]  jni_CallStaticVoidMethod+0x15d
C  [java+0x393e]  JavaMain+0x9b1
C  [libsystem_pthread.dylib+0x405a]  _pthread_body+0x83
C  [libsystem_pthread.dylib+0x3fd7]  _pthread_body+0x0
C  [libsystem_pthread.dylib+0x13ed]  thread_start+0xd
C  0x0000000000000000

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jcuda.runtime.JCuda.cudaGLRegisterBufferObjectNative(I)I+0
j  jcuda.runtime.JCuda.cudaGLRegisterBufferObject(I)I+1
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  jcuda.test.BasicBindingTest.testMethod(Ljava/lang/reflect/Method;)Z+62
j  jcuda.test.BasicBindingTest.testBinding(Ljava/lang/Class;)Z+66
j  jcuda.test.JCudaBasicBindingTest.testJCuda()V+2
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  org.junit.runners.model.FrameworkMethod$1.runReflectiveCall()Ljava/lang/Object;+15
j  org.junit.internal.runners.model.ReflectiveCallable.run()Ljava/lang/Object;+1
j  org.junit.runners.model.FrameworkMethod.invokeExplosively(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+10
j  org.junit.internal.runners.statements.InvokeMethod.evaluate()V+12
j  org.junit.runners.ParentRunner.runLeaf(Lorg/junit/runners/model/Statement;Lorg/junit/runner/Description;Lorg/junit/runner/notification/RunNotifier;)V+17
j  org.junit.runners.BlockJUnit4ClassRunner.runChild(Lorg/junit/runners/model/FrameworkMethod;Lorg/junit/runner/notification/RunNotifier;)V+32
j  org.junit.runners.BlockJUnit4ClassRunner.runChild(Ljava/lang/Object;Lorg/junit/runner/notification/RunNotifier;)V+6
j  org.junit.runners.ParentRunner$3.run()V+12
j  org.junit.runners.ParentRunner$1.schedule(Ljava/lang/Runnable;)V+1
j  org.junit.runners.ParentRunner.runChildren(Lorg/junit/runner/notification/RunNotifier;)V+40
j  org.junit.runners.ParentRunner.access$000(Lorg/junit/runners/ParentRunner;Lorg/junit/runner/notification/RunNotifier;)V+2
j  org.junit.runners.ParentRunner$2.evaluate()V+8
j  org.junit.runners.ParentRunner.run(Lorg/junit/runner/notification/RunNotifier;)V+20
j  org.apache.maven.surefire.junit4.JUnit4Provider.execute(Ljava/lang/Class;Lorg/junit/runner/notification/RunNotifier;[Ljava/lang/String;)V+106
j  org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(Ljava/lang/Class;Lorg/junit/runner/notification/RunNotifier;[Ljava/lang/String;)V+18
j  org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(Ljava/lang/Class;Lorg/apache/maven/surefire/report/RunListener;Lorg/junit/runner/notification/RunNotifier;)V+72
j  org.apache.maven.surefire.junit4.JUnit4Provider.invoke(Ljava/lang/Object;)Lorg/apache/maven/surefire/suite/RunResult;+161
j  org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(Ljava/lang/Object;Ljava/lang/Object;Lorg/apache/maven/surefire/booter/ProviderConfiguration;ZLorg/apache/maven/surefire/booter/StartupConfiguration;Z)Lorg/apache/maven/surefire/suite/RunResult;+23
j  org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Ljava/lang/Object;Lorg/apache/maven/surefire/booter/StartupConfiguration;Lorg/apache/maven/surefire/booter/ProviderConfiguration;Ljava/io/PrintStream;)Lorg/apache/maven/surefire/suite/RunResult;+14
j  org.apache.maven.surefire.booter.ForkedBooter.main([Ljava/lang/String;)V+183
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00007f9d85802000 JavaThread "Service Thread" daemon [_thread_blocked, id=20739, stack(0x000000012b368000,0x000000012b468000)]
  0x00007f9d82849000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=20227, stack(0x000000012b265000,0x000000012b365000)]
  0x00007f9d8301a000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=19715, stack(0x000000012b162000,0x000000012b262000)]
  0x00007f9d82848000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=19203, stack(0x000000012b05f000,0x000000012b15f000)]
  0x00007f9d83814000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=18691, stack(0x000000012af5c000,0x000000012b05c000)]
  0x00007f9d8380a000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15383, stack(0x000000012ae59000,0x000000012af59000)]
  0x00007f9d83014000 JavaThread "Finalizer" daemon [_thread_blocked, id=13571, stack(0x000000012944b000,0x000000012954b000)]
  0x00007f9d83013000 JavaThread "Reference Handler" daemon [_thread_blocked, id=13059, stack(0x0000000129348000,0x0000000129448000)]
=>0x00007f9d82813000 JavaThread "main" [_thread_in_native, id=4867, stack(0x000000010b8c1000,0x000000010b9c1000)]

Other Threads:
  0x00007f9d83010800 VMThread [stack: 0x0000000129245000,0x0000000129345000] [id=12547]
  0x00007f9d8580b000 WatcherThread [stack: 0x000000012b46b000,0x000000012b56b000] [id=21251]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None


VM Arguments:
jvm_args: -Djava.library.path=/Users/cc/repos/jcuda-main/jcuda-main/nativeLibraries
java_command: /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire2963486191410258210tmp /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefire_0794127898161794396tmp
java_class_path (initial): /Users/cc/repos/jcuda-main/JCuda/JCudaJava/target/surefire/surefirebooter3876996737178920903.jar
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home
PATH=/Users/cc/config/bin:/Users/cc/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
SHELL=/bin/bash
DISPLAY=/private/tmp/com.apple.launchd.GUwQR4bjs5/org.macosforge.xquartz:0
DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-6.5/lib:

Signal Handlers:
SIGSEGV: [libjvm.dylib+0x58ef35], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.dylib+0x58ef35], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.dylib+0x46c028], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.dylib+0x46c028], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.dylib+0x46c028], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.dylib+0x46c028], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.dylib+0x46bb46], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: [libjvm.dylib+0x46a119], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGINT: [libjvm.dylib+0x46a119], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGTERM: [libjvm.dylib+0x46a119], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.dylib+0x46a119], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO


---------------  S Y S T E M  ---------------

OS:Bsduname:Darwin 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
rlimit: STACK 8192k, CORE 0k, NPROC 709, NOFILE 10240, AS infinity
load average:1.98 1.93 1.85

CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 70 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2

Memory: 4k page, physical 16777216k(3398268k free)

/proc/meminfo:


vm_info: Java HotSpot(TM) 64-Bit Server VM (25.51-b03) for bsd-amd64 JRE (1.8.0_51-b16), built on Jun  8 2015 18:01:11 by "java_re" with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

time: Thu Sep 24 12:55:52 2015
elapsed time: 0 seconds (0d 0h 0m 0s)

OK, thanks. The problem is caused by
jcuda.runtime.JCuda.cudaGLRegisterBufferObject(I)I+1

So there are two caveats:

  • This function expects the ID (a plain int value) for an OpenGL buffer object, and wants to register it for usage with CUDA. Of course, during the test, the value/ID that is passed in there is “0”, which at this point in time is not a valid buffer object.
  • The function is also marked as “deprecated” (in fact, since CUDA 3.0). Usually I try to keep track of deprecated functions and at least mark them with @deprecated accordingly, but I didn’t do it for this one (I’ll fix this ASAP).

One of these things (either the deprecatedness, or the “invalid” buffer ID) seems to cause the underlying implementation to crash painfully (although, I think, it shouldn’t).

Regardless of that, I somehow have to take this into account during the test. I think there are two possible solutions:

  • One would probably be to (actually mark all deprecated functions with @deprecated and) skip all @deprecated functions during the test: They are plainly not guaranteed to work any more. And they may even crash - obviously.
  • The other one may seem more rigurous, but maybe even more appropriate here: Marking the function as deprecated, and throwing an UnsupportedOperationException when trying to call it. (Such a nasty SegFault crash should be prevented whenever possible).

To avoid further surprises, you could add something like this in /java/jcuda/test/BasicBindingTest.java

private static boolean testMethod(Method method) 
{
    // XXX
    if (method.toString().contains("cudaGLRegisterBufferObject")) return true;
    
    ...
}

If the test then passes, it’s really only this method, and I’ll create a fix either today or on monday. Otherwise, if there are other methods failing like this on MacOS, it would be great to know which ones.

(But I think that the functions that are deprecated since CUDA 3.0 can “safely” be omitted anyhow, so I’ll consider throwing an UnsupportedOperationException for all of these)

marco13:

Adding:


        if (method.toString().contains("cuGLRegisterBufferObject")) return true;
        if (method.toString().contains("cudaGLRegisterBufferObject")) return true;

to skip those two calls gets the JCuda tests to pass.

now, however, I seem to have a problem getting maven to see the libs. I have the dylibs in jcuda-main/nativeLibraries as instructed. Honestly, I’ve never really used maven for much, so not sure how to proceed.


[INFO] Building jcuda-main 0.7.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jcuda-main ---
[INFO] Deleting /Users/cc/repos/jcuda-main/jcuda-main/target
[INFO]
[INFO] --- maven-dependency-plugin:2.10:copy (default) @ jcuda-main ---
[INFO] Configured Artifact: org.jcuda:jcuda:JCudaRuntime-nativeLibrary:0.7.5:dylib
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] jcuda .............................................. SUCCESS [  5.939 s]
[INFO] jcublas ............................................ SUCCESS [  3.703 s]
[INFO] jcufft ............................................. SUCCESS [  1.690 s]
[INFO] jcurand ............................................ SUCCESS [  1.702 s]
[INFO] jcusparse .......................................... SUCCESS [  3.223 s]
[INFO] jcusolver .......................................... SUCCESS [  2.057 s]
[INFO] jcuda-main ......................................... FAILURE [  0.244 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.669 s
[INFO] Finished at: 2015-09-25T10:13:23-04:00
[INFO] Final Memory: 84M/681M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:copy (default) on project jcuda-main: Unable to find artifact. Failure to find org.jcuda:jcuda:dylib:JCudaRuntime-nativeLibrary:0.7.5 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.jcuda -DartifactId=jcuda -Dversion=0.7.5 -Dclassifier=JCudaRuntime-nativeLibrary -Dpackaging=dylib -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.jcuda -DartifactId=jcuda -Dversion=0.7.5 -Dclassifier=JCudaRuntime-nativeLibrary -Dpackaging=dylib -Dfile=/path/to/file -Durl= -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] org.jcuda:jcuda:dylib:0.7.5
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:copy (default) on project jcuda-main: Unable to find artifact.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
	at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:265)
	at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems(AbstractFromConfigurationMojo.java:171)
	at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.doExecute(CopyMojo.java:105)
	at org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 20 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Failure to find org.jcuda:jcuda:dylib:JCudaRuntime-nativeLibrary:0.7.5 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.jcuda -DartifactId=jcuda -Dversion=0.7.5 -Dclassifier=JCudaRuntime-nativeLibrary -Dpackaging=dylib -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.jcuda -DartifactId=jcuda -Dversion=0.7.5 -Dclassifier=JCudaRuntime-nativeLibrary -Dpackaging=dylib -Dfile=/path/to/file -Durl= -DrepositoryId=[id]


  org.jcuda:jcuda:dylib:0.7.5

from the specified remote repositories:
  central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:218)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:154)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:545)
	at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:257)
	... 25 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.jcuda:jcuda:dylib:JCudaRuntime-nativeLibrary:0.7.5 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
	... 28 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.jcuda:jcuda:dylib:JCudaRuntime-nativeLibrary:0.7.5 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
	at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
	at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
	... 32 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :jcuda-main

Honestly, I also haven’t used Maven very much yet :o Maybe @Mysterion or @maki have an idea what might be wrong there?

I just tested it, with a freshly cloned version from GitHub, and it worked for me.

First, a wild guess: Due do the nasty crash during the first tests, Maven might be “confused” (leaving some files in an invalid state or so). So you might try forcing an update with the “-U” parameter:
mvn clean package -U

In any case, for some reason, in your case, it seems to look for the native libraries (only!) in Maven Central. What’s even more confusing is that it says


[INFO] --- maven-dependency-plugin:2.10:copy (default) @ jcuda-main ---
[INFO] Configured Artifact: org.jcuda:jcuda:JCudaRuntime-nativeLibrary:0.7.5:dylib

and does not find exactly this library. (For me, it shows

the full list of
[spoiler]


[INFO] --- maven-dependency-plugin:2.10:copy (default) @ jcuda-main ---
[INFO] Configured Artifact: org.jcuda:jcuda:JCudaRuntime-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcuda:JCudaDriver-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcublas:JCublas-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcublas:JCublas2-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcufft:JCufft-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcusparse:JCusparse-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcurand:JCurand-nativeLibrary:0.7.5:dll
[INFO] Configured Artifact: org.jcuda:jcusolver:JCusolver-nativeLibrary:0.7.5:dll
[INFO] Copying JCudaRuntime-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCudaRuntime-windows-x86_64.dll
[INFO] Copying JCudaDriver-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCudaDriver-windows-x86_64.dll
[INFO] Copying JCublas-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCublas-windows-x86_64.dll
[INFO] Copying JCublas2-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCublas2-windows-x86_64.dll
[INFO] Copying JCufft-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCufft-windows-x86_64.dll
[INFO] Copying JCusparse-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCusparse-windows-x86_64.dll
[INFO] Copying JCurand-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCurand-windows-x86_64.dll
[INFO] Copying JCusolver-windows-x86_64.dll to C:\Develop\JCuGitHubCloned\jcuda-main	arget\JCusolver-windows-x86_64.dll

[/spoiler]

all libraries there). So there might be something wrong in the main POM

Left the Macbook at work and I have some meetings on monday at the Oktoberfest, maybe I can try on tuesday/wednesday, sorry :frowning:

@maki Thanks. It’s not “urgent”, as the binaries are built properly, but only not copied properly to the target path. But maybe something like the "-U"pdate already helped here, @capdevc ?

Btw., what would I download/do to test if it works?

Hm. In fact, I’m not sure how to do this with the least effort. You probably don’t want to build all the binaries, as the issue is only that they are not copied properly.

EDIT>
But before you invest any effort here, I hope that @capdevc will tell whether something as simple as adding the “-U” parameter may already have resolved the issue (unlikely, but not impossible).
<EDIT

However, I’ll summarize this here, because I’ll have to describe this in more detail in the Readme.md anyhow:

The repos have to be cloned locally (I considered to even add some BATch/SHell script for this…)


md workspace
cd workspace

git clone https://github.com/jcuda/jcuda-main.git
git clone https://github.com/jcuda/jcuda-common.git
git clone https://github.com/jcuda/jcuda.git
git clone https://github.com/jcuda/jcublas.git
git clone https://github.com/jcuda/jcufft.git
git clone https://github.com/jcuda/jcusparse.git
git clone https://github.com/jcuda/jcurand.git
git clone https://github.com/jcuda/jcusolver.git

The next thing would be to build the native libs


cd jcuda-main
cmake-gui
(Configure/Generate/Build)

causing the native libraries from the download package to be created in workspace/jcuda-main/nativeLibraries.

Finally, the problem happens when


mvn clean package -U

is called.

The parent POM contains the configuration for the respective OS

Defined variables
[spoiler]
[xml]

<profiles>



apple-x86_64


mac
x86_64



<jcuda.os>apple</jcuda.os>
<jcuda.arch>x86_64</jcuda.arch>
<jcuda.ext>dylib</jcuda.ext>
<jcuda.libDir>${session.executionRootDirectory}/nativeLibraries</jcuda.libDir>



[/xml]
[/spoiler]

Each project POM uses them to define each native library as an atrifact with the build-helper-maven-plugin

build-helper-maven-plugin configuration
[spoiler]
[xml]

org.codehaus.mojo
build-helper-maven-plugin
1.9.1


attach-artifacts
package

attach-artifact




${jcuda.libDir}/JCublas-${jcuda.os}-${jcuda.arch}.${jcuda.ext}
${jcuda.ext}
JCublas-nativeLibrary


${jcuda.libDir}/JCublas2-${jcuda.os}-${jcuda.arch}.${jcuda.ext}
${jcuda.ext}
JCublas2-nativeLibrary






[/xml]
[/spoiler]

Finally, the main POM uses the maven-dependency-plugin to copy these atrifacts (i.e. the native libraries) into the target directory.

maven-dependency-plugin configuration
[spoiler]
[xml]

org.apache.maven.plugins
maven-dependency-plugin
2.10

                <!-- Copy the native libraries of all modules to the jcuda-main build directory -->
                <execution>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <artifactItems>



org.jcuda
jcublas
${project.version}
${jcuda.ext}
JCublas-nativeLibrary
${project.build.directory}
JCublas-${jcuda.os}-${jcuda.arch}.${jcuda.ext}
true

                            <artifactItem>
                                <groupId>org.jcuda</groupId>
                                <artifactId>jcublas</artifactId>
                                <version>${project.version}</version>
                                <type>${jcuda.ext}</type>
                                <classifier>JCublas2-nativeLibrary</classifier>
                                <outputDirectory>${project.build.directory}</outputDirectory>
                                <destFileName>JCublas2-${jcuda.os}-${jcuda.arch}.${jcuda.ext}</destFileName>
                                <overWrite>true</overWrite>
                            </artifactItem>

[/xml]
[/spoiler]

Pretty straighforward, isn’t it? :rolleyes: