I am getting error "sh: cc: not found" when I try to install DBI module from CPAN prompt. Is there any way to resolve this? I have already installed gcc compiler from gnu site.
$ which gcc
/bin/gcc
$
and environment variable is already set like this cc=gcc
But, still I got this error:
cc -c -I/usr/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO3 -DVERSION=\"1.643\" -DXS_VERSION=\"1.643\" -KPIC "-I/usr/perl5/5.12/lib/sun4-solaris-64int/CORE" -DDBI_NO_THREADS Perl.c
sh: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `Perl.o'
Current working directory /root/.cpan/build/DBI-1.643-2
TIMB/DBI-1.643.tar.gz
/usr/bin/make -- NOT OK
Failed during this command:
TIMB/DBI-1.643.tar.gz : make NO
In order to avoid any binary incompatibilities, Perl expects all C code to be compiled with the same compiler as was used to build Perl itself. It looks like you're using the standard Solaris installation of Perl. That will have been built with the Solaris C compiler, not with gcc (you can check by running perl -V:cc).
So you're going to need the Solaris C compiler installed in order to install any CPAN modules that require C code to be compiled.
It's been years (decades probably) since I used Solaris. Is there no standardised package repository that you can use to install extra packages - something like RedHat's rpm?
Related
While trying to install Wx for Strawberry Perl I am receiving the following error:
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I....\include -I....\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -m64 -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
../../src/regex/regcomp.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed gmake: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
system: gmake -f makefile.gcc all UNICODE=1 MSLU=0 BUILD=release SHARED=1 DEBUG_INFO=default DEBUG_FLAG=1 LDFLAGS=" -m64" CPPFLAGS="-m64": 512 at inc/My/Build/Win32.pm line 284.
MDOOTSON/Alien-wxWidgets-0.67.tar.gz
D:\Perl\perl\bin\perl.exe ./Build -- NOT OK
Stopping: 'install' failed for 'Alien::wxWidgets'.
So this actually seems to be in the compile itself? Using CPAN to install. Not sure where to go from here. Any help is appreciated.
The core problem is the line
sorry, unimplemented: 64-bit mode not compiled in
so you are using the -m64 option on a gcc that doesn't support 64-bit
Ordinarily I would expect the only gcc in your path to be the one that comes with Strawberry Perl, so are you using Cygwin or something that is causing the build to pick up the wrong compiler?
I'm running Solaris on my machine and I would need to install the Date::Calc perl module in order for one of my scripts to work.
When I run the following command:
sudo perl -MCPAN -e 'install Date::Calc'
I get the following error:
Tests succeeded but one dependency not OK (Bit::Vector)
STBEY/Date-Calc-6.3.tar.gz
[dependencies] -- NA
Running make install
make test had returned bad status, won't install without force
I have no prior experience in Perl development, so I have no clue about what the error might be or where to get more information.
What should I do to fix this?
When trying to install Bit::Vector first, i.e. when running the following command:
sudo perl -MCPAN -e 'install Bit::Vector'
i get the following error message:
Checking if your kit is complete...
Looks good
Writing Makefile for Bit::Vector
Writing patchlevel.h for /usr/bin/perl (5.012003)
cp lib/Bit/Vector/Overload.pm blib/lib/Bit/Vector/Overload.pm
cp Vector.pm blib/lib/Bit/Vector.pm
cp Vector.pod blib/lib/Bit/Vector.pod
cp lib/Bit/Vector/Overload.pod blib/lib/Bit/Vector/Overload.pod
cp lib/Bit/Vector/String.pod blib/lib/Bit/Vector/String.pod
cp lib/Bit/Vector/String.pm blib/lib/Bit/Vector/String.pm
cc -c -DPTR_IS_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4 -DVERSION=\"7.2\" -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.12/lib/i86pc-solaris-64int/CORE" BitVector.c
sh: line 1: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `BitVector.o'
STBEY/Bit-Vector-7.2.tar.gz
/usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
I installed gcc via the following commands (as adviced here):
pkg install gcc-45
pkg install system/header
but I still get the same error when trying to install Bit::Vector. Indeed, when I type cc on the command-line, I get the command not found error. When I type gcc, however, I get gcc: no input files.
The error means that Bit::Vector (a dependency of Date::Calc) failed to install for some reason. Bit::Vector requires compiling C code, which means your CPAN configuration will need access to the C compiler and libraries (and headers) that were used to build your perl.
From what I understand, that can sometimes be painful on Solaris.
If you have another C compiler available, you might consider building and installing a local Perl using perlbrew.
So it turns out that the only option is to install the Oracle Solaris Studio prior to installation of new perl modules which need to compile C code.
From a related discussion at Oracle Solaris forum:
CC modification in /usr/perl5/5.12/lib/i86pc-solaris-64int/Config.pm
will not resolve the compilation issue. New errors will be produced
and some part will not use this variable.
By default, this method to build modules will use perl compiled
options. And in this case, as we used Oracle Studio, this software
will be required because some options are not available with gcc.
I tried with Oracle Studio, and the compilation was done successfully.
If you want to use gcc, then this will be very tricky to modify
several perl config files. An another method is to compile manually
each necessary modules after you customize each Makefile.
For literally days now, I have been scouring the web, and cursing and tearing my hair out, trying to compile Font::FreeType with dmake for dwimperl-5.14.2.1-v7-32bit (Strawberry Perl 5.14.2.1). For openers, there are several bugs in the FreeType.xs file for which I found a patch at Bug #32713 for Font-FreeType: patch for Font-FreeType-0.03. Lovely. The last update for this module is 11 Sep 2004 (note the day) so it is dead for sure, but I need it for using REAL fonts with perlcairo. So I am determined (desperate) to get it working. So far I have had no problems using cpan with the exception of this module. In fact Strawberry Perl is the only Windows perl I have used that actually works right out of the box with CPAN. This is obviously a rogue module. Even *nix users have had problems with it.
I read How do I fix Perl's Font::FreeType compilation errors? but no help there so I think a new thread is justified.
Number found where operator expected at Makefile.PL line 17, near "my $font_filename = catfile($data_dir, '5"
(Might be a runaway multi-line '' string starting on line 9)
(Do you need to predeclare my?)
Makefile.pl:
1 use ExtUtils::MakeMaker;
2 use File::Spec::Functions;
3
4 WriteMakefile(
5 NAME => 'Font::FreeType',
6 AUTHOR => 'Geoff Richards <qef#laxan.com>',
7 VERSION_FROM => 'lib/Font/FreeType.pm',
8 LIBS => [ '-lfreetype' ],
9 INC => '-I/usr/include/freetype2',
10 NO_META => 1,
11 );
12
13
14 # Generate a listing of the characters in the BDF test font, for checking
15 # that the library can find them all. See t/10metrics_5x7bdf.t
16 my $data_dir = catdir(qw( t data ));
17 my $font_filename = catfile($data_dir, '5x7.bdf');
This runs just fine using perl so what is dmake's problem? If I just run it with perl, dmake will re-run it. I can't figure out how to get dmake to just use what's there and I find no REAL documenation on dmake, just the useless help and man page (at least useless to me).
I tried adding a trailing slash to $data_dir but same error. Finally I just set $font_filename to the complete path. Crude, I know, but it works.
So this now creates FreeType.c but now there are path problems:
gcc -c -I/usr/include/freetype2 -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" "-IC:\Dwimperl\perl\lib\CORE" FreeType.c
FreeType.xs:19:22: fatal error: ft2build.h: No such file or directory
FreeType.c contains:
#include <ft2build.h>
#include FT_FREETYPE_H
I tried changing include paths in Makefile.pl but I really don't know the "proper" way to do that:
WriteMakefile(
.
LIBS => '-LC:/gtk/lib -lfreetype',
INC => '-IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/Dwimperl/c/include',
I think now the problem is converting *nix paths to Windows ones so the compiler can find all the header files. Has anyone successfully compiled this damned module in Windows using ANY compiler? Or does anyone at least know how to specify the Windows paths for WriteMakefile?
I was also trying to get the latest FreeType module to install on cygwin using cpan like so:
$ cpan
cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.
cpan[1]> install Font::FreeType
The first issue I ran into was during the make phase. Make was complaining about not being able to find ft2build.h.
It's then that I realized I had to download and compile/install the FreeType library first (doh!). So, I downloaded the latest from the FreeType download page, and installed it like so:
$ cd cygwin/freetype-2.4.0
$ ./configure
...
$ make
...
$ make install
The next issue is that when I tried to make the module in cpan again, it was failing at the following line in ft2build.h:
#include <freetype/config/ftheader.h>
If you take a look at the actual file (in /usr/local/include/ft2build.h on my system, but it may be somewhere else on yours) you will see this comment before that line:
/* `<prefix>/include/freetype2' must be in your current inclusion path */
So, I set the appropriate environment variable (The "proper" way, I believe -- better than modifying the "INC" line in the make file):
$ C_INCLUDE_PATH=/usr/local/include/freetype2
$ export C_INCLUDE_PATH
After fixing that, the next problem I ran into is the lvalue error:
$ cpan install Font::FreeType
CPAN: Storable loaded ok (v2.27)
...
FreeType.xs:808:21: error: lvalue required as left operand of assignment
...
Makefile:340: recipe for target `FreeType.o' failed
make: *** [FreeType.o] Error 1
GEOFFR/Font-FreeType-0.03.tar.gz
/usr/bin/make -- NOT OK
CPAN: YAML loaded ok (v0.84)
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
I know you've already fixed that, but I'll post the info here in case someone else runs into it. Save the patch file from here to FreeType.xs.diff (Your Font-FreeType-0.03 directory may be named differently), apply it, and make/compile like below. Note that since we modified the module we can't use cpan anymore, thus we make it manually:
$ cd ~/.cpan/build/Font-FreeType-0.03
$ patch FreeType.xs FreeType.xs.diff
patching file FreeType.xs
$ make
Makefile out-of-date with respect to Makefile.PL
...
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command. <==
false
Makefile:866: recipe for target `Makefile' failed
make: *** [Makefile] Error 1
$ make
cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm
...
Manifying blib/man3/Font.FreeType.3pm
$ make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
...
Appending installation info to /usr/lib/perl5/5.14/i686-cygwin-threads-64int/perllocal.pod
Voila! It's compiled! Another thing to point out is that I used regular gnu make rather than dmake, as Borodin pointed out earlier. The FreeType install notes say you have to run GNU Make 3.80 or later. You can check what version of make you have installed like this:
$ make -v
GNU Make 3.82.90
Built for i686-pc-cygwin
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I am having problems installed a CPAN module Text::CSV_XS using Cygwin.
I did a
$ cpan Text::CSV_XS
CPAN: Storable loaded ok (v2.20)
.... Every was good till:.....
Writing Makefile for Text::CSV_XS
cp CSV_XS.pm blib/lib/Text/CSV_XS.pm
/usr/bin/perl.exe /usr/lib/perl5/5.10/ExtUtils/xsubpp -typemap /usr/lib/perl5/5 .10/ExtUtils/typemap CSV_XS.xs > CSV_XS.xsc && mv CSV_XS.xsc CSV_XS.c
gcc-4 -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -p ipe -fstack-protector -I/usr/local/include -DUSEIMPORTLIB -O3 -DVERSION=\"0.8 8\" -DXS_VERSION=\"0.88\" "-I/usr/lib/perl5/5.10/i686-cygwin/CORE" CSV_XS.c
/bin/sh: gcc-4: command not found
Makefile:330: recipe for target `CSV_XS.o' failed
make: *** [CSV_XS.o] Error 127
HMBRAND/Text-CSV_XS-0.88.tgz
make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
I installed another module earlier, without problem.
Make is installed
gcc is installed
/bin/sh returns a new shell.
$ /bin/sh
$
Important note: as of this writing, gcc4 is now in the obsolete packages section which is hidden by default in the Cygwin installer.
Fire up the Cygwin packagre manager (setup.exe) and install gcc4. Use the search facility to locate the package in the manager. While you're at it, also install make, autoconf and automake. You'll find all these packages in the devel section.
Then retry, it will succeed, I just tested it:
MiLu#Dago: ~ > cpan Text::CSV_XS
...
Installing /usr/lib/perl5/site_perl/5.10/i686-cygwin/auto/Text/CSV_XS/CSV_XS.bs
Installing /usr/lib/perl5/site_perl/5.10/i686-cygwin/auto/Text/CSV_XS/CSV_XS.dll
Installing /usr/lib/perl5/site_perl/5.10/i686-cygwin/Text/CSV_XS.pm
Installing /usr/share/man/man3/Text.CSV_XS.3pm
Appending installation info to /usr/lib/perl5/5.10/i686-cygwin/perllocal.pod
HMBRAND/Text-CSV_XS-0.88.tgz
/usr/bin/make install -- OK
I am trying to install Bugzilla. I don't recall it being so difficult. We have a ubuntu server on the cloud, and at first I attempted to install through the rackspace UI. This didn't work, so I ssh'ed in and actually downloaded the tarball to do it the old-fashioned way.
However, it appears there are three perl modules having install problems. I have tried everything I know to get them to install, and am at a loss. I've tried googling for some answers, but I am either not using the correct terminology or this is truly unique to my situation.
The three offending perl modules failing the checksetup.pl:
/usr/bin/perl install-module.pl DateTime
/usr/bin/perl install-module.pl DateTime::TimeZone
/usr/bin/perl install-module.pl Template
When I attempt to install any of them, they fail miserably, apparently because the cc compiler is not installed (see below). When I checked for a cc package under APT, I could only find gcc. Will that be sufficient, and will I need to alias gcc to cc in order for these installs to work?
/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap Stash.xs > Stash.xsc && mv Stash.xsc Stash.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"2.22\" -DXS_VERSION=\"2.22\" -fPIC "-I/usr/lib/perl/5.10/CORE" Stash.c
/bin/sh: cc: not found
make[1]: *** [Stash.o] Error 127
make[1]: Leaving directory `/root/.cpan/build/Template-Toolkit-2.22-xzQg_q/xs'
make: *** [subdirs] Error 2
ABW/Template-Toolkit-2.22.tar.gz
/usr/bin/make -- NOT OK
Skipping test because of notest pragma
Running make install
Make had returned bad status, install seems impossible
You shouldn't compile Perl with one compiler (cc) and then compile modules with another compiler or compiler build (gcc) unless you happen to know their compatible. I find it very hard to believe that Ubuntu provided a Perl built with a compiler they don't provide.
Then there's the issue that you're installing unmanaged modules into a distro-managed Perl. That's... less than ideal.
The simplest solution is probably:
apt-get install \
libdatetime-perl \
libdatetime-timezone-perl \
libtemplate-perl
Another solution is to install a local build of Perl, perhaps using perlbrew.
Personally, I never use the system Perl. It's there for the system's needs first (not mine), and that causes problems. In this case, since the distro does provide the packages you need, it should be fine to just install those packages.
Just Install GCC and then Perl.To install the gcc package in the Debian/Ubuntu Linux distribution, enter the following command in a terminal:
> apt-get install gcc make linux-headers-$(uname -r)
I went ahead and installed the gcc package, and the installs completed. Whew. It has been a long time...