问题
I'm trying to compile Erlang on FreeBSD, and I want to include the odbc licenses.
On Ubuntu, if you add the unixodbc-dev package, that ensures that odbc gets compiled with Erlang, however, I can't find a package that works equivalently with FreeBSD.
I've tried installing the unixODBC package, and the libodbc++ with libiodbc packages. Neither of these work.
I've also tried download unixodbc from unixodbc.org and installing that, to no avail.
So if there's a package I can use, or if there's something I should download from source and compile, I've so far been unsuccessful in finding the solution.
Any ideas on what packages need to be installed or what steps need to be taken to ensure ODBC gets compiled with Erlang?
Note: this is with FreeBSD 9.1-Release, and Erlang R16B02
回答1:
From looking at the package file list, unixODBC
should be the correct package.
Look inside lib/odbc/config.log
from where you compiled Erlang. Mine says (on Debian):
configure:4913: checking for odbc in standard locations
configure:4939: result: -L/usr/lib
The "standard locations" are /usr/local/odbc /usr/local /usr/odbc /usr /opt/local/pgm/odbc /usr/local/pgm/odbc
, and the configure script looks for include/sql.h
below one of those directories. If yours is installed in a different directory, try specifying --with-odbc=/some/path
to the configure script.
回答2:
Erlang can use unixODBC or libiodbc.
It should work when you install Erlang from ports. First, make sure your ports tree is up to date, e.g. with portsnap
.
Login or su
to root. Then go to /usr/ports/lang/erlang
, and run make config
. You should then see the following screen:
┌─────────────────────────── erlang-15.b.03.1_1,3 ─────────────────────────────┐
│ ┌──────────────────────────────────────────────────────────────────────────┐ │
│ │+[x] DOCS Build and/or install documentation │ │
│ │+[ ] DTRACE Enable DTrace support (experimental) │ │
│ │+[ ] GCC Use current GCC │ │
│ │+[ ] GS Enable GS application (deprecated) │ │
│ │+[ ] HIPE Build native HiPE compiler │ │
│ │+[ ] JAVA Java platform support │ │
│ │+[x] KQUEUE Enable Kernel Poll (kqueue) support │ │
│ │+[ ] ODBC ODBC backend │ │
│ │+[x] OPENSSL SSL/TLS support via OpenSSL │ │
│ │+[x] SCTP Enable SCTP support │ │
│ │+[x] SMP Enable SMP support │ │
│ │+[x] THREADS Threading support │ │
│ │+[ ] WX Enable WX application │ │
│ │─────────────────────────────── ODBC backend ─────────────────────────────│ │
│ │+( ) IODBC ODBC backend via iODBC │ │
│ │+( ) UNIXODBC ODBC backend via unixODBC │ │
│ └──────────────────────────────────────────────────────────────────────────┘ │
├──────────────────────────────────────────────────────────────────────────────┤
│ < OK > <Cancel> │
└──────────────────────────────────────────────────────────────────────────────┘
Select either the IOBDC or the UNIXODBC option. Then run the command make install clean
as root. That should build and install Erlang and all its dependencies.
Edit: if you don't want to use ports, make sure you have either databases/unixODBC
or databases/libiodbc
installed before compiling erlang, and then use the --with-odbc
option with erlang's configure
, it should work fine. That is what the port does.
来源:https://stackoverflow.com/questions/19149714/freebsd-equivalent-to-unixodbc-dev