1

I am installing DBD::Sybase

I receive following error, after setting

export SYBASE=/usr/local/Cellar/freetds/0.95.80

and download freetds:

brew install freetds

Error:

Configuring DBD-Sybase-1.15 ... Can't find any Sybase libraries in /usr/local/Cellar/freetds/0.95.80/lib or /usr/local/Cellar/freetds/0.95.80/lib64 at Makefile.PL line 155, <IN> line 44

I believe I need to edit the makefile directly. Do I need to edit makefile? And could I use CPANM still. CPANM is under Brew (cellar).

/usr/local/Cellar/freetds/0.95.80/lib
├── libct.4.dylib
├── libct.a
├── libct.dylib -> libct.4.dylib
├── libsybdb.5.dylib
├── libsybdb.a
└── libsybdb.dylib -> libsybdb.5.dylib


 /usr/local/Cellar/freetds/0.95.80/
AUTHORS              ChangeLog            NEWS                 TODO                 etc                  lib
COPYING              INSTALL_RECEIPT.json README               bin                  include              share
bfontaine
  • 18,169
  • 13
  • 73
  • 107
paulj
  • 327
  • 1
  • 9

1 Answers1

2

There is a reported bug in DBD::Sybase on OS X which is causing your problem.

One part of the configuration thinks you're on Windows. Perl reports OS X as darwin and DBD::Sybase is checking for /win/ as in MSWin32 or maybe cygwin. As a result it looks for a dll directory, but falsely reports it's looking for lib and lib64.

The quick fix is to use cpanm --prompt DBD::Sybase. When it fails, cpanm will ask what to do.

Configuring DBD-Sybase failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s]

Tell it to l)ook. This will dump you into a shell with the unpacked source for DBD::Sybase. Use an editor to delete lines 143-145 in the Makefile.PL.

if ($^O =~ /win/i) {
  @libdir = ( 'dll' );
}

Then exit the shell. cpanm will ask you what to do again, tell it to r)etry. It should use your edited Makefile.PL.

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • That's the part I am unsure. So cpanm gets the files, and then after change what command would I run with new makefile? cpanm? and point to directory? – paulj Nov 17 '16 at 18:08
  • @paulj Don't touch the Makefile, that is generated by Makefile.PL. I've edited full instructions into the answer – Schwern Nov 17 '16 at 18:14
  • It works to a point. So answer accepted. Wondering any way of skipping tests: The DBD::Sybase module need access to a Sybase server to run the tests, because they fail on test ms-sql-server. – paulj Nov 18 '16 at 20:10
  • For anyone else, I choose force install after tests failed. My perl dbi is running. – paulj Nov 18 '16 at 20:15
  • @paulj If you run `perldoc cpanm` for its docs you'll find `--notest`. If you want to connect to a MS SQL Server, you're probably better off with DBD::ODBC. – Schwern Nov 18 '16 at 21:25