1

I'm trying to add DBI to perl using the command: perl -MCPAN -e 'install DBI'. However, I'm getting the error that's in the title of this post. I'm not sure how much of the overall output to include but here's the latter portion:

Running Mkbootstrap for DBI ()
chmod 644 "DBI.bs"
"/Users/philipjoss/opt/miniconda3/envs/capra/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DBI.bs blib/arch/auto/DBI/DBI.bs 644
"/Users/philipjoss/opt/miniconda3/envs/capra/bin/perl" -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi
"/Users/philipjoss/opt/miniconda3/envs/capra/bin/perl" "/Users/philipjoss/opt/miniconda3/envs/capra/lib/5.26.2/ExtUtils/xsubpp"  -typemap '/Users/philipjoss/opt/miniconda3/envs/capra/lib/5.26.2/ExtUtils/typemap' -typemap '/Users/philipjoss/.cpan/build/DBI-1.643-6/typemap'  Perl.xs > Perl.xsc
mv Perl.xsc Perl.c
x86_64-apple-darwin13.4.0-clang -c   -fno-common -DPERL_DARWIN -no-cpp-precomp -mmacosx-version-min=10.9 -fno-strict-aliasing -pipe -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -O3   -DVERSION=\"1.643\" -DXS_VERSION=\"1.643\" -fPIC --sysroot=/opt/MacOSX10.9.sdk "-I/Users/philipjoss/opt/miniconda3/envs/capra/lib/5.26.2/darwin-thread-multi-2level/CORE"  -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c
/bin/sh: x86_64-apple-darwin13.4.0-clang: command not found
make: *** [Perl.o] Error 127
  TIMB/DBI-1.643.tar.gz
  /usr/bin/make -- NOT OK

MacOS is 11.5.2. Perl is 5.26.2.

Could someone point me in the right direction to fix this? I've tried googling but there doesn't seem to be much out there. I also don't use perl other than to run a script that requires DBI to be installed so I'm stumped :-(

Jossy
  • 589
  • 2
  • 12
  • 36
  • 3
    You probably need to install `clang` using `conda`, see [this](https://stackoverflow.com/q/47314899/2173773) question – Håkon Hægland Sep 08 '21 at 10:56
  • Done this and getting further but now getting the error `ld: library not found for -lSystem clang-12: error: linker command failed with exit code 1` – Jossy Sep 08 '21 at 11:30
  • 1
    That's an unrelated problem, and probably deserves a separate question with proper debugging details, though probably a duplicate of something like https://stackoverflow.com/questions/25314983/ldd-says-not-found-even-though-library-is-in-my-ld-library-path – tripleee Sep 08 '21 at 11:53
  • 1
    Please clarify why you need to install DBI with conda. It might be easier to install the package outside the conda environment. If you need it inside the environment, instead of using `perl -MCPAN ...` to install DBI, you could try install the prebuilt conda package [perl-dbi](https://anaconda.org/bioconda/perl-dbi) – Håkon Hægland Sep 08 '21 at 14:01
  • @HåkonHægland - I don't! I deleted the conda version and DBI was in the non-conda version however I'm now getting an error over DBD and a missing mysql_config file. I've posted a new question. Thanks for your help – Jossy Sep 08 '21 at 17:18

2 Answers2

1

Open the Terminal applicaton and install the macOS Command Line Tools with:

xcode-select --install 

This installs clang, gcc and git.

JRFerguson
  • 7,426
  • 2
  • 32
  • 36
  • Thanks. I'd done this before getting the error :-/ Comment above has got me a little further but getting a new error... – Jossy Sep 08 '21 at 11:29
0

I'm macOS user and I encountered this when I trying to replace Homebrew with Conda. Since your title shows that you're using macOS, I will recommend you install go via Homebrew to solve it painlessly. In short:

brew install go
NeoZoom.lua
  • 2,269
  • 4
  • 30
  • 64