megbedell / wobble

precise data-driven RV fitting, now with tellurics!
https://wobble.readthedocs.io
MIT License
39 stars 16 forks source link

Symbol not found: __ZN10tensorflow12OpDefBuilder4AttrESs #66

Closed jkteske closed 5 years ago

jkteske commented 5 years ago

Installation of wobble proceeded without major errors, although there were some warnings, including this one:

g++ -bundle -undefined dynamic_lookup -L/Users/jteske/anaconda/envs/python3/lib -arch x86_64 -L/Users/jteske/anaconda/envs/python3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/wobble/interp/interp_op.o build/temp.macosx-10.7-x86_64-3.6/wobble/interp/interp_rev_op.o -o build/lib.macosx-10.7-x86_64-3.6/wobble/interp/interp_op.cpython-36m-darwin.so -L/Users/jteske/anaconda/envs/python3/lib/python3.6/site-packages/tensorflow -ltensorflow_framework ld: warning: ld: warning: object file (build/temp.macosx-10.7-x86_64-3.6/wobble/interp/interp_rev_op.o) was built for newer OSX version (10.9) than being linked (10.7)object file (build/temp.macosx-10.7-x86_64-3.6/wobble/interp/interp_op.o) was built for newer OSX version (10.9) than being linked (10.7) copying build/lib.macosx-10.7-x86_64-3.6/wobble/interp/interp_op.cpython-36m-darwin.so -> wobble/interp Creating /Users/jteske/anaconda/envs/python3/lib/python3.6/site-packages/wobble.egg-link (link to .)

I tried

rm -rf build; python setup.py develop

but get the same warning.

Okay, I figured I would see if the demo notebook worked. The following error comes up when importing wobble:

NotFoundError Traceback (most recent call last)

in 1 import numpy as np 2 import matplotlib.pyplot as plt ----> 3 import wobble ~/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/__init__.py in 1 name = "wobble" 2 from .utils import bin_data, get_session, doppler, fit_continuum ----> 3 from .interp import interp 4 from .data import Data 5 from .results import Results ~/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/interp/__init__.py in 8 from ..tf_utils import load_op_library 9 ---> 10 mod = load_op_library(__file__, "interp_op") 11 # searchsorted = mod.searchsorted 12 ~/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/tf_utils.py in load_op_library(module_file, name) 18 else: 19 libfile += ".so" ---> 20 return tf.load_op_library(libfile) ~/anaconda/envs/python3/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename) 58 RuntimeError: when unable to load the library or get the python wrappers. 59 """ ---> 60 lib_handle = py_tf.TF_LoadLibrary(library_filename) 61 62 op_list_str = py_tf.TF_GetOpList(lib_handle) NotFoundError: dlopen(/Users/jteske/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/interp/interp_op.cpython-36m-darwin.so, 6): Symbol not found: __ZN10tensorflow12OpDefBuilder4AttrESs Referenced from: /Users/jteske/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/interp/interp_op.cpython-36m-darwin.so Expected in: flat namespace in /Users/jteske/anaconda/envs/python3/lib/python3.6/site-packages/wobble/wobble/interp/interp_op.cpython-36m-darwin.so
jkteske commented 5 years ago

P.S. Here is the full output from trying to install on my laptop. wobble_error.txt

jkteske commented 5 years ago

UPDATE:

The problem was tied to the compiler. The solution was:

  1. Make a clean environment and install wobble (instructions below)

$ conda create -n wobble matplotlib tensorflow tqdm $ conda activate wobble $ cd wobble $ rm -rf build $ python setup.py develop

Although this never hurts, I don’t think this was the root problem, so probably not needed.

  1. Check the compiler

This was the real problem. I had to use the MacOS system compiler:

export CC=/usr/bin/gcc or setenv CC /usr/bin/gcc

megbedell commented 5 years ago

Ok excellent, I'll close this issue - glad you figured it out!