You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Harry Wilkinson <hw...@mdsol.com> on 2013/10/14 02:26:32 UTC

Does libmesos.so depend on libjvm.so?

Hi,

I'm toying with Ruby bindings for the C++ interface to Mesos.  After much
fiddling with Ruby's makefile-generating code I've made some progress, but
I'm seeing this error in the logs when trying to check that I can actually
link to something in libmesos.so:

"g++ -o conftest
-I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-linux
-I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward
-I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I.
-I/usr/local/include/mesos -I/usr/local/include/mesos/include
-I/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/include
 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses
-Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
-Wwrite-strings -Wdeclaration-after-statement
-Wimplicit-function-declaration conftest.c  -L.
-L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
-Wl,-R/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
-L/usr/local/include/mesos/lib -Wl,-R/usr/local/include/mesos/lib -L.
 -rdynamic -Wl,-export-dynamic
 -L/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/lib
-lrice     '-Wl,-rpath,/../lib' -Wl,-R
-Wl,/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
-L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib -lruby -lmesos  -lpthread
-lrt -ldl -lcrypt -lm   -lc"
cc1plus: warning: command line option '-Wdeclaration-after-statement' is
valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wimplicit-function-declaration' is
valid for C/ObjC but not for C++ [enabled by default]
conftest.c: In function 'int t()':
conftest.c:6:28: warning: variable 'p' set but not used
[-Wunused-but-set-variable]
/usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so, not
found (try using -rpath or -rpath-link)
/usr/local/lib/libmesos.so: undefined reference to
`JNI_CreateJavaVM@SUNWprivate_1.1'
collect2: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <mesos.hpp>
 4:
 5: /*top*/
 6: int t() { void ((*volatile p)()); p = (void
((*)()))mesos::FrameworkID::default_instance; return 0; }
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12:
13:   return 0;
14: }
/* end */


These look like the key lines describing the problem:

/usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so, not
found (try using -rpath or -rpath-link)
/usr/local/lib/libmesos.so: undefined reference to
`JNI_CreateJavaVM@SUNWprivate_1.1'

Does this mean that the Java bindings create a dependency on the JVM libs
at compile time?  If so, presumably this could be refactored so the Java
bindings depend on core Mesos but not vice-versa... right?  Or am I missing
something here?

Thanks.

Harry

Re: Does libmesos.so depend on libjvm.so?

Posted by Harry Wilkinson <hw...@mdsol.com>.
Hey Ray,

I have Java installed and libjvm.so is present on the system, so that's not
really a problem.  I was just pretty surprised to find that the C++ API for
Mesos is dependent on the presence of JVM libraries.

I'm mainly wondering if this is a technical design choice, or if it was
just the simplest way to get the Java bindings working.


On 13 October 2013 20:43, Ray Rodriguez <ra...@gmail.com> wrote:

> And yes I do believe mesos is dependent on a locally installed java.
>
>
> On Sun, Oct 13, 2013 at 8:42 PM, Ray Rodriguez <ra...@gmail.com>wrote:
>
>> libjvm.so is not in the mesos binary but it is located in java installs.
>>  On our slaves it's located
>> at /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
>>
>> Perhaps you need to install a full jdk on your dev machine?
>>
>> Ray
>>
>>
>> On Sun, Oct 13, 2013 at 8:26 PM, Harry Wilkinson <hw...@mdsol.com>wrote:
>>
>>> Hi,
>>>
>>> I'm toying with Ruby bindings for the C++ interface to Mesos.  After
>>> much fiddling with Ruby's makefile-generating code I've made some progress,
>>> but I'm seeing this error in the logs when trying to check that I can
>>> actually link to something in libmesos.so:
>>>
>>> "g++ -o conftest
>>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-linux
>>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward
>>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I.
>>> -I/usr/local/include/mesos -I/usr/local/include/mesos/include
>>> -I/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/include
>>>  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses
>>> -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
>>> -Wwrite-strings -Wdeclaration-after-statement
>>> -Wimplicit-function-declaration conftest.c  -L.
>>> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>>> -Wl,-R/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>>> -L/usr/local/include/mesos/lib -Wl,-R/usr/local/include/mesos/lib -L.
>>>  -rdynamic -Wl,-export-dynamic
>>>  -L/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/lib
>>> -lrice     '-Wl,-rpath,/../lib' -Wl,-R
>>> -Wl,/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>>> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib -lruby -lmesos  -lpthread
>>> -lrt -ldl -lcrypt -lm   -lc"
>>> cc1plus: warning: command line option '-Wdeclaration-after-statement' is
>>> valid for C/ObjC but not for C++ [enabled by default]
>>> cc1plus: warning: command line option '-Wimplicit-function-declaration'
>>> is valid for C/ObjC but not for C++ [enabled by default]
>>> conftest.c: In function 'int t()':
>>> conftest.c:6:28: warning: variable 'p' set but not used
>>> [-Wunused-but-set-variable]
>>> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so,
>>> not found (try using -rpath or -rpath-link)
>>> /usr/local/lib/libmesos.so: undefined reference to
>>> `JNI_CreateJavaVM@SUNWprivate_1.1'
>>> collect2: ld returned 1 exit status
>>> checked program was:
>>> /* begin */
>>>  1: #include "ruby.h"
>>>  2:
>>>  3: #include <mesos.hpp>
>>>  4:
>>>  5: /*top*/
>>>  6: int t() { void ((*volatile p)()); p = (void
>>> ((*)()))mesos::FrameworkID::default_instance; return 0; }
>>>  7: int main(int argc, char **argv)
>>>  8: {
>>>  9:   if (argc > 1000000) {
>>> 10:     printf("%p", &t);
>>> 11:   }
>>> 12:
>>> 13:   return 0;
>>> 14: }
>>> /* end */
>>>
>>>
>>> These look like the key lines describing the problem:
>>>
>>> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so,
>>> not found (try using -rpath or -rpath-link)
>>> /usr/local/lib/libmesos.so: undefined reference to
>>> `JNI_CreateJavaVM@SUNWprivate_1.1'
>>>
>>> Does this mean that the Java bindings create a dependency on the JVM
>>> libs at compile time?  If so, presumably this could be refactored so the
>>> Java bindings depend on core Mesos but not vice-versa... right?  Or am I
>>> missing something here?
>>>
>>> Thanks.
>>>
>>> Harry
>>>
>>>
>>
>


-- 
*Harry Wilkinson* | Sr. Cloud Architect | Medidata Solutions
Worldwide<http://www.mdsol.com>
41 East 11th Street, 10th Floor, New York, NY 10003
Twitter: @harwilk <http://twitter.com/#!/harwilk>

The information in this transmittal and any attachments are confidential
and intended only for the recipient(s) listed above.
You are hereby notified that any unauthorized distribution or copying of
this transmittal or its attachments is prohibited.
If you have received this transmittal in error, please notify the sender.

Re: Does libmesos.so depend on libjvm.so?

Posted by Ray Rodriguez <ra...@gmail.com>.
And yes I do believe mesos is dependent on a locally installed java.


On Sun, Oct 13, 2013 at 8:42 PM, Ray Rodriguez <ra...@gmail.com> wrote:

> libjvm.so is not in the mesos binary but it is located in java installs.
>  On our slaves it's located
> at /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
>
> Perhaps you need to install a full jdk on your dev machine?
>
> Ray
>
>
> On Sun, Oct 13, 2013 at 8:26 PM, Harry Wilkinson <hw...@mdsol.com>wrote:
>
>> Hi,
>>
>> I'm toying with Ruby bindings for the C++ interface to Mesos.  After much
>> fiddling with Ruby's makefile-generating code I've made some progress, but
>> I'm seeing this error in the logs when trying to check that I can actually
>> link to something in libmesos.so:
>>
>> "g++ -o conftest
>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-linux
>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward
>> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I.
>> -I/usr/local/include/mesos -I/usr/local/include/mesos/include
>> -I/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/include
>>  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses
>> -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
>> -Wwrite-strings -Wdeclaration-after-statement
>> -Wimplicit-function-declaration conftest.c  -L.
>> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>> -Wl,-R/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>> -L/usr/local/include/mesos/lib -Wl,-R/usr/local/include/mesos/lib -L.
>>  -rdynamic -Wl,-export-dynamic
>>  -L/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/lib
>> -lrice     '-Wl,-rpath,/../lib' -Wl,-R
>> -Wl,/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
>> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib -lruby -lmesos  -lpthread
>> -lrt -ldl -lcrypt -lm   -lc"
>> cc1plus: warning: command line option '-Wdeclaration-after-statement' is
>> valid for C/ObjC but not for C++ [enabled by default]
>> cc1plus: warning: command line option '-Wimplicit-function-declaration'
>> is valid for C/ObjC but not for C++ [enabled by default]
>> conftest.c: In function 'int t()':
>> conftest.c:6:28: warning: variable 'p' set but not used
>> [-Wunused-but-set-variable]
>> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so,
>> not found (try using -rpath or -rpath-link)
>> /usr/local/lib/libmesos.so: undefined reference to
>> `JNI_CreateJavaVM@SUNWprivate_1.1'
>> collect2: ld returned 1 exit status
>> checked program was:
>> /* begin */
>>  1: #include "ruby.h"
>>  2:
>>  3: #include <mesos.hpp>
>>  4:
>>  5: /*top*/
>>  6: int t() { void ((*volatile p)()); p = (void
>> ((*)()))mesos::FrameworkID::default_instance; return 0; }
>>  7: int main(int argc, char **argv)
>>  8: {
>>  9:   if (argc > 1000000) {
>> 10:     printf("%p", &t);
>> 11:   }
>> 12:
>> 13:   return 0;
>> 14: }
>> /* end */
>>
>>
>> These look like the key lines describing the problem:
>>
>> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so,
>> not found (try using -rpath or -rpath-link)
>> /usr/local/lib/libmesos.so: undefined reference to
>> `JNI_CreateJavaVM@SUNWprivate_1.1'
>>
>> Does this mean that the Java bindings create a dependency on the JVM libs
>> at compile time?  If so, presumably this could be refactored so the Java
>> bindings depend on core Mesos but not vice-versa... right?  Or am I missing
>> something here?
>>
>> Thanks.
>>
>> Harry
>>
>>
>

Re: Does libmesos.so depend on libjvm.so?

Posted by Ray Rodriguez <ra...@gmail.com>.
libjvm.so is not in the mesos binary but it is located in java installs.
 On our slaves it's located
at /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so

Perhaps you need to install a full jdk on your dev machine?

Ray


On Sun, Oct 13, 2013 at 8:26 PM, Harry Wilkinson <hw...@mdsol.com>wrote:

> Hi,
>
> I'm toying with Ruby bindings for the C++ interface to Mesos.  After much
> fiddling with Ruby's makefile-generating code I've made some progress, but
> I'm seeing this error in the logs when trying to check that I can actually
> link to something in libmesos.so:
>
> "g++ -o conftest
> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-linux
> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward
> -I/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I.
> -I/usr/local/include/mesos -I/usr/local/include/mesos/include
> -I/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/include
>  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses
> -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
> -Wwrite-strings -Wdeclaration-after-statement
> -Wimplicit-function-declaration conftest.c  -L.
> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
> -Wl,-R/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
> -L/usr/local/include/mesos/lib -Wl,-R/usr/local/include/mesos/lib -L.
>  -rdynamic -Wl,-export-dynamic
>  -L/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/rice-1.5.2/ruby/lib/lib
> -lrice     '-Wl,-rpath,/../lib' -Wl,-R
> -Wl,/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib
> -L/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib -lruby -lmesos  -lpthread
> -lrt -ldl -lcrypt -lm   -lc"
> cc1plus: warning: command line option '-Wdeclaration-after-statement' is
> valid for C/ObjC but not for C++ [enabled by default]
> cc1plus: warning: command line option '-Wimplicit-function-declaration' is
> valid for C/ObjC but not for C++ [enabled by default]
> conftest.c: In function 'int t()':
> conftest.c:6:28: warning: variable 'p' set but not used
> [-Wunused-but-set-variable]
> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so, not
> found (try using -rpath or -rpath-link)
> /usr/local/lib/libmesos.so: undefined reference to
> `JNI_CreateJavaVM@SUNWprivate_1.1'
> collect2: ld returned 1 exit status
> checked program was:
> /* begin */
>  1: #include "ruby.h"
>  2:
>  3: #include <mesos.hpp>
>  4:
>  5: /*top*/
>  6: int t() { void ((*volatile p)()); p = (void
> ((*)()))mesos::FrameworkID::default_instance; return 0; }
>  7: int main(int argc, char **argv)
>  8: {
>  9:   if (argc > 1000000) {
> 10:     printf("%p", &t);
> 11:   }
> 12:
> 13:   return 0;
> 14: }
> /* end */
>
>
> These look like the key lines describing the problem:
>
> /usr/bin/ld: warning: libjvm.so, needed by /usr/local/lib/libmesos.so, not
> found (try using -rpath or -rpath-link)
> /usr/local/lib/libmesos.so: undefined reference to
> `JNI_CreateJavaVM@SUNWprivate_1.1'
>
> Does this mean that the Java bindings create a dependency on the JVM libs
> at compile time?  If so, presumably this could be refactored so the Java
> bindings depend on core Mesos but not vice-versa... right?  Or am I missing
> something here?
>
> Thanks.
>
> Harry
>
>