Skip to content
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

Need support for SunOS #42

Closed
mukhanov opened this issue Aug 8, 2013 · 9 comments
Closed

Need support for SunOS #42

mukhanov opened this issue Aug 8, 2013 · 9 comments

Comments

@mukhanov
Copy link

mukhanov commented Aug 8, 2013

Hi, I have this error when I run cassandra on my server:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:317)
at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:219)
at org.xerial.snappy.Snappy.(Snappy.java:44)
at org.apache.cassandra.io.compress.SnappyCompressor.create(SnappyCompressor.java:46)
at org.apache.cassandra.io.compress.SnappyCompressor.isAvailable(SnappyCompressor.java:56)
at org.apache.cassandra.io.compress.SnappyCompressor.(SnappyCompressor.java:38)
at org.apache.cassandra.config.CFMetaData.(CFMetaData.java:76)
at org.apache.cassandra.config.KSMetaData.systemKeyspace(KSMetaData.java:84)
at org.apache.cassandra.config.DatabaseDescriptor.loadYaml(DatabaseDescriptor.java:438)
at org.apache.cassandra.config.DatabaseDescriptor.(DatabaseDescriptor.java:114)
at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:127)
at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:389)
at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:107)
Caused by: java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at org.xerial.snappy.SnappyNativeLoader.loadLibrary(SnappyNativeLoader.java:52)
... 17 more

I've realised that snappy-java doesn't have native library for SunOS.

Is it possible to compile it for this OS ?

My System.properties:
os.arch=amd64
os.name=SunOS
os.version=5.10

@xerial
Copy link
Owner

xerial commented Aug 12, 2013

I haven't tried using SunOS (spark machine?), but it might be possible since no special configuration is required to compile native library of snappy-java.

Fetch the source code and try make native & make commands.
If the compilation of the native library succeeds, the resulting native library and a new snappy-java jar file will be generated in target folder.

@bokken
Copy link
Contributor

bokken commented Aug 12, 2013

While SunOS is Solaris, it runs on both x86 and the Sun specific Sparc
architecture. Here it looks like he is using amd64, not sparc.
On Aug 11, 2013 11:09 PM, "Taro L. Saito" notifications@github.com wrote:

I haven't tried using SunOS (spark machine?), but it might be possible
since no special configuration is required to compile native library of
snappy-java.

Fetch the source code and try make native & make commands.
If the compilation of the native library succeeds, the resulting native
library and a new snappy-java jar file will be generated in target folder.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-22472551
.

@Craigacp
Copy link
Contributor

I had a few issues compiling this on Solaris, firstly you need to use gmake (GNU make) rather than the standard Solaris make. Second you need to edit Makefile to use gtar instead of tar. I also added OS arch targets for SunOS-x86 and SunOS-amd64 and pointed those at the linux equivalents (as the linux jni.h has a reference to solaris and the default one points at mac), I also removed the m32 and m64 tags on SunOS as solaris handles those in a different way.

It compiles and the tests execute fine now. This was on an x86 box running Solaris 11.1.

@xerial
Copy link
Owner

xerial commented Aug 13, 2013

@Craigacp
Thanks for the success report. Could you show me your fix made to Makefile scripts? (via pull request or patch)
I would like to integrate these changes.

@Craigacp
Copy link
Contributor

I don't think the SunOS-amd64 target actually did anything so I've removed it (as it wasn't used by the 64-bit machine I was building on), but I added sparc build targets and checked those work. The pull request is in now, but I'm not that familiar with GitHub so I can't add it to this issue.

@xerial
Copy link
Owner

xerial commented Aug 13, 2013

Thanks to @Craigacp's contribution, Makefile has been modified to be able to compile native libraries for Solaris (x86 and sparc).

@Craigacp
Could you send another pull request that includes the following native libraries?
src/main/resources/org/xerial/snappy/native/SunOS/x86/libsnappyjava.so
src/main/resources/org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so

I am now preparing a release build for snappy-java-1.1.0, so it is the best timing to integrate them.

@xerial
Copy link
Owner

xerial commented Aug 19, 2013

native libraries for SunOS are integrated to the develop branch. Now close this issue.

@xerial xerial closed this as completed Aug 19, 2013
@mukhanov
Copy link
Author

Thank you guys!

@xerial
Copy link
Owner

xerial commented Oct 17, 2013

@Craigacp
Could you build Solaris x86 and Sparc libraries based on the current develop branch?
Yesterday, snappy-1.1.1 is released and we need to recompile snappy-java for this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants