I am trying to get Circos to install on my Mac (OS Catalina Version 10.15.7) and am having problems with the infamous GD working in perl. I have tried several solutions online and have deleted everything to start from scratch but still cannot get this dang library to work. Most recently, I tried the method of installing circos, then installing all other dependencies, and ending with installing GD, but that did not work.
When I run the "circos" command, I get this output (1): All of the other necessary modules appear to be installed as shown by "circos -modules" (2)
I have tried installing GD using CPAN and it also error's out giving the below error starting at "Result: FAIL." (3)
The weird thing is my computer recognizes that I have GD installed because when I call gdlib-config --all, it gives me an output for the GD library (4). It appears that GD may be there but not linked to perl somehow? Am I missing something super simple? Any help would be appreciated. I apologize for any ignorance, I am still an amateur at using terminal.
I have also tried perlbrew and got to the same point and same error.
Circos and Perl are both in my PATH (shown below).
(1)
Mon Jun 14 ashleyschumann ~circos
*** REQUIRED MODULE(S) MISSING OR OUT-OF-DATE ***
You are missing one or more Perl modules, require newer versions, or some modules failed to load. Use CPAN to install it as described in this tutorial
http://www.circos.ca/documentation/tutorials/configuration/perl_and_modules
missing GD::Polyline
error Attempt to reload GD.pm aborted.Compilation failed in require at /Users/ashleyschumann/perl5/lib/perl5/darwin-2level/GD/Polyline.pm line 45.
missing GD
error Can't load '/Users/ashleyschumann/perl5/lib/perl5/darwin-2level/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/perl5/lib/perl5/darwin-2level/auto/GD/GD.bundle, 1): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197. at (eval 42) line 1.Compilation failed in require at (eval 42) line 1.
(2)
Mon Jun 14 ashleyschumann ~circos -modules
ok 1.52 Carp
ok 0.45 Clone
ok 2.63 Config::General
ok 3.80 Cwd
ok 2.179 Data::Dumper
ok 2.58 Digest::MD5
ok 2.85 File::Basename
ok 3.80 File::Spec::Functions
ok 0.2311 File::Temp
ok 1.52 FindBin
ok 0.39 Font::TTF::Font
missing GD
missing GD::Polyline
ok 2.52 Getopt::Long
ok 1.46 IO::File
ok 0.430 List::MoreUtils
ok 1.55 List::Util
ok 0.01 Math::Bezier
ok 1.999818 Math::BigFloat
ok 0.07 Math::Round
ok 0.08 Math::VecStat
ok 1.03_01 Memoize
ok 1.97 POSIX
ok 1.30 Params::Validate
ok 2.01 Pod::Usage
ok 2.05 Readonly
ok 2017060201 Regexp::Common
ok 2.86 SVG
ok 1.19 Set::IntSpan
ok 1.6611 Statistics::Basic
ok 3.23 Storable
ok 1.23 Sys::Hostname
ok 2.04 Text::Balanced
ok 0.62 Text::Format
ok 1.9767 Time::HiRes
(3)
Test Summary Report
-------------------
t/fork.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/GD.t (Wstat: 9 Tests: 2 Failed: 2)
Failed tests: 1-2
Non-zero wait status: 9
Parse errors: Bad plan. You planned 14 tests but ran 2.
t/HSV.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 1 tests but ran 0.
t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 1 tests but ran 0.
t/transp.t (Wstat: 6400 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 25
Parse errors: Bad plan. You planned 12 tests but ran 1.
Files=9, Tests=3, 152 wallclock secs ( 0.05 usr 0.03 sys + 106.75 cusr 19.56 csys = 126.39 CPU)
Result: FAIL
Failed 5/9 test programs. 3/3 subtests failed.
make: *** [Makefile:1157: test_dynamic] Error 255
RURBAN/GD-2.73.tar.gz
/Users/ashleyschumann/opt/anaconda3/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports RURBAN/GD-2.73.tar.gz
Failed during this command:
RURBAN/GD-2.73.tar.gz : make_test NO
(4)
Mon Jun 14 ashleyschumann ~/circos-0.69-9/GD-2.51gdlib-config --all
GD library 2.1.0
includedir: /usr/local/include
cflags: -I/usr/local/include
ldflags: -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/ashleyschumann/opt/anaconda3/lib -L/Users/ashleyschumann/opt/anaconda3/lib -L/usr/X11/lib -L/usr/local/lib
libs: -ljpeg -lz -L/usr/local/lib -lpng16 -L/usr/local/opt/freetype/lib -lfreetype -L/usr/local/Cellar/fontconfig/2.13.1/lib -L/usr/local/opt/freetype/lib -lfontconfig -lfreetype -lfontconfig -L/usr/local/Cellar/libtiff/4.2.0/lib -ltiff -liconv
libdir: /usr/local/lib
features: GD_TIFF GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON
PATH
/Users/ashleyschumann/Applications/BLAST/ncbi-blast-2.11.0+:/Users/ashleyschumann/perl5/perlbrew/bin:/Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/bin:/Users/ashleyschumann/ashleyschumann/Applications/Circos/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/anaconda3/bin:/Users/ashleyschumann/perl5/bin:/ashleyschumann/Applications/Circos/bin/libgd/libgd-2.2.3/config:/Users/ashleyschumann/current/bin:/usr/bin/perl:/Users/ashleyschumann/opt/anaconda3/bin:/Users/ashleyschumann/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/ashleyschumann/bin:/Users/ashleyschumann/Applications/circos/current/bin/circos:/Users/ashleyschumann/Applications/circos/bin:/dropbox/RAW_DATA
Upon running HÃ¥kon's suggestion, I got this error following the use of "make test
Tue Jun 15 ashleyschumann ~/GD-2.73make test
"/Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- GD.bs blib/arch/auto/GD/GD.bs 644
PERL_DL_NONLAZY=1 "/Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/fork.t .................. Can't load '/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197.
at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
BEGIN failed--compilation aborted at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at t/fork.t line 3.
BEGIN failed--compilation aborted at t/fork.t line 3.
t/fork.t .................. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/GD.t .................... 1/14
# Failed test 'use GD;'
# at t/GD.t line 14.
# Tried to use 'GD'.
# Error: Can't load '/Users/ashleyschumann/GD-2.73/t/../blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/GD-2.73/t/../blib/arch/auto/GD/GD.bundle, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
# Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib
# Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197.
# at t/GD.t line 14.
# Compilation failed in require at t/GD.t line 14.
# BEGIN failed--compilation aborted at t/GD.t line 14.
# Failed test 'use GD::Simple;'
# at t/GD.t line 15.
# Tried to use 'GD::Simple'.
# Error: Attempt to reload GD.pm aborted.
# Compilation failed in require at /Users/ashleyschumann/GD-2.73/t/../blib/lib/GD/Simple.pm line 160.
# BEGIN failed--compilation aborted at /Users/ashleyschumann/GD-2.73/t/../blib/lib/GD/Simple.pm line 160.
# Compilation failed in require at t/GD.t line 15.
# BEGIN failed--compilation aborted at t/GD.t line 15.
t/GD.t .................... Failed 14/14 subtests
t/HSV.t ................... Can't load '/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197.
at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
BEGIN failed--compilation aborted at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at t/HSV.t line 14.
BEGIN failed--compilation aborted at t/HSV.t line 14.
# Looks like your test exited with 2 before it could output anything.
t/HSV.t ................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests
t/Polyline.t .............. Can't load '/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197.
at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
t/Polyline.t .............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests
t/transp.t ................ 1/12
# Failed test 'use GD;'
# at t/transp.t line 8.
# Tried to use 'GD'.
# Error: Can't load '/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
# Referenced from: /usr/local/opt/freetype/lib/libfreetype.6.dylib
# Reason: Incompatible library version: libfreetype.6.dylib requires version 54.0.0 or later, but libpng16.16.dylib provides version 31.0.0 at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/DynaLoader.pm line 197.
# at t/transp.t line 8.
# Compilation failed in require at t/transp.t line 8.
# BEGIN failed--compilation aborted at t/transp.t line 8.
Use of uninitialized value $pkg in concatenation (.) or string at /Users/ashleyschumann/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/Symbol.pm line 131.
Can't locate object method "_newFromGif" via package "GD::Image" at /Users/ashleyschumann/GD-2.73/blib/lib/GD/Image.pm line 196.
# Looks like your test exited with 25 just after 1.
t/transp.t ................ Dubious, test returned 25 (wstat 6400, 0x1900)
Failed 12/12 subtests
t/z_kwalitee.t ............ skipped: No RELEASE_TESTING
t/z_manifest.t ............ skipped: requires a git checkout and a unix for git and diff
t/z_pod-spell-mistakes.t .. skipped: No RELEASE_TESTING
t/z_pod.t ................. skipped: No RELEASE_TESTING
Test Summary Report
-------------------
t/fork.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/GD.t (Wstat: 9 Tests: 2 Failed: 2)
Failed tests: 1-2
Non-zero wait status: 9
Parse errors: Bad plan. You planned 14 tests but ran 2.
t/HSV.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 1 tests but ran 0.
t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 1 tests but ran 0.
t/transp.t (Wstat: 6400 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 25
Parse errors: Bad plan. You planned 12 tests but ran 1.
Files=9, Tests=3, 163 wallclock secs ( 0.04 usr 0.03 sys + 106.76 cusr 20.47 csys = 127.30 CPU)
Result: FAIL
Failed 5/9 test programs. 3/3 subtests failed.
make: *** [Makefile:1157: test_dynamic] Error 255
(base) Tue Jun 15 ashleyschumann ~pkg-config --debug libpng
no output option set, defaulting to --exists
Error printing disabled by default due to use of output options --exists, --atleast/exact/max-version, --list-all or no output option at all. Value of --print-errors: 0
Error printing disabled
Adding virtual 'pkg-config' package to list of known packages
Looking for package 'libpng'
Looking for package 'libpng-uninstalled'
Reading 'libpng' from file '/usr/local/lib/pkgconfig/libpng.pc'
Parsing package file '/usr/local/lib/pkgconfig/libpng.pc'
line>prefix=/usr/local/Cellar/libpng/1.6.37
Variable declaration, 'prefix' has value '/usr/local/Cellar/libpng/1.6.37'
line>exec_prefix=${prefix}
Variable declaration, 'exec_prefix' has value '/usr/local/Cellar/libpng/1.6.37'
line>libdir=${exec_prefix}/lib
Variable declaration, 'libdir' has value '/usr/local/Cellar/libpng/1.6.37/lib'
line>includedir=${prefix}/include/libpng16
Variable declaration, 'includedir' has value '/usr/local/Cellar/libpng/1.6.37/include/libpng16'
line>
line>Name: libpng
line>Description: Loads and saves PNG files
line>Version: 1.6.37
line>Requires: zlib
line>Libs: -L${libdir} -lpng16
line>Libs.private: -lz
Unknown keyword 'Libs.private' in '/usr/local/lib/pkgconfig/libpng.pc'
line>Cflags: -I${includedir}
Path position of 'libpng' is 1
Adding 'libpng' to list of known packages
Searching for 'libpng' requirement 'zlib'
Looking for package 'zlib'
Looking for package 'zlib-uninstalled'
Reading 'zlib' from file '/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15/zlib.pc'
Parsing package file '/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15/zlib.pc'
line>homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
Variable declaration, 'homebrew_sdkroot' has value '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk'
line>prefix=${homebrew_sdkroot}/usr
Variable declaration, 'prefix' has value '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr'
line>exec_prefix=/usr
Variable declaration, 'exec_prefix' has value '/usr'
line>libdir=${exec_prefix}/lib
Variable declaration, 'libdir' has value '/usr/lib'
line>sharedlibdir=${libdir}
Variable declaration, 'sharedlibdir' has value '/usr/lib'
line>includedir=${prefix}/include
Variable declaration, 'includedir' has value '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include'
line>
line>Name: zlib
line>Description: zlib compression library
line>Version: 1.2.11
line>
line>Requires:
line>Libs: -L${libdir} -L${sharedlibdir} -lz
line>Cflags:
Path position of 'zlib' is 4
Adding 'zlib' to list of known packages
Package zlib has -L /usr/lib in Libs
Removing -L /usr/lib from libs for zlib
Package zlib has -L /usr/lib in Libs
Removing -L /usr/lib from libs for zlib
~ ~
/Users/ashleyschumann/GD-2.73/blib/arch/auto/GD/GD.bundle:
/usr/local/lib/libjpeg.9.dylib (compatibility version 10.0.0, current version 10.0.0)
@rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/local/lib/libpng16.16.dylib (compatibility version 31.0.0, current version 31.0.0)
/usr/local/opt/freetype/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.4.0)
/usr/local/opt/fontconfig/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
/usr/local/opt/libtiff/lib/libtiff.5.dylib (compatibility version 12.0.0, current version 12.0.0)
@rpath/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
/usr/local/lib/libgd.3.dylib (compatibility version 4.0.0, current version 4.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
For what is worth. I was also having trouble with GD installation for Circos in Mac. When using circos I was getting this error message:
Circos Error There was a problem with True Type font support. Circos could not render text from the font file ...Please check that gd (system graphics library) and GD (Perl's interface to gd)are compiled with True Type support.
So I compiled GD again with home-brew but overwriting:
installed GD again with homebrew, overwriting
brew link --overwrite gd
checking
brew list | grep gd
brew info libgd
testing (I closed and reopened terminal, just in case).
cd circos-0.69-9
perl bin/gddiag
Now it worked: allocated 20603 colors Created color diagnostic image at gddiag.png GD version 2.78