Tuesday, August 18, 2009

Building Tokyo Cabinet for use with Java on OS X

I've been really interested in playing with Tokyo Cabinet lately. I thought that it would be fun to take a hack at the GitHub Contest using Scala and Tokyo Cabinet. I then set out to build Tokyo Cabinet and its Java bindings (since I can call those easily from Scala). The Java bindings for Tokyo Cabinet are not pure Java, they use JNI, so you need to compile some C as well as Java. Everything looked fine and dandy until I tried to run some code. I then ran into this stack trace from Scala:

To translate, what is going on here is that by default Tokyo Cabinet will build a 32 bit binaries. Java 1.6 on OS X is 64 bit and will look for a 64 bit version of the library. Here is what I did to make things happy.

When running the configure script for Tokyo Cabinet itself, I added a flag:

I tried the same trick when configuring the Java bindings, but it didn't seem to end up in the resulting Makefile. So I edited the Makefile by hand. In the end, my CFLAGS line looks like this:

After that, I was able to get a small Scala script to create a Hash database.

As an aside, the Scala IDE for Eclipse seems really nice. I had tried it out a few months ago, and it has clearly made a lot of progress since then.


pbsl said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here


pbsl said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here


javieth said...

I liked this blog because is easy understandable and very useful. for me Os X is the best software that i proved before. I really like this kind of technology because isn´t complex to use.
buy viagra

Penis Enlargement Pills said...

Erectile Dysfunction FAQ's

Impotence, or penile erectile dysfunction, in men is not as rare as one would think it is.
In fact, one out of ten men around the world is affected by this condition. It is not exclusive to old men either. Impotence is caused not just by physical factors,
but mental factors as well.
Exercising on a regular basis and eating healthy food will increase your ability to sustain prolonged physical effort and we all know that sex is effort.
Smoking, frequently drinking large quantities of alcohol, taking recreational drugs and lack of exercising will sap your stamina and also slow down the flow of blood.
Penis exercises can be used for maintaining fitness, preventing or controlling premature ejaculation and increasing the length and girth of the penis.
by penis enlargement pills you can overcome these problems and not only that you can also enlarge, extend also to strengthen your penis and premature ejaculation will not exist anymore for you.
visit http://www.factspenisenlargement.com for more info.

pedro velasquez said...

The problem isdominical costa rica tours that vectors and strings have variable length. When I pass a void* (my object) to Tokyo Cabinet so it can store it, I also have to pass the size of the object in bytes. But that can't be trivially done.
What is the best way to determine the number of bytes of an object? Or what is the best way to store variable length objects in Tokyo Cabinet.

Josh said...

Vimax is reliable stuff to accomplish your sexual dysfunction. It has been proven by many men to augment virility and genital.

admin said...

I’ve been browsing on-line way more than three hours today, nonetheless I don’t ever found any interesting posting like your site. It’s pretty value ample for me. In my opinion, if most of web site homeowners and other people produced nice content material as you do, the web might be much far more helpful than ever before.

how to get rid of cellulite

weerah said...

This is really interesting, You're a very skilled blogger. I've joined your feed and look forward to seeking more of your wonderful post.

buy codeine online

john said...

Thank you, I have recently been searching for information about this topic for ages and yours is the best I have discovered so far.
buy vicodin online

weerah said...

I would like to pay a heartily tribute to the author of this article for sharing such innovative ideas.
buy xanax online

weerah said...

Good article. Well written! Keep them coming. Love to know more from you!
buy ritalin online

john said...

Amazing!I also wish him good luck to defend his gold medal. I like to share it with all my friends and hope they will also encourage him.
best online pharmacy

Muhammad Alexander said...

Thanks for sharing the information!
I found this article very interesting and informative!
Keep sharing!

the best seo company

mark said...

cost effective advertisingThis is good site to spent time on .I just stumbled upon your informative blog and wanted to say that I have really enjoyed reading your very well written blog posts. I will be your frequent visitor, that's for sure.

jamesfrac said...

Thanks for sharing this great article! I feel strongly about it and love learning more on this topic. It is extremely helpful for me. I hope you post again soon

Penis enlargement device said...

this very incredible blogs and very interesting to read ..
continue to add his writings ..

Penis Enlargement

john said...

Thanks to a brilliant effort in publishing your article. One can be more informative as this. There are many things I can know only after reading your wonderful article.
organic seo service

mark said...

Thanks for sharing the information!
I found this article very interesting and informative!
Keep sharing!drug discussion
drug discussion forum
drug forum

Best Penis Enlargement Pills said...

Excellent post.I want to thank you for this informative read, I really appreciate sharing this great post. Keep up your work.
@ Vimax,Vimax, Vimax Pills, Buy Vimax Pills, VigRX, VigRX Plus, Buy VigRX Plus, VigRX Plus Online, VigRX Plus Canada,Penis Enlargement, Penis Enlargement Pills

blogger de azi said...

Thank god for this information!

Abby said...

If you only know where to buy xanax online we promise that you wont suffer from any anxiety or pain. See more stuff as well

organic vitamins said...

I'm still learning from you, but I try to reach my goals. Since then enjoy
reading all the information that appears on your blog.Keep come. Loved it!

organic vitamins

saim said...

This is one of the most incredible blogs I have read in a very long time. Your blog is great for anyone who wants to understand this subject more. Great stuff; please keep it up!

buy curcumin

Adam said...

I'm still learning from you, but I'm trying to achieve my goals. I certainly enjoy reading all that is posted on your blog.Keep the information coming. I loved it!
buy percocet online

Colin said...

I was just browsing for relevant blog posts for my project research and I happened to stumble upon yours. Thanks for the excellent information!
buy watson


I just added this post as a favorite.
because it is very interesting and provide insight to readers ..

Penis Enlargement Pills
Vimax Pills
Vimax Extender

Hannah bolton said...

I Like your blog,will sharing this with my friends, excellent work.

business broadband providers

yakenzu toby said...

Thanks a lot for sharing this amazing knowledge with us. This site is fantastic. I always find great knowledge from it. ibcbet, judi bola, sbobet, agen bola, ibcbet, sbobet

steve7876 said...

I certainly enjoy Garcinia cambogia reading all that is posted on your blog.Keep the information coming. I loved it!

Selina Diana said...

To start with the foremost necessary line of my commentaryary – I do resembling to honor a monster as a results of the periodical tribute. If reality be notified it is a wise work by him that I discovered out laurels dependable facilitate by his/her pretty detail and figures payday loans direct lender. I effortlessly crave to declared, nice pleasure comprise it up your work. generally I’ll converse concerning at the aspect of your posting and alter. endeavouring ahead to your a allotment of posts.

Ryud Vant said...

Got a problem with your femininity? get a solution soon overcome here, and be sure to use herbal solution to the problems of your femininity, not a drug that contains chemicals because it is actually harmful to your feminine area. use crystal x regularly and feel a positive difference after wearing
ciri-ciri distributor asli PT. Natural Nusantara
crystal x dapat membantu program hamil
Reseller Crystal X
Reseller Crystal X Jogja
Jual crystal x Asli

nova nasa said...

any women experience vaginal discharge, vaginal discharge, and it is reasonable because it is certain that experienced by a woman. But whiteness is also not neglected, because whiteness is that of germs can cause serious problems in your female organs. Whitish an early symptom of cysts, myom and cervical cancer. Therefore let heal whitish and vigorous various diseases due to the whitish
and follow the steps
Crystal X Nasa
Crystal X Asli Nasa
Efek Samping Crystal X
Ciri-ciri Crystal X Asli
Entropy Cream
Bibit Bawor

Sang Pemikir said...

This is a great inspiring article.I am pretty much pleased with your good work.You put really helpful information. Keep it up. Agen Bola

Zacky van Hardi said...

This is exactly what I was looking for. Thanks for sharing this great article! That is very interesting Smile I love reading and I am always searching for informative information like this! Agen Sbobet