Perl can't install Glib on Mac Big Sur - macos

I'm trying to install Gtk2 from CPAN on my Mac (Big Sur), but it requires Glib, and Glib install is failing. The tail of the installer output is here:
echo Generating POD...
Generating POD...
"/usr/bin/perl" -I blib/lib -I blib/arch -MGlib::GenPod -MGlib \
-e "add_types (qq(doctypes)); Glib::GenPod::set_copyright(qq/Copyright (C) 2003-2011 by the gtk2-perl team.\n\nThis software is licensed under the LGPL. See L<Glib> for a full notice.\n/); Glib::GenPod::set_main_mod(qq(Glib)); xsdoc2pod(q(build/doc.pl), q(blib/lib), q(build/podindex));"
Can't load 'blib/arch/auto/Glib/Glib.bundle' for module Glib: dlopen(blib/arch/auto/Glib/Glib.bundle, 0x0001): open("", O_RDONLY) failed with errno=2 at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197.
at blib/lib/Glib/GenPod.pm line 21.
Compilation failed in require at blib/lib/Glib/GenPod.pm line 21.
BEGIN failed--compilation aborted at blib/lib/Glib/GenPod.pm line 21.
Compilation failed in require.
BEGIN failed--compilation aborted.
make: *** [build/podindex] Error 2
FAIL
! Installing Glib failed. See /Users/principal/.cpanm/work/1626461722.68580/build.log for details. Retry with --force to force install it.
Retry with --force gives the same results. The specified build.log file gives less detail than the console output above.
If I understand what it's telling me, it is that the GenPod.m module fails at the point where it is trying to "use Glib;". But when I look at the specified search point (blib/arch/auto/Glib/Glib.bundle) there is such a file there.
I'm using the Mac-installed Perl (5.30) and have had no other issues installing via CPAN. Any help would be appreciated. I would even welcome knowing how to bypass the "GenPod" step, as having working code is better than having documentation. The latest post I could find on the topic of Glib failing to install on Mac was four years ago in the El Capitan days, and the OP there was having an entirely different problem.

Related

Installing Perl and PDL

I am currently trying - unsuccessfully to install perl PDL as I would like to automate some of my data analysis and graphics generation.
Unfortunately I seem unable to even install the necessary modules without issue, let alone create a small script to deal with my data files.
I have some rudementary experience with Perl but Nothing fancy and am using Windows 10 x64.
Initially I went for the x64 strawberry perl v5.24 installation, followed by ppm installations of Astro::FITS::Header, Convert::UU, OpenGL and PDL - as instructed here http://pdl.perl.org/?page=install. However, there were issues with the installation of Inline::C and after trying the example listed on page 5 of the PDL_Book_Latest http://sourceforge.net/projects/pdl/files/PDL/2.4.10/PDL-Book-20120205.pdf/download there wasn't any image appearing, nor image file in any location I could think to search. Back to Google and still no luck finding any information on the source of this issue so I decided to go back to square one and use an older version in the hopes that it would be more well documented.
So, uninstallation of strawberry perl through Windows installed programs dialog, deletion of strawberry folder and registry entries containing "strawberry". Then a new installation of perl, with the Padre IDE, v5.14 - maybe some debugging fonctionality will help pinpoint the errors. Started installing the same modules (Astro::FITS::Header, Convert::UU, OpenGL, PGPLOT). Astro and Convert worked fine, but the OpenGL started throwing errors about ExtUtils::F77 which I am apparently missing after a few more hours searching. I go to install this module and it keeps giving errors about 'gfortan' being an unknown command... It was my understanding that the idea of PDL was to avoid fortran and C, and I have found next to no information about this installation problem so far.
So i decided to try an alternative approach. I installed the ppm module from cpan and repeated the initial installation process through the ppm command. This time i get:
"Unknown element 'PROVIDE' found inside SOFTPKG. at C:/Dwimperl/perl/site/lib/PPM.pm line 1462."
So my question is as follows:
Am I missing some critical step in the installation process? Is my system just handing this really badly, and if so is there any sort of possible work around? Is the fact that I tried two different versions liable to create path issues that could be at the root of this problem?
Could anyone provide an alternative and preferably not too complex route to install PDL with a given perl installation on Windows 10?
EDIT 1:
Here is the code for the error I got trying to install Inline::C, an apparent pre-requisite for PDL
code deleted to make space for updates...
EDIT 3:
I reinstalled GnuWin32 in the directory specified by PATH, rather that changing PATH, and the tried the installation again. Inline::C gave the same 'diff' and 'rm' errors. So i ran "cpanm --notest 'package'" to install Inline::C and then PDL, both said they were successful. However, even using '--notest' cpanm could not install OpenGL and PGPLOT.
The final objectif is to be able to produce graphics using the fonctions from PGPLOT: for example
# use PDL;
# use PDL::Graphics::PGPLOT;
# imag(sin(rvals(200,200)+1));
yet this doesn't work of course if PGPLOT can't install.
EDIT 4:
Tried the fix found by #Dr.Avalange at sourceforge https://sourceforge.net/p/pogl/bugs/26/ and noticed that I seem to have multiple copies of this file.
Here
Is this normal...?
EDIT 5:
So i uninstalled perl, deleted any lingering files I could find in %APPDATA%, %USERPROFILE% and C:/DWIM, and then ran ccleaner just in case I missed anything.
I then downloaded Strawberry perl 5.24.1 x64 for Windows and installed it.
After this, I ran 'cpanm Astro::FITS::Header', cpanm 'Convert-UU' and 'cpanm OpenGL' as per http://pdl.perl.org/?page=install. This all worked fine. Then I ran 'cpanm PDL' which installed Inline, Pegex, Win32::Mutex and Module::Compile dependencies. However, if had the same error with Inline::C that you mentioned previously.
I already had GetGnuWin32 installed before so not sure why this isn't working. The Windows 'Path' environment (not PATH - this doesn't exist according to the advaced system dialogue) is noted as
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
In this directory I have the folder GetGnuWin32 which should have installed all the packages from the link you provided, unless there is a supplementary step that I missed to install this correctly? So I redownloaded the DiffUtils setup and ran that, installing to \programfiles(x86) (default option). I then reran 'cpanm PDL'.
I still get the same 'diff' error message. So is DiffUtils, not installing properly? (I did close and re-open the commandline between tries and after the installation)
EDIT 6:
So after installing PDL and PGPLOT with --notest I tried to run the following test and it failed. See below
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL::Graphics//PLplot
Unknown regexp modifier "/P" at (eval 62) line 4, at end of line
Unknown regexp modifier "/L" at (eval 62) line 4, at end of line
Unknown regexp modifier "/t" at (eval 62) line 4, at end of line
BEGIN not safe after errors--compilation aborted at (eval 62) line 5, <DATA> line 207.
pdl> use PDL::Graphics::PLplot
Can't locate PDL/Graphics/PLplot.pm in #INC (you may need to install the PDL::Graphics::PLplot module) (#INC contains: C:/Strawberry/perl/site/lib/MSWin32-x64-multi-thread C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at (eval 72) line 5.
BEGIN failed--compilation aborted
pdl> use PDL
pdl> use lib 'C:/Strawberry/perl/site/lib/PDL/Graphics'
pdl> use PGPLOT
pdl> use PDL::Graphics::PGPLOT
pdl> imag(sin(rvals(200,200)+1))
Undefined subroutine &PDL::Graphics::PGPLOT::pgqinf called at C:/Strawberry/perl/site/lib/PDL/Graphics/PGPLOT.pm line 408, <DATA> line 90.
pdl> exit
C:\Windows\system32>cpanm PDL::Graphics::PGPLOT::pgqinf
! Finding PDL::Graphics::PGPLOT::pgqinf on cpanmetadb failed.
! Finding PDL::Graphics::PGPLOT::pgqinf () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution PDL::Graphics::PGPLOT::pgqinf
C:\Windows\system32>cpan PDL::Graphics::PGPLOT::pgqinf
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Thu, 13 Apr 2017 13:49:14 GMT
C:\Windows\system32>
There was already a directory problem but I managed to point it in th right direction I had thought. Also tried installing the PLplot 'cpanm' said the installation was successful but there is no .pm file, only a .pd in another directory and so the use PDL::Graphics::PLplot fails as there is no .pm file to find.
EDIT: 7
So retrying ppm install http://www.sisyphusion.tk/ppm/PGPLOT.ppd seemed to work this time as the links int he explanation you provided are no longer in use
http://www.kalinabears.com.au/w32perl/pgplot-5.2.2-mingw32.tar.bz2
http://jrfonseca.home.dyndns.org/projects/gnu-win32/software/ported/patches/pgplot-5.2.2-mingw32.diff.gz
And while this seemed to work, there are no traces of the files that were listed as necessary for the installation, unless they were just for this specific method?
pgplot/bin/cpgplot.dll
pgplot/bin/pgplot.dll
pgplot/bin/grfont.dat
pgplot/include/cpgplot.h
pgplot/lib/cpgplot.a
pgplot/lib/pgplot.a
finally, trying the example again gives the following; no errors, but no image either...
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL
pdl> use PDL::Graphics::PGPLOT
pdl> imag(rvals(200,200)+1)
%PGPLOT, Unable to read font file: grfont.dat
%PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl> $ENV{PGPLOT_FONT} = "C:/Strawberry/perl/site/lib/PGPLOT/pgplot_supp"
pdl> imag(rvals(200,200)+1)
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl>
After translating from French I can see that you don't have diff in your system. Either install diff (part of gnu32: http://gnuwin32.sourceforge.net/) or just skip the tests. See also:
https://github.com/ingydotnet/inline-c-pm/issues/60
With Strawberry 5.24.1 simply type the following from the command prompt:
cpanm --notest PDL
or if you want to watch everything that's going on:
cpanm -v --notest PDL
This will take some time to run.

FreeBSD make error File 5.19 supports only version 12 magic files. /usr/share/misc/magic.mgc is version 8

I'm having trouble reinstalling ProFTPD on a FreeBSD 10.1 setup. The server is newly upgraded from 10.0 to 10.1. When I start the make install clean process, these warnings first shows on screen.
===> proftpd-1.3.5_4 depends on shared library: libpcre.so
/usr/share/misc/magic, 93: Warning: Printf format `l' is not valid for type `lelong' in description `, %ld pages'
...
/usr/share/misc/magic, 15118: Warning: Printf format `l' is not valid for type `belong' in description `Volume %ld,'
/usr/share/misc/magic, 15609: Warning: Current entry does not yet have a description for adding a MIME type
file: File 5.19 supports only version 12 magic files. `/usr/share/misc/magic.mgc' is version 8
[: =: unexpected operator
- not found
And after i while, the make process stops with this error:
/bin/ln -s libpcre.so.1 /usr/ports/devel/pcre/work/stage/usr/local/lib/libpcre.so.3
====> Compressing man pages (compress-man)
===> Installing for pcre-8.35_2
===> Checking if pcre already installed
===> pcre-8.35_2 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pcre
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/ftp/proftpd
*** Error code 1
Stop.
make: stopped in /usr/ports/ftp/proftpd
Seems that the file /usr/share/misc/magic.mgc is of a wrong version?
This might happens when I was upgrading from 10.0-RELEASE-p12 to 10.1-RELESE-p1?
If i run make install clean of the ProFTP port, and disable support for pcre, the process and install is successful.
But I believe that something is still broken?
My programming skills are limited, and also this level of error.
Please let me know if you have any ideas,
Thanks,
First of all, proftpd 1.3.5 is available as a binary package, it's much simpler to install it that way (pkg install proftpd).
Second - at first it looked like a port bug; as Etan said, there is a shell syntax error (something like '[ x == y ]' instead of '[ x = y ]'); those are common, and ports contain patches to fix those. However, there is a binary package, and packages are built from ports ("make package"), so port obviously does work on package build machines. So it's probably something specific to your environment.
If you really want to build from ports, try this: first, reinstall pcre. For some reason it had to be rebuilt, but failed to install, because it's already installed. So, "cd /usr/ports/*/pcre && make clean all deinstall reinstall". That should get rid of the second error. Then go back to "../*/proftpd" and see how far it goes.
But really, I'd try packages first. They have nothing in common with old pkg_add system, and are really nice.
freebsd-update diff for FreeBSD-SA-14:28.file seems wrong, and it breaks file(1).
Therefore simply pkg install file will be a workaround.

Wordnet::Similarity installation issue

When I install Wordnet::Similarity on mac, the following error occur:
usr/local/bin/perl "-Iblib/arch" "-Iblib/lib" build/Depthfiles.PL blib/lib/WordNet/synsetdepths.dat
Generating default depth files.
Can't load '/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle' for module Digest::SHA1: dlopen(/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle, 1): no suitable image found. Did find:
/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle: mach-o, but wrong architecture at /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm line 230.
at blib/lib/WordNet/Tools.pm line 76
Compilation failed in require at blib/lib/WordNet/Tools.pm line 76.
My attempt was to enter to the downloaded package directory from terminal and type:
perl Makefile.PL
make
make test
sudo make install
I made sure to have installed all prerequisite http://search.cpan.org/dist/WordNet-Similarity/doc/install.pod#Prerequisites. I suspect that this may be due to mac processor version with Perl interface. Any suggestion on how to fix this?
Install libdigest-sha-perl in Ubuntu 14.04 has solved this issue.
Download link:http://packages.ubuntu.com/trusty/amd64/perl/libdigest-sha-perl

Why doesn't LWP.pm work on Mac OSX?

I have a Mac Book Pro, it has Perl.
I have a script with includes.
use LWP ;
use HTTP::Request::Common qw{ POST };
use HTML::Form;
LWP so I ran (twice once as root once as normal user) Guide I followed
perl -MCPAN -e 'shell'
install Bundle::LWP
install HTML::Tree
install HTML::Form
Warning: Cannot install HTML::Format, don't know what it is.
It says its missing two dependencies, but when I install them it says they are already done...?
Pastebin showing the output of the dependencies problem
When I run the script this is the error I get:
Can't locate LWP.pm in #INC (#INC contains: /opt/local/lib/perl5/site_perl/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.16.3 /opt/local/lib/perl5/vendor_perl/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.16.3 /opt/local/lib/perl5/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/5.16.3 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl .) at NMLRegAttack2.pl line 1.
BEGIN failed--compilation aborted at NMLRegAttack2.pl line 1.
build_dir_reuse is not set correctly
Solution
cpan
conf build_dir_reuse 0
o conf commit
exit

Help Installing psycopg2 on snow leopard : command '/usr/bin/gcc-4.0' failed with exit status 1

This has been driving me crazy for 2 days.
I have been trying to install psycopg2 using easy_install and no matter what I try (i.e using gcc-4.0 instead of the snow leopard default one) I always get the same error:
error: Setup script exited with error: command '/usr/bin/gcc-4.0' failed with exit status 1
Please see: http://dpaste.com/hold/228252/
I have googled that error so many times and nothing I have found seem to help.
Looks like you're missing a dependency, the development files for libpq. The relevant log part is here:
In file included from psycopg/psycopgmodule.c:32In file included from psycopg/psycopgmodule.c:32:
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory
Try installing libpq development files and then rerun easy_install. You may hit another missing dependency; pay attention to the first error that GCC spits out.
Link http://dpaste.com/hold/228252/ seems to be dead, this is how I solved this problem (Mac OS X 10.6, virtualenv).
If pip fails with this message, just take a look to build folder in your virtual environment. You should edit setup.cfg file there, particularly include_dirs and library_dirs. In first one set your include folders, my option was:
include_dirs=/opt/local/include/postgresql84:/opt/local/include/postgresql84/server
and most likely you will need to set library_dirs to correct location as well:
library_dirs=/opt/local/lib/postgresql84.
probably you should install postgresql-devel first
yum -y install postgresql-devel

Resources