Installing Polymake under Mac OS 10.9

Discussions on installation issues go here.
borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 09:09

Dear polymake team,

I'm tring to install Polymake using Homebrew and Perlbrew to resolve dependencies. All works fine until the command

./configure --without-fink LDFLAGS=' -stdlib=libstdc++' CXXFLAGS=-I/usr/include/c++/4.2.1

There I get a Warning:

perl module Term::ReadLine::Gnu required for polymake seems to be unusable.
An attempt to load it has failed because of the following:
Cannot do `initialize' in Term::ReadLine::Gnu
Please be sure to rectify the problem prior to starting to use polymake.

I can do make and make install but then Polymake does not start exactly for the problem described in the Warning. Can somebody help me?

Thank you

paffenholz
Developer
Posts: 211
Joined: 24 Dec 2010, 13:47

Re: Installing Polymake under Mac OS 10.9

Postby paffenholz » 20 Mar 2014, 10:20

polymake can't find the perl module Terl::Readline::Gnu. This does not come preinstalled with MacOS, so you have to install this yourself and change the perl load path so that perl can find it.

If you did install it, then check whether ''echo $PERL5LIB'' contains the correct paths (for a standard local installation this should be ''$HOME/perl5/lib/perl5/darwin-thread-multi-2level/'' and ''$HOME/perl5/''). If not, add them to $PERL5LIB with ''export PERL5LIB=$HOME/perl5/lib/perl5/darwin-thread-multi-2level/:$HOME/perl5/:$PERL5LIB'' (if you use the bash shell (which you do unless you explicitely changed it)). Now polymake should start.

If you have not installed the module (check whether ''$HOME/perl5/lib/perl5/darwin-thread-multi-2level/Term/'' exists) then ''cpanm Term::ReadLine::Gnu'' should install it.

Hope that solves it, otherwise please ask again
Andreas

borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Re: Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 10:36

Thank you for the fast answer. I tried

echo $PERL5LIB

and I get

/Users/Dennis/perl5/lib/perl5/darwin-thread-multi-2level/:/Users/Dennis/perl5/:

so all seams to be right. I installed cpanm Term::ReadLine::Gnu following the installation description. I don't know what I´m doing wrong.

borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Re: Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 10:46

The exact error when I start Polymake is

Cannot do `initialize' in Term::ReadLine::Gnu at (eval 173) line 4.

paffenholz
Developer
Posts: 211
Joined: 24 Dec 2010, 13:47

Re: Installing Polymake under Mac OS 10.9

Postby paffenholz » 20 Mar 2014, 10:57

Then we should check the perl version first, just to be sure.

Could you do the following commands in a terminal:

Code: Select all

perl --version /usr/bin/perl --version
If the output differs, then check

Code: Select all

which perl
to find the path to the perl called by default.

Further, we should find out which perl version is used by perlbrew. For this, check

Code: Select all

ls /Users/Dennis/perl5/site_perl
There should be a directory with a version number (e.g. "5.16.2").

Andreas

borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Re: Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 11:08

Ok,

when I type perl --version I get:

This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

and when I type /usr/bin/perl --version, I get the same:

This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

But when I type ls /Users/Dennis/perl5/site_perl I get:

ls: /Users/Dennis/perl5/site_perl: No such file or directory

ls /Users/Dennis/perl5 contains only

bin lib man perlbrew

paffenholz
Developer
Posts: 211
Joined: 24 Dec 2010, 13:47

Re: Installing Polymake under Mac OS 10.9

Postby paffenholz » 20 Mar 2014, 11:49

Okay, so the perl version seems to be okay. The path was a guess, and I guessed wrong. I can check on a Mac with perlbrew tomorrow, but it is unliekly that this is the problem. Your setup seems to be correct. Currently I have no good idea what might go wrong.

Can you do

Code: Select all

/usr/bin/perl -e "print join \"\n\", @INC"
and

Code: Select all

/usr/bin/perl -M'Term::Readline' -e 'print join "\n", %INC'
Andreas

borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Re: Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 12:05

Ok,

/usr/bin/perl -e "print join \"\n\", @INC" gives:

/Users/Dennis/perl5/lib/perl5/darwin-thread-multi-2level/
/Users/Dennis/perl5/
/Library/Perl/5.16/darwin-thread-multi-2level
/Library/Perl/5.16
/Network/Library/Perl/5.16/darwin-thread-multi-2level
/Network/Library/Perl/5.16
/Library/Perl/Updates/5.16.2
/System/Library/Perl/5.16/darwin-thread-multi-2level
/System/Library/Perl/5.16
/System/Library/Perl/Extras/5.16/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.16

and /usr/bin/perl -M'Term::Readline' -e 'print join "\n", %INC' gives:

warnings/register.pm
/System/Library/Perl/5.16/warnings/register.pm
Carp.pm
/System/Library/Perl/5.16/Carp.pm
vars.pm
/System/Library/Perl/5.16/vars.pm
Exporter.pm
/System/Library/Perl/5.16/Exporter.pm
strict.pm
/System/Library/Perl/5.16/strict.pm
warnings.pm
/System/Library/Perl/5.16/warnings.pm
Term/Readline.pm
/System/Library/Perl/5.16/Term/Readline.pm
Config.pm
/System/Library/Perl/5.16/darwin-thread-multi-2level/Config.pm
DynaLoader.pm
/System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader.pm
Term/ReadLine/Gnu.pm

paffenholz
Developer
Posts: 211
Joined: 24 Dec 2010, 13:47

Re: Installing Polymake under Mac OS 10.9

Postby paffenholz » 20 Mar 2014, 13:34

The output of the second command is missing a line, it should have been

Code: Select all

... Term/ReadLine/Gnu.pm /Users/Dennis/perl5/lib/perl5/darwin-thread-multi-2level/Term/ReadLine/Gnu.pm
Does the file "/Users/Dennis/perl5/lib/perl5/darwin-thread-multi-2level/Term/ReadLine/Gnu.pm" exist?

If not, then probably the installation of Term::ReadLine::Gnu failed. Can you retry? maybe you have to force reinstallation with

Code: Select all

cpanm --reinstall Term::ReadLine::Gnu
The output should be similar to

Code: Select all

--> Working on Term::ReadLine::Gnu Fetching http://www.cpan.org/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.23.tar.gz ... OK Configuring Term-ReadLine-Gnu-1.23 ... OK Building and testing Term-ReadLine-Gnu-1.23 ... OK Successfully reinstalled Term-ReadLine-Gnu-1.23 1 distribution installed
Andreas

borgo
Posts: 12
Joined: 04 Jun 2013, 18:23

Re: Installing Polymake under Mac OS 10.9

Postby borgo » 20 Mar 2014, 14:43

Yes you are write, the last line is missing. Typing cpanm --reinstall Term::ReadLine::Gnu gives:

! Configure failed for Term-ReadLine-Gnu-1.23. See /Users/Dennis/.cpanm/work/1395320842.9441/build.log for details.

i did not see this error during the installation. The log file contains

cpanm (App::cpanminus) 1.7001 on perl 5.016002 built for darwin-thread-multi-2level
Work directory is /Users/Dennis/.cpanm/work/1395320861.9460
You have make /usr/bin/make
You have LWP 6.04
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching Term::ReadLine::Gnu on cpanmetadb ...
--> Working on Term::ReadLine::Gnu
Fetching http://www.cpan.org/authors/id/H/HA/HAY ... .23.tar.gz
-> OK
Unpacking Term-ReadLine-Gnu-1.23.tar.gz
Entering Term-ReadLine-Gnu-1.23
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.63_02)
Configuring Term-ReadLine-Gnu-1.23
Running Makefile.PL
Found `/usr/lib/libtermcap.dylib'.
cc -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -DHAVE_STRING_H rlver.c -o rlver -arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib -lreadline -ltermcap
rlver.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main() { puts(rl_library_version); }
^~~~
1 warning generated.
rlver.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main() { puts(rl_library_version); }
^~~~
1 warning generated.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The libreadline you are using is the libedit library. Use the GNU Readline Library.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-> N/A
-> FAIL Configure failed for Term-ReadLine-Gnu-1.23. See /Users/Dennis/.cpanm/work/1395320861.9460/build.log for details.
~

I serched in the web for the error "The libreadline you are using is the libedit library." installing Term::ReadLine::Gnu and I found the following web page

http://blogs.perl.org/users/aristotle/2 ... negnu.html

There is the description of the trick you describe in the installation guide:

brew link --force readline
cpanm Term::ReadLine::Gnu
brew unlink readline

I applied it without the last line and now polymake works!!!!! Do you think this could cause problems in the future?

By the way thank you very much Andreas.


Return to “Installing polymake”