missing GD while installing circos on Mac OS Big Sur Version 11.0.1

1.1k views Asked by At

I found it is very very hard to install circos on MacOS, and all the answers I can find on Google is pretty rusty and do not work for me on Mac OS Big Sur Version 11.0.1. Here are what I am missing:

(base) user@user-MacBook-Pro % circos -modules
ok       1.50 Carp
ok       0.45 Clone
ok       2.63 Config::General
ok       3.74 Cwd
ok      2.170 Data::Dumper
ok       2.55 Digest::MD5
ok       2.85 File::Basename
ok       3.74 File::Spec::Functions
ok     0.2304 File::Temp
ok       1.51 FindBin
ok       0.39 Font::TTF::Font
missing            GD
missing            GD::Polyline
ok        2.5 Getopt::Long
ok       1.39 IO::File
ok      0.430 List::MoreUtils
ok        1.5 List::Util
ok       0.01 Math::Bezier
ok   1.999811 Math::BigFloat
ok       0.07 Math::Round
ok       0.08 Math::VecStat
ok    1.03_01 Memoize
ok       1.84 POSIX
ok       1.30 Params::Validate
ok       1.69 Pod::Usage
ok       2.05 Readonly
ok 2017060201 Regexp::Common
ok       2.85 SVG
ok       1.19 Set::IntSpan
ok     1.6611 Statistics::Basic
ok    3.08_01 Storable
ok       1.22 Sys::Hostname
ok       2.03 Text::Balanced
ok       0.62 Text::Format
ok     1.9759 Time::HiRes

It seems that the only package that is missing is GD. So I tried to install GD.

(base) user@user-MacBook-Pro % curl -O http://www.cpan.org/authors/id/L/LD/LDS/GD-2.50.tar.gz
(base) user@user-MacBook-Pro % tar xvfz GD-2.50.tar.gz
(base) user@user-MacBook-Pro % cd GD-2.50
(base) user@user-MacBook-Pro % perl Makefile.pl
Notice: Type perl Makefile.PL -h for command-line option summary.

**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.

Again, it seems that the problem is missing libgd. So I tried to install it:

(base) user@user-MacBook-Pro curl -O https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0-rc2.tar.gz
(base) user@user-MacBook-Pro tar -xzvf libgd-2.1.0-rc2.tar.gz
(base) user@user-MacBook-Pro cd libgd-2.1.0-rc2
(base) user@user-MacBook-Pro ./configure
(base) user@user-MacBook-Pro make 
(base) user@user-MacBook-Pro sudo make install
........
Making install in config
 ../config/install-sh -c -d '/usr/local/bin'
 /usr/bin/install -c gdlib-config '/usr/local/bin'
 ../config/install-sh -c -d '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 gdlib.pc '/usr/local/lib/pkgconfig'
Making install in tests
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.

It still does not work me. Any suggestions would be appreciated.

Thanks, Miao

3

There are 3 answers

0
Miao  Cai On

I tried @Håkon Hægland's answer, but when I rerun circos -modules, it still shows that GD is missing. I tried another tutorial here and it seems to work for me.

wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.51.tar.gz
tar xfvz ./GD-2.51.tar.gz
cd GD-2.51/
perl Makefile.PL 
make
sudo make install
0
Håkon Hægland On

The following worked for me. I am using perlbrew with perl version 5.30.1, macOS 11.0.1.

$ brew install pkg-config
$ brew install libgd
$ cpanm GD
0
akostadinov On

tl;dr;

bundle config --local build.local-fastimage_resize --with-opt-dir="$(brew --prefix gd)"

The long story:

I found a colleague to try things out for me on his M1. It seems the issue comes from the changed default homebrew prefix to /opt/homebrew instead of the previous /usr/local.

To reproduce a simple c program can be used (hello.c):

#include "gd.h"
#include <stdio.h>
int main() {
   printf("Hello");
   return 0;
}

Then one can try to compile with:

gcc -lgd hello.c -o hello

This works on intel mac but fails on M1.

To fix the issue one can set proper library lookup (search) path:

gcc -L/opt/homebrew/Cellar/gd/2.3.3_4/lib -lgd hello.c -o hello

I read that this can be better solved by brew shellenv, I didn't have time to investigate this approach though.

credits to: