opencog / cogserver

Distributed AtomSpace Network Server
Other
16 stars 23 forks source link

CythonServer test fails libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb #27

Closed vsbogd closed 4 years ago

vsbogd commented 4 years ago

CythonServer test fails because libtruthvalue.so uses EvaluationLink::do_evaluation method but doesn't depend on libexecution.so. See https://github.com/opencog/atomspace/commit/5b1642d8edb869c3d21182b40859f23a78035204

5/6 Test #5: CythonServer .....................***Failed    0.32 sec
Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb) ... ERROR

======================================================================
ERROR: Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 417, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/ws/cogserver/tests/cython/server/test_agent_finder.py", line 3, in <module>
    from opencog.agent_finder import find_subclasses
ImportError: /usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb

----------------------------------------------------------------------
Ran 1 test in 0.013s

FAILED (errors=1)
vsbogd commented 4 years ago

Adding dependency of truthvalue on execution introduces cyclic dependency, see https://github.com/opencog/atomspace/issues/2689

linas commented 4 years ago

Hmm. Odd. I does not fail for me. .. and it seems to work in circle-ci. So something about your system is different. Still ... the CMakefile says

TARGET_LINK_LIBRARIES(cogserver_cython
   server
   ${ATOMSPACE_LIBRARIES}
   ${COGUTIL_LIBRARY}
   ${PYTHON_LIBRARIES}
)

where ${ATOMSPACE_LIBRARIES} is defined in lib/AtomSpaceConfig.cmake.in

It seems unlikely, but what happens if you add

set_property(TARGET truthvalue
   APPEND PROPERTY INTERFACE_LINK_LIBRARIES
   execution
)
vsbogd commented 4 years ago
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "atombase" of type SHARED_LIBRARY
    depends on "execution" (weak)
    depends on "clearbox" (weak)
    depends on "atomcore" (weak)
    depends on "atomflow" (weak)
  "atomcore" of type SHARED_LIBRARY
    depends on "atombase" (weak)
    depends on "execution" (weak)
    depends on "clearbox" (weak)
    depends on "atomflow" (weak)
  "atomflow" of type SHARED_LIBRARY
    depends on "atomcore" (weak)
    depends on "atombase" (weak)
    depends on "execution" (weak)
    depends on "clearbox" (weak)
  "execution" of type SHARED_LIBRARY
    depends on "clearbox" (weak)
    depends on "atomcore" (weak)
    depends on "atombase" (weak)
    depends on "atomflow" (weak)
  "clearbox" of type SHARED_LIBRARY
    depends on "atomcore" (weak)
    depends on "atombase" (weak)
    depends on "execution" (weak)
    depends on "atomflow" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed.  Build files cannot be regenerated correctly.
linas commented 4 years ago

I understand what the circular dependencies look like. If you look for them you will find at least half a dozen of them, if not a dozen. They're all over the place, and they are very hard to get rid of. This problem is older than the github repo, its older than the bzr repo we used before that.

linas commented 4 years ago

Best suggestion is to try the SET_PROPERTY and see if that solves it.

linas commented 4 years ago

Closing, because I think opencog/atomspace#2738 fixed the underlying issue