The specified procedure could not be found: for jcuda 9.2 - dllimport

I am attempting to load the dll for the JCudaDriver which I extracted with the jar.exe tool.
System.loadLibrary("JCudaDriver-0.9.2-windows-x86_64")
That driver is definitely in my java.libary.path because if I remove it manually, I get a not-found type error instead. Now I receive the following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: myPath.JCudaDriver-0.9.2-windows-x86_64.dll.dll: The specified procedure could not be found
My understanding is that this specified procedure is located in some missing dependency on another dll or there is a version clash. I used the windows utility function on the command line as dumpbin /dependents xx.dll to find the dependent dlls. They are as follows.
Dump of file JCudaDriver-0.9.2-windows-x86_64.dll
Image has the following dependencies:
nvcuda.dll
ADVAPI32.dll
KERNEL32.dll
I can load the nvcuda.dll without error but the latter two are a problem.
fun main(args: Array<String>) {
//System.loadLibrary("nvcuda")
System.loadLibrary("ADVAPI32")
//System.loadLibrary("KERNEL32")
}
This is the error when trying to load ADVAPI32.dll
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\aaa_eric\code\lib\dlls_x64\advapi32.dll: %1 is not a valid Win32 application

After some effort by the supporter of JCuda, Marco13 who left a comment above, the problem was identified as having updated the graphics driver after having installed Cuda. That changed some of the dlls. The fix was to remove and reinstall Cuda.
I'll reference here the forum link where we iterated to the solution.

Related

Alljoyn android Events and Actions sample not working

Trying to run Android sample 'Events and Actions' downloaded from https://allseenalliance.org/framework/download
Downloaded 'Core SDK - debug' which has sample eventaction and .apk in bin folder.
Installed it, but doesn't work. Is anyone able to run it?
Edit: Exception in the Logcat:
08-29 09:06:16.978 29314 29328 E AndroidRuntime: Process: org.allseen.sample.eventaction, PID: 29314
08-29 09:06:16.978 29314 29328 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__exidx_end" referenced by "/data/app/org.allseen.sample.eventaction-1/lib/arm/libMyAllJoynCode.so"...
I have tried building the library MyAllJoynCode.so using Android ndk, but I couldn't able to build it. I get below exception
root#jay-dev:~/alljoyn/core/alljoyn/alljoyn_core/samples/eventaction/Android# ndk-build
[arm64-v8a] Compile++ : MyAllJoynCode <= AndroidJNIBridge.cc
In file included from /root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/qcc/atomic.h:30:0,
from /root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/qcc/ManagedObj.h:38,
from /root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/alljoyn/Message.h:30,
from /root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/alljoyn/AuthListener.h:32,
from /root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/alljoyn/BusAttachment.h:34,
from jni/event/AndroidJNIBridge.cc:19:
/root/alljoyn/core/alljoyn/build/linux/x86_64/debug/dist/cpp/inc/qcc/posix/atomic.h:30:25: fatal error: sys/atomics.h: No such file or directory
#include
^
compilation terminated.
/root/android-ndk-r12b/android-ndk-r12b/build/core/build-binary.mk:474: recipe for target 'obj/local/arm64-v8a/objs/MyAllJoynCode/event/AndroidJNIBridge.o' failed
make: *** [obj/local/arm64-v8a/objs/MyAllJoynCode/event/AndroidJNIBridge.o] Error 1
It looks like you were using Android NDK level 20 (or later).
The NDK's android-20 platform directory no longer contains the atomics.h file (they removed it), which caused the AllJoyn build failure you saw:
dist/cpp/inc/qcc/posix/atomic.h:30:25: fatal error: sys/atomics.h: No such file or directory
Prior to AllJoyn release 16.10, a workaround is simply to copying the NDK's android-19 atomics.h file to its android-20 (or later) platform directory.
However, the AllJoyn-related issue has been fixed as of September 2016 (i.e. no longer dependent on atomics.h), and the fix is included in AllJoyn release 16.10.
More information is provided in JIRA https://jira.allseenalliance.org/browse/ASACORE-3216

NDK:OpenSSL error" java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libssl.so.1.0.0" needed by "libmyLib.so"

I am trying to build libcurl with openSSL support. I tried using DockerFile and using ubantuimage with that. I am able to compile .so file for libcurl and openSSL. When I try to use those in my android NDK project and load application into device then it gives me error "java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libssl.so.1.0.0" needed by "libmyLib.so"; caused by library "libssl.so.1.0.0" not found". I have put this versioned file where my libcurl.so,libcrypto.so and libssl.so resides. This kind of error comes for every .so I have used depending on order I have included in my Android.mk file. Let me know how to solve this issue. For every .so mentioned above I can see versioned files. Let me know if more detail is required. I am getting error:
java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libssl.so.1.0.0" needed by "libmyLib.so"; caused by library "libssl.so.1.0.0" not found
Android doesn't support versioned .so files, you have to rename it so it ends by .so.
clarification: you should rebuild the library in order to change its name and be able to use it - don't just rename the file itself.

Haskell Plugins and cabal sandbox

So, I'm trying to use the Plugins package to dynamically load a haskell function from a source file. The source file depends on a package foo with module Foo.Bar. I'm running my project in a Cabal sandbox, where I have foo installed. Both my main program, and the module I'm loading with plugins, depend on foo. I always get one of the following two errors:
When I have foo installed in ~/.cabal, I get the error:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
aizmvszmaizmlibzm0zi1_FooziBar_zdfTypeableBazzuds2_closure
whilst processing object file
/home/joey/.cabal/lib/foo-0.1/ghc-7.6.3/HSfoo-0.1.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
When I don't have it installed in ~/.cabal, I get a standard "module not found" error. And when I don't have it installed in my sandbox, I get the same module not found error trying to compile my main program code.
The plugins documentation is scarce at best. Any thoughts on how to solve this?
I got this working by using System.Plugins.Make to actually do the compliation, instead of relying on pre-existing object files. Not a complete solution, doesn't explain the problem, but it works for me for now.

Ant LibusbJava compile error: "jni.h: No such file"...fixed, now a memset error

There appears to be a Ant / jni.h problem (for my setup) with LibusbJava. I get the following error when setting up LibusbJava by running
ant linux
in CentOS 6.3 as root (quick and dirty test, thanks for those concerned about user level =0). I will redo with proper restrictions as shown on a libusbjava reference after reflection when first install works. LibusbJava, is a Java wrapper for the libusb library.
The output starts out like this:
[root#somebox LibusbJava]# ant linux -lib $JAVA_HOME/include -lib $JAVA_HOME/include/linux
Buildfile: build.xml
clean:
Build LibusbJava Test Linux:
Build LibusbJava Test:
[echo] Building Library for unit tests:
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:27:17: error: jni.h: No such file or directory
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:34:26: error: test/CuTest.h: No such file or directory
`...`
as it was not set on my system. It appears that jni.h is a header called by C++ code, which I had to add to the LibusbJava.cpp file. This is the new include, /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/include/jni.h. I then get an error with jni.h not being able to fine jni_md.h which is an include in jni.h #include "jni_md.h".
Clearly this is not the right approach, so perhaps I need a correct Ant reference, but I cannot seem to do it with a -lib switch. Besides, this just creates thousands of jni.h file errors during the Ant build attempt.
How can I fix this problem?
Notes: I've set$JAVA_HOME up like JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64 and javac and java work fine.
New discovery... after helpful questions which guided me, I am much closer to successful compilation.
When I install LibusbJava and manually install all the library references in build.xml there is still an error compiling the LibusbJava based on a memset error. I see memset patches for libusb that appeared in 2007 and it's unclear how to use or if they relate. Investigating... Hints, comments and questions welcome. My most sincere thanks for the help thus far.
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp: In function ‘void Usb_Device_disconnect(JNIEnv*)’:
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp:88: error: ‘memset’ was not declared in this scope
[antcall] Exiting /.../libu/libusbjava/trunk/LibusbJava/build.xml.
BUILD FAILED
but I find no referece to an include string.h or cstring. The header of Usb_Device.cpp mentions it is a C++ Stub for the java class of a java class ch.ntb.inf.libusbJava.Usb_Device. which only has this include #include "Usb_Device.h" which also does not appear to have a string include. Perhaps just insertion of#include`?

CMake finds the correct library, but VC++ attempts to link with something else

I have a CMake module to locate FreeGLUT:
FIND_PATH(FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h)
FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut freeglut_static)
SET(FREEGLUT_LIBRARIES ${FREEGLUT_LIBRARY})
SET(FREEGLUT_INCLUDE_DIRS ${FREEGLUT_INCLUDE_DIR})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeGLUT DEFAULT_MSG FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR)
MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIR FREEGLUT_LIBRARY)
It works fine and locates freeglut_static.lib when I generate NMake Makefiles on Windows. I'm attempting to statically link FreeGLUT into my DLL:
FIND_PACKAGE(FreeGLUT REQUIRED)
ADD_LIBRARY(vti SHARED ${VTI_SOURCES})
ADD_DEFINITIONS("-DBUILD_VTI=1 -DFREEGLUT_STATIC=1")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${FREEGLUT_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(vti ${FREEGLUT_LIBRARIES})
My source code builds correctly, but when it gets to the linking stage, VC++ fails with:
LINK : fatal error LNK1104: cannot open file 'freeglut.lib'
Which is strange since freeglut.lib isn't mentioned anywhere that I can see in the generated NMake makefiles. It should be trying to link with freeglut_static.lib, which CMake locates and sets in FREEGLUT_LIBRARIES.
What might be causing this?
This is caused with pragma directives in FreeGLUT code (see freeglut_std.h). Using FREEGLUT_STATIC should really fix that for you, but I think you should pass it to CMake without quotes: ADD_DEFINITIONS(-DBUILD_VTI -DFREEGLUT_STATIC)

Resources