Problem Building JANA on CentOS 7 with CCDB 2

Build complains about missing sqlite library and missing fmt library.

Linking    [.Linux_CentOS7-x86_64-gcc4.8.5-cntr/unit_tests/associated_objects/associated_objects]
/data/scratch/gluex_top_c7/ccdb/ccdb/lib/libccdb.a(SQLiteDataProvider.cc.o): In function `ccdb::SQLiteDataProvider::Connect(std::string const&)':
SQLiteDataProvider.cc:(.text+0x31e): undefined reference to `sqlite3_open_v2'
SQLiteDataProvider.cc:(.text+0x34d): undefined reference to `sqlite3_errmsg'
SQLiteDataProvider.cc:(.text+0x44b): undefined reference to `sqlite3_exec'
.
.
.
/data/scratch/gluex_top_c7/ccdb/ccdb/lib/libccdb.a(SQLiteDataProvider.cc.o): In function `std::make_unsigned<long>::type fmt::v6::internal::to_unsigned<long>(long)':
SQLiteDataProvider.cc:(.text._ZN3fmt2v68internal11to_unsignedIlEENSt13make_unsignedIT_E4typeES4_[_ZN3fmt2v68internal11to_unsignedIlEENSt13make_unsignedIT_E4typeES4_]+0x27): undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'

sqlite and fmt comes in in a patch and that patch is only applied if python3 is being used. That is not the case for CentOS 7.

  • sqlite and fmt added into sbms.py.patch in v2.31 of build scripts
    • sqlite is needed since it is not longer a part of ccdb[?]
  • test for python3 in Makefile_jana introduced in transition from v 1.59 to 2.0. patches/jana/sbms.py.patch does not exist before v2.0
  • sbms.py.patch is unchanged from v2.0 to v2.30
  • go to a scheme where there are two patches to sbms.py, one if python3 is being used, and a second if ccdb 2 is being used. See this pull request.

Further Notes on CCDB 2

  • on markdesk5, Fedora 35
  • using build scripts branch jeffersonlab/ccdb-2.00
  • using ccdb branch jeffersonlab/v2-main
  • running make -f Makefile_ccdb gives the following error:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindSQLite3.cmake:54 (find_package_handle_standard_args)
  src/CCDB/CMakeLists.txt:16 (find_package)

  • If you look at /usr/share/cmake/Modules/FindSQLite3.cmake you see that it keys off of the cmake variables SQLite3_INCLUDE_DIR and SQLite3_LIBRARY.
  • Invoking cmake by hand with the following syntax:
cmake -DSQLite3_INCLUDE_DIR=/data/gluex/gluex_top/sqlite/sqlite-3.36.0/include \
    -DSQLite3_LIBRARY=/data/gluex/gluex_top/sqlite/sqlite-3.36.0/lib ..
  • …gets past the error. The error now is:
CMake Error at src/fmt/CMakeLists.txt:194 (add_library):
  Cannot find source file:

    include/fmt/os.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


CMake Error at src/fmt/CMakeLists.txt:194 (add_library):
  No SOURCES given to target: fmt

  • Installing fmt-devel does not fix it. Installing it was referenced in a previous post.
  • Fixed by by-passing fmt as a target library in cmake system. Then system drops back to using installed rpm fmt-devel.
  • Does not compile on Fedora 35. The error is
[ 60%] Building CXX object src/tests/CMakeFiles/CCDB_tests.dir/tests.cc.o
cd /home/marki/ccdb2/ccdb/cpp/build/src/tests && /usr/bin/c++  -I/home/marki/ccdb2/ccdb/cpp/src -I/data/gluex/gluex_top/sqlite/sqlite-3.36.0/include -std=c++11 -MD -MT src/tests/CMakeFiles/CCDB_tests.dir/tests.cc.o -MF CMakeFiles/CCDB_tests.dir/tests.cc.o.d -o CMakeFiles/CCDB_tests.dir/tests.cc.o -c /home/marki/ccdb2/ccdb/cpp/src/tests/tests.cc
In file included from /usr/include/signal.h:328,
                 from /home/marki/ccdb2/ccdb/cpp/src/tests/catch.hpp:6117,
                 from /home/marki/ccdb2/ccdb/cpp/src/tests/tests.cc:13:
/home/marki/ccdb2/ccdb/cpp/src/tests/catch.hpp:8743:54: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
 8743 | constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                      ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /home/marki/ccdb2/ccdb/cpp/src/tests/catch.hpp:6117,
                 from /home/marki/ccdb2/ccdb/cpp/src/tests/tests.cc:13:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /home/marki/ccdb2/ccdb/cpp/src/tests/tests.cc:13:
/home/marki/ccdb2/ccdb/cpp/src/tests/catch.hpp:8802:41: error: size of array ‘altStackMem’ is not an integral constant-expression
 8802 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                         ^~~~~~~~~~~~
make[3]: *** [src/tests/CMakeFiles/CCDB_tests.dir/build.make:76: src/tests/CMakeFiles/CCDB_tests.dir/tests.cc.o] Error 1
make[3]: Leaving directory '/home/marki/ccdb2/ccdb/cpp/build'
make[2]: *** [CMakeFiles/Makefile2:142: src/tests/CMakeFiles/CCDB_tests.dir/all] Error 2
make[2]: Leaving directory '/home/marki/ccdb2/ccdb/cpp/build'
make[1]: *** [Makefile:136: all] Error 2
make[1]: Leaving directory '/home/marki/ccdb2/ccdb/cpp/build'
make: *** [build_scripts/Makefile_ccdb:81: ccdb/.make_done] Error 2

  • Got a working version in CentOS 7 container. Needed to add fmt-devel to the prerequisite script. The branch is markito3/v2-build-fixes. Submitted a pull prequest to JLab repo.
  • Saved working version in google drive: documents_work/saved_work/save_ccdb2_2021-12-22.tar.gz
  • build scripts working version on markito3/build_v2_on_centos7, pull request created on jlab repo, merged, branch deleted. upshot jlab master should work
  • Upgrading catch.hpp allows building on Fedora 35. See Pull Request #86.