Skip to content

Conversation

thiagogenez
Copy link

@thiagogenez thiagogenez commented Sep 17, 2020

Change the if-else-order to grab KYOTO dependencies fromCACTUS_DIR/include/

The original include.mk file grabs *.h files from Kyoto already installed in the system (i.e., at /usr/local/include/) instead of grabbing the *.h files (registered by pkg-config during Cactus compilation) provided at CACTUS_DIR/include/.

Change the if-order to grab KYOTO dependencies from userspace (e.g. when installed using brew).
@glennhickey
Copy link
Contributor

Are you having troubles with the cactus submodule kyoto? I'm worried about using other versions as our version does contain some small changes, and it's the one we test with. Obviously if it doesn't work, being able to use your own is better than nothing, though, so this seems okay to me. @diekhans do you mind taking a look?

@thiagogenez
Copy link
Author

thiagogenez commented Sep 18, 2020

I had no troubles using Kyoto actually while running Cactus. Just to let you know, I ended up installing both kyoto-tycoon and kyoto-cabinet using the source indicated by (Linux)brew. Following the build from scratch documentation, I was not clear to me to install this version of kyoto. Anyway, as I don't have root access, I cannot install Kyoto at /usr/local, but only somewhere at $HOME; where this patch aims to look for Kyoto as its first option. Please let me know if this patch makes sense.

Anyway, many thanks @glennhickey and @diekhans for checking this issue.

@diekhans
Copy link
Contributor

diekhans commented Sep 18, 2020 via email

@thiagogenez
Copy link
Author

thiagogenez commented Sep 21, 2020

Hi Mark,

Sorry for the late reply. I was trying compiling Cactus many times, but no success so far when using the kyoto-tycoon and kyoto-cabinet in the Cactus submodule folder. Please find the errors below. I have downgraded the hdf5 from version 1.12 to 1.10.1 (from here) to avoid dependency version conflicts.

The error occurs at the moment make command Entering directory /home/user/cactus/latest/cactus/submodules/sonLib/C'

Any ideas what is the problem?

Cheers, Thiago

Output when export CXX_ABI_DEF=-D_GLIBCXX_USE_CXX11_ABI=1:

make suball1
make[1]: Entering directory /home/user/cactus/latest/cactus' cd submodules/kyoto && make PREFIX=/home/user/cactus/latest/cactus make[2]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto'
make -j4 -C kyotocabinet
make[3]: Entering directory `/home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet'
make[3]: warning: -jN forced in submake: disabling jobserver mode.

#================================================================

Ready to install.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet' grep -q '^CPPFLAGS.*-D_KCDEBUG' kyotocabinet/Makefile || make -j4 -C kyotocabinet strip make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
strip kcutiltest kcutilmgr kcprototest kcstashtest kccachetest kcgrasstest kchashtest kchashmgr kctreetest kctreemgr kcdirtest kcdirmgr kcforesttest kcforestmgr kcpolytest kcpolymgr kclangctest
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet' make -j4 -C kyototycoon make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon'
make[3]: warning: -jN forced in submake: disabling jobserver mode.

#================================================================

Ready to install.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon' grep -q '^CPPFLAGS.*-D_KCDEBUG' kyotocabinet/Makefile || make -j4 -C kyototycoon strip make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
strip ktutiltest ktutilmgr ktutilserv kttimedtest kttimedmgr ktserver ktremotetest ktremotemgr
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon' make[2]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto'
cd submodules/kyoto && make PREFIX=/home/user/cactus/latest/cactus install
make[2]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto' make -j4 -C kyotocabinet make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet'
make[3]: warning: -jN forced in submake: disabling jobserver mode.

#================================================================

Ready to install.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet' grep -q '^CPPFLAGS.*-D_KCDEBUG' kyotocabinet/Makefile || make -j4 -C kyotocabinet strip make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
strip kcutiltest kcutilmgr kcprototest kcstashtest kccachetest kcgrasstest kchashtest kchashmgr kctreetest kctreemgr kcdirtest kcdirmgr kcforesttest kcforestmgr kcpolytest kcpolymgr kclangctest
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet' make -j4 -C kyototycoon make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon'
make[3]: warning: -jN forced in submake: disabling jobserver mode.

#================================================================

Ready to install.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon' grep -q '^CPPFLAGS.*-D_KCDEBUG' kyotocabinet/Makefile || make -j4 -C kyototycoon strip make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
strip ktutiltest ktutilmgr ktutilserv kttimedtest kttimedmgr ktserver ktremotetest ktremotemgr
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon' make -j4 -C kyotocabinet install DESTDIR="" make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
mkdir -p /home/user/cactus/latest/cactus/include
cp -Rf kccommon.h kcutil.h kcthread.h kcfile.h kccompress.h kccompare.h kcmap.h kcregex.h kcdb.h kcplantdb.h kcprotodb.h kcstashdb.h kccachedb.h kchashdb.h kcdirdb.h kctextdb.h kcpolydb.h kcdbext.h kclangc.h /home/user/cactus/latest/cactus/include
mkdir -p /home/user/cactus/latest/cactus/lib
cp -Rf libkyotocabinet.a /home/user/cactus/latest/cactus/lib
mkdir -p /home/user/cactus/latest/cactus/bin
cp -Rf kcutiltest kcutilmgr kcprototest kcstashtest kccachetest kcgrasstest kchashtest kchashmgr kctreetest kctreemgr kcdirtest kcdirmgr kcforesttest kcforestmgr kcpolytest kcpolymgr kclangctest /home/user/cactus/latest/cactus/bin
mkdir -p /home/user/cactus/latest/cactus/share/man/man1
cd man && cp -Rf kcutiltest.1 kcutilmgr.1 kcprototest.1 kcstashtest.1 kccachetest.1 kcgrasstest.1 kchashtest.1 kchashmgr.1 kctreetest.1 kctreemgr.1 kcdirtest.1 kcdirmgr.1 kcforesttest.1 kcforestmgr.1 kcpolytest.1 kcpolymgr.1 kclangctest.1 /home/user/cactus/latest/cactus/share/man/man1
mkdir -p /home/user/cactus/latest/cactus/share/doc/kyotocabinet
cp -Rf COPYING FOSSEXCEPTION ChangeLog doc kyotocabinet.idl /home/user/cactus/latest/cactus/share/doc/kyotocabinet
mkdir -p /home/user/cactus/latest/cactus/lib/pkgconfig
cp -Rf kyotocabinet.pc /home/user/cactus/latest/cactus/lib/pkgconfig

#================================================================

Thanks for using Kyoto Cabinet.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyotocabinet' make -j4 -C kyototycoon install DESTDIR="" make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon'
make[3]: warning: -jN forced in submake: disabling jobserver mode.
mkdir -p /home/user/cactus/latest/cactus/include
cp -Rf ktcommon.h ktutil.h ktsocket.h ktthserv.h kthttp.h ktrpc.h ktulog.h ktshlib.h kttimeddb.h ktdbext.h ktremotedb.h ktplugserv.h ktplugdb.h /home/user/cactus/latest/cactus/include
mkdir -p /home/user/cactus/latest/cactus/lib
cp -Rf libkyototycoon.a /home/user/cactus/latest/cactus/lib
mkdir -p /home/user/cactus/latest/cactus/libexec
if [ -n "" ] ; then cp -Rf /home/user/cactus/latest/cactus/libexec ; fi
mkdir -p /home/user/cactus/latest/cactus/bin
cp -Rf ktutiltest ktutilmgr ktutilserv kttimedtest kttimedmgr ktserver ktremotetest ktremotemgr /home/user/cactus/latest/cactus/bin
mkdir -p /home/user/cactus/latest/cactus/share/man/man1
cd man && cp -Rf ktutiltest.1 ktutilmgr.1 ktutilserv.1 kttimedtest.1 kttimedmgr.1 ktserver.1 ktremotetest.1 ktremotemgr.1 /home/user/cactus/latest/cactus/share/man/man1
mkdir -p /home/user/cactus/latest/cactus/share/doc/kyototycoon
cp -Rf COPYING ChangeLog doc kyototycoon.idl /home/user/cactus/latest/cactus/share/doc/kyototycoon
mkdir -p /home/user/cactus/latest/cactus/lib/pkgconfig
cp -Rf kyototycoon.pc /home/user/cactus/latest/cactus/lib/pkgconfig

#================================================================

Thanks for using Kyoto Tycoon.

#================================================================
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto/kyototycoon' make[2]: Leaving directory /home/user/cactus/latest/cactus/submodules/kyoto'
cd submodules/sonLib && PKG_CONFIG_PATH=/home/user/cactus/latest/cactus/lib/pkgconfig: make
make[2]: Entering directory /home/user/cactus/latest/cactus/submodules/sonLib' cd externalTools && make all make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools'
cd cutest && make all
cd quicktree_1.1 && make all CC="cc"
make[4]: Entering directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools/quicktree_1.1' make[4]: Nothing to be done for all'.
make[4]: Leaving directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools/quicktree_1.1' make[4]: Entering directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools/cutest'
make[4]: Nothing to be done for all'. make[4]: Leaving directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools/cutest'
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/sonLib/externalTools' cd C && make all make[3]: Entering directory /home/user/cactus/latest/cactus/submodules/sonLib/C'
cc -Iinc -Iimpl -I/usr/local/include -DHAVE_KYOTO_TYCOON=1 -I../externalTools/quicktree_1.1/include/ -I ../externalTools/cutest -std=c99 -fPIC -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG -I tests -o ../../sonLib/bin/sonLib_kvDatabaseTest tests/kvDatabaseTest.c tests/kvDatabaseTestCommon.c ../../sonLib/lib/sonLib.a ../../sonLib/lib/cuTest.a -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lkyototycoon -lkyotocabinet -lz -lbz2 -lpthread -lm -lstdc++ -lz -lm ../../sonLib/lib/sonLib.a -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lkyototycoon -lkyotocabinet -lz -lbz2 -lpthread -lm -lstdc++ -lz -lm -lm
/home/user/thiagogenez/.linuxbrew/bin/ld: ../../sonLib/lib/sonLib.a(sonLibKVDatabase_KyotoTycoon.o): in function kyototycoon::HTTPClient::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double)': /usr/local/include/kthttp.h:401: undefined reference to kyototycoon::Socket::get_local_host_nameabi:cxx11'
/home/user/thiagogenez/.linuxbrew/bin/ld: /usr/local/include/kthttp.h:402: undefined reference to kyototycoon::Socket::get_host_address(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/user/thiagogenez/.linuxbrew/bin/ld: /usr/local/include/kthttp.h:407: undefined reference to kyototycoon::Socket::open(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/home/user/thiagogenez/.linuxbrew/bin/ld: ../../sonLib/lib/sonLib.a(sonLibKVDatabase_KyotoTycoon.o): in function kyototycoon::HTTPClient::fetch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, kyototycoon::HTTPClient::Method, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const*)': /usr/local/include/kthttp.h:482: undefined reference to kyototycoon::Socket::send(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make[3]: *** [../../sonLib/bin/sonLib_kvDatabaseTest] Error 1
make[3]: Leaving directory /home/user/cactus/latest/cactus/submodules/sonLib/C' make[2]: *** [cP] Error 2 make[2]: Leaving directory /home/user/cactus/latest/cactus/submodules/sonLib'
make[1]: *** [suball.sonLib] Error 2
make[1]: Leaving directory `/home/user/cactus/latest/cactus'
make: *** [all] Error 2

@thiagogenez
Copy link
Author

thiagogenez commented Sep 21, 2020

Problem solved with my proposed patch. Basically, the original code include.mk file grabs *.h files from an old version of Kyoto, ignoring the *.h files provided by the brand new Kyoto compiled previously (and registered by pkg-config at CACTUS_DIR/include/ instead of at /usr/local/include/ ).

Find below the Cactus installation using linuxbrew:

  • Dependencies:
  • brew install hdf5 pkg-config lzo
  • Clone cactus repository:
  • Before make cactus:
  • export CPATH=".:${HOME}/.linuxbrew/include"
  • export LIBRARY_PATH=".:${HOME}/.linuxbrew/lib"
  • export LD_LIBRARY_PATH=".:${HOME}/.linuxbrew/lib/$LD_LIBRARY_PATH"
  • export PKG_CONFIG_PATH=".:${HOME}/.linuxbrew/lib/pkgconfig/$PKG_CONFIG_PATH"
  • export CXX_ABI_DEF=-D_GLIBCXX_USE_CXX11_ABI=1
  • Make Cactus
  • make -j $(nproc)

@diekhans
Copy link
Contributor

diekhans commented Sep 21, 2020 via email

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants