Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-299

FindIconv.cmake too old to work on MacOS 11 (Big Sur)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.11
    • 3.1.14
    • General
    • MacOS 11.1
      Xcode 12.3

    Description

      When building for homebrew:

      $ cmake . -DMARIADB_LINK_DYNAMIC=1 -DWITH_SSL=OPENSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 -DWITH_IODBC=0 -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mariadb-connector-odbc/3.1.11 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
       
      [...]
      -- Found ODBC Driver Manager libraries: /usr/local/Cellar/unixodbc/2.3.9/lib
      CMake Error at CMakeLists.txt:263 (MESSAGE):
        iconv was not found
      

      This is probably related to MacOS 11's weird way of handling system libraries. Basically the standard libraries like /usr/lib/libiconv.dylib are no longer present on the filesystem but you can link to them.

      Most likely you just need to import a newer version of FindIconv.cmake since I'm pretty sure cmake itself can find the package no problem. You seem to have a "frozen in amber" copy of that file.

      As a workaround to get homebrew building I am doing this:

      @ Formula/mariadb-connector-odbc.rb:26 @ class MariadbConnectorOdbc < Formula
                               "-DWITH_SSL=OPENSSL",
                               "-DOPENSSL_ROOT_DIR=#{Formula["openssl@1.1"].opt_prefix}",
                               "-DWITH_IODBC=0",
                               # Workaround 3.1.11 issues finding system's built-in -liconv
                               "-DICONV_LIBRARIES=" + MacOS.sdk_path + "/usr/lib/libiconv.tbd",
                               "-DICONV_INCLUDE_DIR=/usr/include",
                               *std_cmake_args
      

      see https://github.com/Homebrew/homebrew-core/pull/67348

      The ".tbd" files are the linker information for that library. You don't need to pass that to the compiler (just "-liconv" will do) but I needed to find some filename to pass in as the library location so that FindIconv.cmake would be satisfied that it "found" it

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            mitchblank Mitchell Blank Jr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.