Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-3584

Port Qserv to OS X/Clang

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None
    • Templates:
    • Team:
      Architecture

      Description

      Now that the Qserv dependencies work on OS X (DM-1662) this ticket details the issues that arise from attempting to build Qserv on OS X using the clang compiler.

      A preliminary investigation finds:

      • site_scons/state.py enables the -rpath-link linker option which is not supported on OS X.
      • -Wno-unused-local-typedefs is not supported by clang (see DM-869).
      • -pthread link option is ignored.
      • libqserv_css links against log4cxx but that library is not listed explicitly in core/modules/SConscript.
      • The python/swig bindings _cssLib.so do not link properly.

      Also clang issues a fatal compiler error from within core/modules/mysql/MySqlConnection.h:

      In file included from build/mysql/MySqlConnection.cc:29:
      build/mysql/MySqlConnection.h:73:23: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
            std::__1::allocator<char> >'
          const std::string getError() const { assert(_mysql); return std::string(mysql_error(_mysql)); }
                            ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:188:33: note: template is declared
            here
          class _LIBCPP_TYPE_VIS_ONLY basic_string;
                                      ^
      In file included from build/mysql/MySqlConnection.cc:29:
      build/mysql/MySqlConnection.h:73:65: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
            std::__1::allocator<char> >'
          const std::string getError() const { assert(_mysql); return std::string(mysql_error(_mysql)); }
                                                                      ^
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:188:33: note: template is declared
            here
          class _LIBCPP_TYPE_VIS_ONLY basic_string;
                                      ^
      

      Compiler warnings

      In file included from build/sql/statement.cc:32:
      build/sql/Schema.h:74:1: warning: 'Schema' defined as a struct here but previously declared as a class [-Wmismatched-tags]
      struct Schema {
      ^
      build/sql/statement.h:35:1: note: did you mean struct here?
      class Schema; // Forward
      ^~~~~
      

      build/mysql/MySqlConnection.cc:147:41: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
          std::string killSql = "KILL QUERY " + boost::lexical_cast<int>(threadId);
                                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      build/mysql/MySqlConnection.cc:147:41: note: use array indexing to silence this warning
          std::string killSql = "KILL QUERY " + boost::lexical_cast<int>(threadId);
                                              ^
                                &             [                                   ]
      

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  tjenness Tim Jenness
                  Reporter:
                  tjenness Tim Jenness
                  Reviewers:
                  Fritz Mueller
                  Watchers:
                  Andy Salnikov, Fritz Mueller, Jacek Becla, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel