Homebrew (Error: sqliteodbc: no bottle available!)

Viewed 36

I'm trying to install an ODBC sqlite driver using the terminal command sqliteodbc. I'm running on a Macbook Pro with: Apple M1 and macOS Monterey. I've tried uninstalling and reinstalling homebrew.

After running that command, I receive the following error:

Error: sqliteodbc: no bottle available!
You can try to install from source with:
  brew install --build-from-source sqliteodbc
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
1 Answers

The error tells you that there is no arm64 bottle (a.k.a. pre-compiled binary) for sqliteodbc.

You can try to compile it yourself with:

brew install --build-from-source sqliteodbc

But you will obtain an error:

checking build system type... configure: error: /bin/sh ./config.sub -apple-darwin21.6.0 failed

Some work is needed to build sqliteodbc on arm64 macOS.

What you can do is using Rosetta2 (a dynamic binary translator from x86_64 to arm64). Install it with:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

Then you can install the x86_64 version of Homebrew with:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Create an alias in your .zshrc with:

echo 'alias brew86="arch -x86_64 /usr/local/homebrew/bin/brew"' >> ~/.zshrc

Note that x86_64-Homebrew and arm64-Homebrew are installed in different locations:

% brew --prefix
/opt/homebrew

% brew86 --prefix
/usr/local/homebrew

You can install the x86_64 version of sqliteodbc with:

brew86 install sqliteodbc

You have now a x86_64 installation of sqliteodbc:

% brew86 info sqliteodbc
==> sqliteodbc: stable 0.9998 (bottled)
ODBC driver for SQLite
https://ch-werner.homepage.t-online.de/sqliteodbc/
/usr/local/homebrew/Cellar/sqliteodbc/0.9998 (24 files, 704.2KB) *

You can check that it's really x86_64 with the file utility:

% file /usr/local/homebrew/Cellar/sqliteodbc/0.9998/lib/libsqlite3odbc-0.9998.dylib
/usr/local/homebrew/Cellar/sqliteodbc/0.9998/lib/libsqlite3odbc-0.9998.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Beware of the influence of environment variables: HOMEBREW_PREFIX, HOMEBREW_CELLAR, HOMEBREW_REPOSITORY, PATH, MANPATH, and INFOPATH. You can export the right values with eval "$(brew shellenv)" or eval "$(brew86 shellenv)".

Related