Install Perl Image::Magick on Fedora - perl

I'm installing Image::Magick via cpan and I keep getting this error. I've tried with and without forcing it. I've trimmed the install log. I've read something about missing an ImageMagick.h file but don't exactly know anything other then that. Apparently this has been a common problem since 2007.....
[gandalf#Durmstrang ~]$ cpan -if Image::Magick
"/usr/bin/perl" "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp" -typemap "/usr/share/perl5/ExtUtils/typemap" -typemap "typemap" Magick.xs > Magick.xsc && mv Magick.xsc Magick.c
gcc -c -I/usr/local/include/ImageMagick-6 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libxml2 -I"/usr/include/ImageMagick-6" -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/freetype2 -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DVERSION=\"6.89\" -DXS_VERSION=\"6.89\" -fPIC "-I/usr/lib64/perl5/CORE" -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs: In function ‘XS_Image__Magick_ComplexImages’:
Magick.xs:3475:5: error: unknown type name ‘ComplexOperator’
ComplexOperator
^
Magick.xs:3510:8: error: ‘UndefinedComplexOperator’ undeclared (first use in this function)
op=UndefinedComplexOperator;
^
Magick.xs:3510:8: note: each undeclared identifier is reported only once for each function it appears in
Magick.xs:3516:31: error: ‘MagickComplexOptions’ undeclared (first use in this function)
in=ParseCommandOption(MagickComplexOptions,MagickFalse,(char *)
^
Magick.xs:3524:13: error: ‘ComplexOperator’ undeclared (first use in this function)
op=(ComplexOperator) in;
^
Magick.xs:3524:30: error: expected ‘;’ before ‘in’
op=(ComplexOperator) in;
^
Magick.xs:3548:38: error: expected ‘;’ before ‘in’
op=(ComplexOperator) in;
^
Magick.xs:3563:5: warning: implicit declaration of function ‘ComplexImages’ [-Wimplicit-function-declaration]
image=ComplexImages(image,op,exception);
^
Magick.xs:3563:10: warning: assignment makes pointer from integer without a cast [enabled by default]
image=ComplexImages(image,op,exception);
^
Magick.xs: In function ‘XS_Image__Magick_Mogrify’:
Magick.xs:9824:11: warning: implicit declaration of function ‘RotationalBlurImageChannel’ [-Wimplicit-function-declaration]
image=RotationalBlurImageChannel(image,channel,geometry_info.rho,
^
Magick.xs:9824:16: warning: assignment makes pointer from integer without a cast [enabled by default]
image=RotationalBlurImageChannel(image,channel,geometry_info.rho,
^
Magick.xs:10895:11: warning: implicit declaration of function ‘CannyEdgeImage’ [-Wimplicit-function-declaration]
image=CannyEdgeImage(image,geometry_info.rho,geometry_info.sigma,
^
Magick.xs:10895:16: warning: assignment makes pointer from integer without a cast [enabled by default]
image=CannyEdgeImage(image,geometry_info.rho,geometry_info.sigma,
^
Magick.xs:10916:11: warning: implicit declaration of function ‘HoughLineImage’ [-Wimplicit-function-declaration]
image=HoughLineImage(image,(size_t) geometry_info.rho,(size_t)
^
Magick.xs:10916:16: warning: assignment makes pointer from integer without a cast [enabled by default]
image=HoughLineImage(image,(size_t) geometry_info.rho,(size_t)
^
Magick.xs:10939:11: warning: implicit declaration of function ‘MeanShiftImage’ [-Wimplicit-function-declaration]
image=MeanShiftImage(image,(size_t) geometry_info.rho,(size_t)
^
Magick.xs:10939:16: warning: assignment makes pointer from integer without a cast [enabled by default]
image=MeanShiftImage(image,(size_t) geometry_info.rho,(size_t)
^
make: *** [Magick.o] Error 1
JCRISTY/PerlMagick-6.89-1.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible

The problem is that CPAN doesn't know about non-Perl dependencies.
The Perl Image::Magick module is just a wrapper around a C library. You'll need that library installed before you can build the Perl module.
$ sudo yum install ImageMagick
It also probably need ImageMagick's development package.
$ sudo yum install ImageMagick-devel
But it's probably easier to just install the RPM version that has already been packaged for Fedora (that will automatically pull in any other requirements).
$ sudo yum install ImageMagick-perl

In Fedora, CentOS, Ubuntu and more there have been this type of challenge in geting Image::Magick to install via the cpan program, and there have been sensitivities about the install-script for Image::Magick for a couple of years, it seems (if one searches around). This is so both for on desktop Linux and, even more so, via Apache cpanel. There are recipies but at least at Ubuntu, they have not been solving all issues. Sometimes, to get it right, one must first do removal of relevant libraries using ImageMagick to reset the links. All the proposed solutions center around installing other things before using 'cpan'. However, the best approach, I find, isn't at all to compile from source but to install the binary ImageMagick application when that is available, and relevant libraries before and after cpan, like this--in Ubuntu, but adapted for Fedora it should be similar or much the same:
sudo apt-get install perlmagick
sudo apt-get install ImageMagick
sudo cpan install Image::Magick
sudo apt-get install libperl-dev
For the sake of completeness, if one cannot find the right binary, one must take care to preinstall all relevant libraries as indicated on http://www.imagemagick.org and then this set of commands will replace the line#2 above, when performed after 'sudo -i' (in Ubuntu) or equivalent in Fedora, inside a temporary folder:
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd Imag*
./configure --with-perl
make
make install
When this installation is complete, proceed with line#3 above. Adapt the beginning of the command to the form that fits with other forms of linuxes. After this, a perl program having use Image::Magick; in its start should be able to do such as resizing of jpg images etc flawlessly.

Related

Compiling psqlODBC on CENTOS 7 gives me errors in connection.c - undeclared identifiers

So i'm stuck again.
What I want to do: access a postgreSQL database via database link from Oracle (12.1 - yes, I know it's old ...).
Oracle is running on Centos 7.
Initially I did a
yum -y install postgresql-odbc
yum -y install unixODBC
and was able to access postgreSQL (running on another machine).
But it didn't work for UTF-8 data. Got a hint that this might be due to an old version of unixODBC so I decided to compile from source (as the centos package is rather old).
Compiling and installing unixODBC worked without a hassle:
wget http://www.unixodbc.org/unixODBC-2.3.11.tar.gz
tar xzf unixODBC-2.3.11.tar.gz
cd unixODBC-2.3.11/
./configure
make
make install
But compiling psqlODBC is where it's at:
yum install postgresql
yum install postgresql-devel
wget https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-13.02.0000.tar.gz
cd psqlodbc-13.02.0000/
./configure
make
...
Make gives me the following output:
[root#tukanbox psqlodbc-13.02.0000]# make
make all-am
make[1]: Entering directory `/root/psqlodbc-13.02.0000'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/usr/local/include -I/usr/include -I/usr/include/pgsql/internal -DUNICODE_SUPPORT -g -O2 -Wall -MT psqlodbcw_la-connection.lo -MD -MP -MF .deps/psqlodbcw_la-connection.Tpo -c -o psqlodbcw_la-connection.lo `test -f 'connection.c' || echo './'`connection.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/usr/local/include -I/usr/include -I/usr/include/pgsql/internal -DUNICODE_SUPPORT -g -O2 -Wall -MT psqlodbcw_la-connection.lo -MD -MP -MF .deps/psqlodbcw_la-connection.Tpo -c connection.c -fPIC -DPIC -o .libs/psqlodbcw_la-connection.o
connection.c: In function 'handle_pgres_error':
connection.c:900:45: error: 'PG_DIAG_SCHEMA_NAME' undeclared (first use in this function)
errschemaname = PQresultErrorField(pgres, PG_DIAG_SCHEMA_NAME);
^
connection.c:900:45: note: each undeclared identifier is reported only once for each function it appears in
connection.c:901:44: error: 'PG_DIAG_TABLE_NAME' undeclared (first use in this function)
errtablename = PQresultErrorField(pgres, PG_DIAG_TABLE_NAME);
^
connection.c:902:45: error: 'PG_DIAG_COLUMN_NAME' undeclared (first use in this function)
errcolumnname = PQresultErrorField(pgres, PG_DIAG_COLUMN_NAME);
^
connection.c:903:47: error: 'PG_DIAG_DATATYPE_NAME' undeclared (first use in this function)
errdatatypename = PQresultErrorField(pgres, PG_DIAG_DATATYPE_NAME);
^
make[1]: *** [psqlodbcw_la-connection.lo] Fehler 1
make[1]: Leaving directory `/root/psqlodbc-13.02.0000'
make: *** [all] Fehler 2
Wondering where to declare these undeclared idenifiers. What does it want to know here? How to solve it?
No answer to the problem of not being able to compile - but an answer to the original problem that the original packages didn't work for UTF8:
https://www.postgresql.org/message-id/OFA166DBFD.19742AF7-ONC1257B6A.005692E6-C1257B6A.0056F890#lladro.net
This has to be done in the database as sysdba:
select fds_class_name from HS_FDS_CLASS;
select * from hs_class_caps where upper(CAP_DESCRIPTION) like '%NCHAR%' and FDS_CLASS_NAME ='ODBC12.1.0.1.0_0017';
exec DBMS_HS.ALTER_CLASS_CAPS('ODBC12.1.0.1.0_0017' , 564, 'ODBC12.1.0.1.0_0017', 564,131071, NULL, NULL);

Error installing postgresql with homebrew

When I run brew install postgresql I get this as an error message:
Last 15 lines from /Users/admin/Library/Logs/Homebrew/icu4c/02.make:
./formatted_string_builder.h:227:9: note: subexpression not valid in a constant expression
U_ASSERT(category <= 0xf),
^
../common/uassert.h:35:26: note: expanded from macro 'U_ASSERT'
# define U_ASSERT(exp) void()
^
./formatted_string_builder.h:240:64: note: in call to 'Field(0, 1)'
constexpr FormattedStringBuilder::Field kGeneralNumericField = {UFIELD_CATEGORY_UNDEFINED, 1};
^
3 errors generated.
*** Failed compilation command follows: ----------------------------------------------------------
clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_I18N_IMPLEMENTATION -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -I. -I../common -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -std=c++11 -Qunused-arguments -Wno-parentheses-equality -Wglobal-constructors -fvisibility=hidden -fno-common -c -MMD -MT numfmt.d numfmt.o numfmt.ao -o numfmt.ao numfmt.cpp
--- ( rebuild with "/Library/Developer/CommandLineTools/usr/bin/make VERBOSE=1 all" to show all parameters ) --------
make[1]: *** [numfmt.ao] Error 1
make: *** [all-recursive] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
These open issues may also help:
icu4c 67.1 (make C++14 compatible) https://github.com/Homebrew/homebrew-core/pull/59540
Error: You are using macOS 10.10.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
I have tried brew update (I am already up to date), and the only issue brew doctor gives me is that there are unexpected header files.
I am using
OSX Yosemite 10.10.5
Homebrew 2.4.12

Install postgresql with Homebrew does not work

I tried to install PostgreSQL on my mac book with homebrew.
brew install postgresql
But I couldn't install it and got these error messages.
Does anyone know what is the solution for this issue?
./formatted_string_builder.h:227:9: note: subexpression not valid in a constant expression
U_ASSERT(category <= 0xf),
^
../common/uassert.h:35:26: note: expanded from macro 'U_ASSERT'
# define U_ASSERT(exp) void()
^
./formatted_string_builder.h:240:64: note: in call to 'Field(0, 1)'
constexpr FormattedStringBuilder::Field kGeneralNumericField = {UFIELD_CATEGORY_UNDEFINED, 1};
^
3 errors generated.
*** Failed compilation command follows: ----------------------------------------------------------
clang++ -DU_ATTRIBUTE_DEPRECATED= -DU_I18N_IMPLEMENTATION -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -I. -I../common -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -std=c++11 -Qunused-arguments -Wno-parentheses-equality -Wglobal-constructors -fvisibility=hidden -fno-common -c -MMD -MT numfmt.d numfmt.o numfmt.ao -o numfmt.ao numfmt.cpp
--- ( rebuild with "/Library/Developer/CommandLineTools/usr/bin/make VERBOSE=1 all" to show all parameters ) --------
make[1]: *** [numfmt.ao] Error 1
make: *** [all-recursive] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
You need icu4c, The currently the version of icu4c written in Homebrew's Fomula is 67.1, and macOS is required to be High Sierra (10.13) or higher.

Unable to compile / install Orange Data Mining on Raspberry Pi

I have been trying to compile and install Orange 2.7.8 on Raspberry Pi 2 but was unsuccessful. I tried compiling by hand and also used pip install orange as per suggestion from: How can I install python-Orange on ubuntu 12.10
The first warning I got this:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -I/usr/lib/pymodules/python2.7/numpy/core/include -Isource/include -Isource/orange/liblinear -Isource/orange/ppp -Isource/orange/px -I/usr/include/python2.7 -c source/orange/basstat.cpp -o build/temp.linux-armv7l-2.7/source/orange/basstat.o -fPIC -w -DLINUX -DORANGE_EXPORTS
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
But it kept going without an error. Then when it started compiling with g++, it started getting an error on multiple definition of TOrangeVector. There are many errors like the lines below:
build/temp.linux-armv7l-2.7/source/orange/distance.o:(.data.rel.ro+0x6c): multiple definition of `typeinfo for TOrangeVector<GCPtr<TVariable>, true>'
build/temp.linux-armv7l-2.7/source/orange/basstat.o:(.data.rel.ro+0x6c): first defined here
build/temp.linux-armv7l-2.7/source/orange/distance.o: In function `TExamplesDistance::classDescription() const':
/home/pi/build/orange/source/orange/ppp/distance.ppp:17: multiple definition of `typeinfo for TOrangeVector<bool, false>'
In the end it got kicked out:
/home/pi/build/orange/source/orange/vectortemplates.hpp:1075: multiple definition of `typeinfo name for TOrangeVector<GCPtr<TOrangeVector<GCPtr<TVariable>, true> >, true>'
build/temp.linux-armv7l-2.7/source/orange/basstat.o:/home/pi/build/orange/source/orange/ppp/../basstat.hpp:8: first defined here
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Any guide on how to tweak this to make it compiled would be appreciated.

Installing Text::Aspell on windows XP

I've installed Aspell-0-50-3-3-Setup.exe and the dictionary Aspell-en-
0.50-2-3.exe from http://aspell.net/win32/ I've included this folder in my
environment variable PATH : C:\Program Files\Aspell\bin but I still can't
install Text::Aspell. My perl version is ActivePerl 5.16.1
Build 1601. These are the error messages that I get:
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -laspell
Aspell.xs:4:20: aspell.h: No such file or directory
Aspell.xs:9: error: syntax error before "AspellCanHaveError"
Aspell.xs:9: warning: no semicolon at end of struct or union
Aspell.xs:10: warning: data definition has no type or storage class
Aspell.xs:11: error: syntax error before '*' token
Aspell.xs:11: warning: data definition has no type or storage class
Aspell.xs:14: error: syntax error before '}' token
Aspell.xs:14: warning: data definition has no type or storage class
Aspell.xs:17: error: syntax error before '*' token
Aspell.xs: In function `_create_speller':
Writing Makefile for Text::Aspell
Writing MYMETA.yml and MYMETA.json
cp Aspell.pm blib\lib\Text\Aspell.pm
C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -noprototypes -typemap
C:\Perl\lib\ExtUtils\typemap -typemap typemap Aspell.xs > Aspell.xsc &&
C:\Perl\bin\perl.exe -MExtUtils::Command -e mv -- Aspell.xsc Aspell.c
C:\Perl\site\bin\gcc.exe -c -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -
DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DHASATTRIBUTE -fno-strict-
aliasing -mms-bitfields -O2 -DVERSION=\"0.09\" -
DXS_VERSION=\"0.09\" "-IC:\Perl\lib\CORE" Aspell.c
[32m HANK/Text-Aspell-0.09.tar.gz[0m
[31m C:\Perl\site\bin\dmake.exe -- NOT OK[0m
[32mRunning make test
[32m Can't test without successful make
[32mRunning make install Make had returned bad status, install seems impossible
[32mFailed during this command:
HANK/Text-Aspell-0.09.tar.gz
: make NO
[32m[0m
Your problem is Note (probably harmless): No library found for -laspell
The solution from http://cpansearch.perl.org/src/HANK/Text-Aspell-0.09/README
is to tell Makefile.PL where to find libaspell
perl Makefile.PL CCFLAGS=-I$HOME/local/include LIBS="-L$HOME/local/lib -laspell"
You can read about CCFLAGS/LIBS in ExtUtils::MakeMaker and probably some tutorials too :)