-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac only: Matlab cannot find Rdsamp java class #106
Comments
I think this is related to the RDSAMP JNI version only (which was optimized for speed). As a temporary solution, try not using the JNI RDSAMP by running instead: [ecg,Fs,tm]=rdsamp('mitdb/100',1,N,x); Where x can be any value besides the default ==0. |
@ikarosilva using
still gives the same error message:
|
Got the same error!
Error in rdsamp (line 114) Error in wfdbdemo (line 12) |
How to do you set up your environment? I can reproduce your problem if I initiate wrongly the environment. I do not know how you can restart your system without reinstallation. My output is the same error messages as you have. My system OS X 10.11.4 and wfdb 0-9-10. This fact proposes me that if you have any mistakes in the initiation of the system such an output will result. I opened a new ticket #121 where I try to restore the system such that I can run more tests to reproduce your case. |
@sami10007 Now I'm using OS X 10.11.4 as well. What I did and what I do is changing the current directory to |
I deleted
I extended the case to the ticket #123 where I try to restore the system without changing the directory. |
I also got the error. I did manage to stop it but I still don't exactly understand what is going on. Backstory: A while ago, I first installed the stable release from physionet: https://physionet.org/physiotools/matlab/wfdb-app-matlab/ Running wfdbdemo I got:
Running javaclasspath I get at the end:
So it's not complaining about java objects or java class paths. I solved this by replacing the precompiled wfdb libraries in the
Now wfdbdemo worked. The problem was that the compiled libraries distributed with the package were not suitable for my OS version. Now I tried to install the latest github version:
Running from matlab:
So it is complaining about not finding the Rdsamp java class, but the dynamic java path has been set. I restart matlab and run wfdbdemo again:
Still complaining about the java class. Once again I replace the precompiled libraries with the ones working on my system:
And now wfdbdemo works without complaints. So I don't really understand how replacing the libraries solved everything. I understand in my first case where at least it already got to running the compiled rdsamp and just failed to return a value to the java wrapper, so it was likely that the library file was faulty. |
@cx1111 Intriguing! Actually I encountered the same problem described on CentOS (so it is not a Mac only problem any more) and I don't have root privilege on that machine. I did essentially the same thing as you described (I have no root privilege so I cannot install like you did), and it works! However, wfdb software does not compile on Mac 10.11.5 (compilation error), so I cannot try the same thing on my Mac. |
@cx1111 I managed to compile wfdb software on Mac with |
@cx1111 @samuelandjw Same here. Compiled 10.5.24 on macOS 10.12.3. Works fine without --without-netfiles (Xcode CLI tools installed for libs). Copied files from <build_dir>/{bin,lib} across to nativelibs/macosx/bin, no effect - still broken with same error. |
Hey Guys, You actually don't need the org.physionet.wfdb.jni.Rdsamp. That's an unstable class that I was working on to make RDSAMP much faster (order of magnitudes) by implementing it on the Java Native Interface instead of going through MATLAB/JAVA/System Processes. I got the class to work with Linux and some Mac, but was having trouble compiling on Windows, so its unstable ( we can remove from the branch code). Quick Fix: if(isempty(javaWfdbRdsamp) && (rawUnits ==0)) To the following: You may want to update the help on the function as well. |
@ikarosilva Brilliant, thanks. Just to add for others' reference: warning() will complain if you pass it a string ("...") instead of a char array ('...'). I also set the default rawUnits = 1 to avoid needing to pass in all the arguments. Would be nice if these changes could be added to master until JNI is stable - or documented. |
@ikarosilva Replacing if(isempty(javaWfdbRdsamp) && (rawUnits ==0)) To the following: I get this error then: How can I solve this? |
I am having a similar issue while trying to install WFDB for MATLAB on Ubuntu 16.04. I think this problem arises due to the MakeFile in the mcode/nativelibs folder. This Makefile runs partially and succesfully downloads curl and the file 'ecgpuwave-1.3.3.tar.gz' and 'wfdb-10.5.25pre1.tar.gz'. However, it exits at line 338 of Makefile and prints an error (snapshot given below). I seems that it cannot find locate librdsampjni header file. I did try the Quickfix suggested by ikarosilva and changed the javaWfdbRdsamp=javaObject('org.physionet.wfdb.jni.Rdsamp'); line to Here are some of the messages i get before the make terminates checking whether to build shared libraries... yes Any help will be highly appreciated. |
Mac OS X 10.10.3, wfdb-toolbox version: 0-9-10 and onward, MATLAB 2015a. This will not happen on Linux.
here is an output from wfdbdemo:
The text was updated successfully, but these errors were encountered: