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

undefined symbol MacStartVM on linux #43

Open
ghost opened this Issue Feb 26, 2015 · 5 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Feb 26, 2015

Hi,

After what looked like a successful installation on Linux 64-bit, this is the error trace I get when running the headless hello world example from the docs:

Traceback (most recent call last):
  File "f.py", line 2, in <module>
    import javabridge
  File "/home/andrei/.pyenv/versions/2.7.9/lib/python2.7/site-packages/javabridge-0.0.0-py2.7-linux-x86_64.egg/javabridge/__init__.py", line 28, in <module>
    from .jutil import start_vm, kill_vm, activate_awt, deactivate_awt
  File "/home/andrei/.pyenv/versions/2.7.9/lib/python2.7/site-packages/javabridge-0.0.0-py2.7-linux-x86_64.egg/javabridge/jutil.py", line 119, in <module>
    import _javabridge
ImportError: /home/andrei/.pyenv/versions/2.7.9/lib/python2.7/site-packages/javabridge-0.0.0-py2.7-linux-x86_64.egg/javabridge/_javabridge.so: undefined symbol: MacStartVM
@LeeKamentsky

This comment has been minimized.

Owner

LeeKamentsky commented Feb 26, 2015

Sorry to hear that, Andrei. How did you install it?

@ghost

This comment has been minimized.

ghost commented Feb 26, 2015

I followed the build from git repo steps, after installing numpy and Cython. Sadly pip is not an option, I'm behind a rather tight corporate proxy.
I have now retraced those steps in a second Python installation (2.7.2) on the same Ubuntu 14.10 machine, with the same result.

@LeeKamentsky

This comment has been minimized.

Owner

LeeKamentsky commented Mar 17, 2015

I didn't mean to let this fester unattended, sorry about that. Could you clean and rebuild and post the build output? There should be a linking step that looks like this:

creating build/lib.linux-x86_64-2.6/javabridge
gcc -pthread -shared build/temp.linux-x86_64-2.6/_javabridge.o build/temp.linux-x86_64-2.6/_javabridge_nomac.o -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/client -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/i386/client -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/i386/server -L/usr/lib64 -Wl,-R/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/client -Wl,-R/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -Wl,-R/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/i386/client -Wl,-R/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/i386/server -ljvm -lpython2.6 -o build/lib.linux-x86_64-2.6/javabridge/_javabridge.so

_javabridge_nomac.o should contain the MacStartVM symbol which is a no-op.

@ghost

This comment has been minimized.

ghost commented Mar 17, 2015

Strange, no longer getting the MacStartVM error after clean & reinstall, but now it's not finding _javabridge.so.
I checked and it is present in the egg in site_packages.

15:56:44-andrei~/src/python-javabridge-master$ python setup.py clean
running clean
removing 'build/temp.linux-x86_64-2.7' (and everything under it)

15:57:31-andrei~/src/python-javabridge-master$ python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to javabridge.egg-info/requires.txt
writing javabridge.egg-info/PKG-INFO
writing top-level names to javabridge.egg-info/top_level.txt
writing dependency_links to javabridge.egg-info/dependency_links.txt
writing entry points to javabridge.egg-info/entry_points.txt
reading manifest file 'javabridge.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching '*.pyx'
writing manifest file 'javabridge.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
javac -source 6 -target 6 java/org/cellprofiler/runnablequeue/RunnableQueue.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
javac -source 6 -target 6 java/org/cellprofiler/javabridge/test/RealRect.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
javac -source 6 -target 6 java/org/cellprofiler/javabridge/CPython.java java/org/cellprofiler/javabridge/CPythonInvocationHandler.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: java/org/cellprofiler/javabridge/CPythonInvocationHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Java build phase complete!
Cython build phase complete!
Extension build phase complete!
building java2cpython library
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/java
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/andrei/.pyenv/versions/2.7.9/include/python2.7 -Ijava -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux -I/home/andrei/.pyenv/versions/2.7.9/include/python2.7 -c java/org_cellprofiler_javabridge_CPython.c -o build/temp.linux-x86_64-2.7/java/org_cellprofiler_javabridge_CPython.o
In file included from /home/andrei/.pyenv/versions/2.7.9/include/python2.7/Python.h:8:0,
                 from java/org_cellprofiler_javabridge_CPython.c:12:
/home/andrei/.pyenv/versions/2.7.9/include/python2.7/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from /usr/include/stdio.h:27:0,
                 from /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h:39,
                 from java/org_cellprofiler_javabridge_CPython.c:10:
/usr/include/features.h:230:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
java/org_cellprofiler_javabridge_CPython.c:85:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 static void check_init() {
             ^
gcc -pthread -shared -L/home/andrei/.pyenv/versions/2.7.9/lib -Wl,-rpath=/home/andrei/.pyenv/versions/2.7.9/lib build/temp.linux-x86_64-2.7/java/org_cellprofiler_javabridge_CPython.o -L/home/andrei/.pyenv/versions/2.7.9/lib -L/home/andrei/.pyenv/versions/2.7.9/lib -o build/lib.linux-x86_64-2.7/javabridge/jars/libjava2cpython.so
Java2Python build phase complete!
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/javabridge
copying build/lib.linux-x86_64-2.7/javabridge/_javabridge.so -> build/bdist.linux-x86_64/egg/javabridge
copying build/lib.linux-x86_64-2.7/javabridge/__init__.py -> build/bdist.linux-x86_64/egg/javabridge
copying build/lib.linux-x86_64-2.7/javabridge/noseplugin.py -> build/bdist.linux-x86_64/egg/javabridge
copying build/lib.linux-x86_64-2.7/javabridge/wrappers.py -> build/bdist.linux-x86_64/egg/javabridge
creating build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jars/rhino-1.7R4.jar -> build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jars/libjava2cpython.so -> build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jars/test.jar -> build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jars/runnablequeue.jar -> build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jars/cpython.jar -> build/bdist.linux-x86_64/egg/javabridge/jars
copying build/lib.linux-x86_64-2.7/javabridge/jutil.py -> build/bdist.linux-x86_64/egg/javabridge
copying build/lib.linux-x86_64-2.7/javabridge/locate.py -> build/bdist.linux-x86_64/egg/javabridge
byte-compiling build/bdist.linux-x86_64/egg/javabridge/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/javabridge/noseplugin.py to noseplugin.pyc
byte-compiling build/bdist.linux-x86_64/egg/javabridge/wrappers.py to wrappers.pyc
byte-compiling build/bdist.linux-x86_64/egg/javabridge/jutil.py to jutil.pyc
byte-compiling build/bdist.linux-x86_64/egg/javabridge/locate.py to locate.pyc
creating stub loader for javabridge/_javabridge.so
byte-compiling build/bdist.linux-x86_64/egg/javabridge/_javabridge.py to _javabridge.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying javabridge.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
javabridge.__init__: module references __file__
javabridge.jutil: module MAY be using inspect.stack
creating 'dist/javabridge-0.0.0-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
javabridge 0.0.0 is already the active version in easy-install.pth

Installed /home/andrei/.pyenv/versions/2.7.9/lib/python2.7/site-packages/javabridge-0.0.0-py2.7-linux-x86_64.egg
Processing dependencies for javabridge==0.0.0
Searching for numpy==1.9.1
Best match: numpy 1.9.1
Adding numpy 1.9.1 to easy-install.pth file

Using /home/andrei/.pyenv/versions/2.7.9/lib/python2.7/site-packages
Finished processing dependencies for javabridge==0.0.0

15:58:24-andrei~/src/python-javabridge-master$ python
Python 2.7.9 (default, Jan 20 2015, 14:05:44) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import javabridge
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "javabridge/__init__.py", line 28, in <module>
    from .jutil import start_vm, kill_vm, activate_awt, deactivate_awt
  File "javabridge/jutil.py", line 119, in <module>
    import _javabridge
ImportError: No module named _javabridge
@LeeKamentsky

This comment has been minimized.

Owner

LeeKamentsky commented Mar 19, 2015

I am not sure what the problem could be. Can you try a develop install?

python setup.py develop install

It looks like you're starting Python at the root of the git repository and perhaps it's expecting _javabridge.so to be in that directory tree. Also, you might try moving to your home directory and doing the import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment