Closed rekado closed 4 years ago
I'm looking now.
In the non-guix builds, it works as follows:
cogutil
, the cmake
command uses a bunch of macro files in $(srcdir)/cmake
to search for prereqs. cogutil
, the make install
step installs these into /usr/local/share/opencog/cmake/
atomspace
, the cmake
command uses the macro files in /usr/local/share/opencog/cmake/
as well as some new ones in $(srcdir)/cmake
.atomspace
, the make install
step installs the new, additional macro files into /usr/local/share/opencog/cmake/
attention
, ... the pattern should have repeated.I am currently imagining that the CMakefile for `attention has cut-n-paste errors in it.
I just pushed 86f0bfb2da3d4e9913e89edbe9c97700a6762bf9 but I am 99.9% sure that will not fix this problem.
Oh, I think I see ... the macro /usr/local/share/opencog/cmake/OpenCogMacros.cmake:MACRO(OPENCOG_ADD_ATOM_TYPES
is getting the dependency wrong. it should not have looked for a dependency in the source tree. let me fiddle with it.
Yes, I'm 95% certain that the core problem is this:
In /usr/local/share/opencog/cmake/OpenCogMacros.cmake
(which is mis-named, it should be called AtomSpaceMacros.cmake
, but that's for some future rainy day.) I see the following:
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/OpenCogAtomTypes.cmake)
SET(OC_ATOM_TYPES_PATH ${CMAKE_SOURCE_DIR}/cmake/OpenCogAtomTypes.cmake)
ELSE()
SET(OC_ATOM_TYPES_PATH ${DATADIR}/cmake/OpenCogAtomTypes.cmake)
ENDIF()
Clear, the IF
cannot be taken, so the ELSE
is taken. But what's $DATADIR
? Well, in attention/Cmakefile
I see this:
IF (NOT DEFINED DATADIR)
SET (DATADIR "${CMAKE_INSTALL_PREFIX}/share/opencog")
ENDIF (NOT DEFINED DATADIR)
which would resolve into /usr/local/share/opencog
and everything works.
I bet that in guix, that you have $DATADIR
set to .. the source directory.
I'm guessing that the correct fix is to modify OpenCogMacros.cmake
to not look at $DATADIR
and to instead just look at it's own install path. Let me see if I can figure out how to do that.
(Yes, all these IF
s are ugly .. people kind of come in and hack on things and it gets crufty after a while).
I am guessing that opencog/atomspace#2463 will fix this problem. It's not terribly elegant, but it seems to be in the spirit of the other path mangling being done. If you have a better fix, let me know; none of this is sacrosanct.
Thank you, this fixed the build of the Attention package.
I'm trying to build the latest commit (87d4367) of attention with the latest commits of cogutil (b07b41b2eaf01627c78b27f1f28bb09ef7086f8e), atomspace (ed1d316a44ddca5791712ebdc291770905a72f05), and cogserver (c8ad85fef446819e6bd711f0791887a5aa6a41f9). The build almost immediately aborts:
This line here:
shows that OpenCogAtomTypes.cmake, which is provided by atomspace is somehow expected to be found in the current project's target directory.
(Guix installs every package to its own prefix directory under
/gnu/store/...-name-version/
.)