XML::LibXSLT fails to install at Heroku - perl

I fail to install XML::LibXSLT on Heroku. It looks like the required libraries gdbm is not installed, despite being listed as installed Ubuntu packages at Heroku stack cedar and cedar-14. Similar problems have been reported in this question but not on Heroku and its not allowed to install new Ubuntu packages.
To reproduce the error, create a minimal repository, requiring XML::LibXSLT in cpanfile:
$ git init
$ echo 'requires "XML::LibXSLT";' > cpanfile
$ echo 'sub { [200,[], ['Hello World']] }' > app.psgi
$ git add cpanfile app.psgi
$ git commit -m "initial commit"
Create a new Heroku app with heroku-buildpack-perl to run cpanm:
$ heroku create --stack cedar --buildpack https://github.com/miyagawa/heroku-buildpack-perl.git
$ git push heroku master
The error log contains
! Installing XML::LibXSLT failed. See /app/.cpanm/work/1412752363.1663/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'XML::LibXSLT' is not installed
! Bailing out the installation for ..
To get more verbose error message, try to install by hand:
$ heroku run cpanm --verbose XML::LibXSLT
The fails with the following error
....
LD_RUN_PATH="/usr/lib" cc -shared -O2 -g -L/usr/local/lib -fstack-protector LibXSLT.o perl-libxml-mm.o -o blib/arch/auto/XML/LibXSLT/LibXSLT.so \
-L/usr/lib -lxslt -lxml2 -lz -lm -lexslt -lgdbm -lgdbm_compat -ldl -lm -lpthread -lc -lcrypt \
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/XML/LibXSLT/LibXSLT.so] Error 1
FAIL
! Installing XML::LibXSLT failed. See /app/.cpanm/work/1412753360.2/build.log for details. Retry with --force to force install it.
As noted above, Heroku has installed Ubuntu packages libgdbm3 and libxslt1-dev (confirm with heroku run dpkg --get-selection) so I wonder why compilation still fails.

Just try to install the developer package of libgdbm
apt-get install libgdbm-dev
CPAN needs often the dev-packages to install the modules.

Related

daq with error make: *** [Makefile:344: Makefile.in] Error 1

I learn about Snort and when I install it, I must install daq. When I implement./configure && make && sudo make install I see this warning:
cd . && /bin/bash /home/snort/snort_src/daq-2.0.7/missing automake-1.15 --foreign
/home/snort/snort_src/daq-2.0.7/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
http://www.gnu.org/software/automake
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
http://www.gnu.org/software/autoconf
http://www.gnu.org/software/m4/
http://www.perl.org/
make: *** [Makefile:344: Makefile.in] Error 1
I installed autoconf, automake 1.16.1, imlement autoreconf -f -i before but not succeed.
Someone can help me fix it?
Since your installing daq-2.0.7, I assume you are installing snort version ~2.9.And which version of linux/unix OS your testing installation with?
If your on Centos7.7, here a list of neccessary packages
yum update -y
yum install epel-release -y
yum install gcc gcc-c++ libnetfilter_queue libnetfilter_queue-devel git flex bison zlib zlib-devel pcre pcre-devel libdnet libdnet-devel tcpdump libnghttp2 wget xz-devel lzma -y
See snort documents for more details: https://www.snort.org/documents

Can't install XML::Simple on Perlbrew

I'm trying to install XML::Simple under Perlbrew but am hitting an error that seems like it requires root access to fix. However, the whole purpose of using perlbrew (or one of them, at least) is to disassociate your perl environment from the OS installed perl version.
I've installed perlbrew (5.10.1, legacy code requirement) and several modules. It is currently functioning as expected. However, I get an error when trying to install XML::Simple.
$ cpanm XML::Simple
--> Working on XML::Simple
Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-Simple-2.25.tar.gz ... OK
Configuring XML-Simple-2.25 ... OK
==> Found dependencies: XML::SAX::Expat
--> Working on XML::SAX::Expat
Fetching http://www.cpan.org/authors/id/B/BJ/BJOERN/XML-SAX-Expat-0.51.tar.gz ... OK
Configuring XML-SAX-Expat-0.51 ... OK
==> Found dependencies: XML::Parser
--> Working on XML::Parser
Fetching http://www.cpan.org/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz ... OK
Configuring XML-Parser-2.44 ... OK
Building and testing XML-Parser-2.44 ... FAIL
! Installing XML::Parser failed. See /home/user1/.cpanm/work/1532923694.18203/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'XML::Parser' is not installed
! Bailing out the installation for XML-SAX-Expat-0.51.
! Installing the dependencies failed: Module 'XML::SAX::Expat' is not installed
! Bailing out the installation for XML-Simple-2.25.
$
Here's the output of the log file (cut down to the pertinent part):
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
Running Mkbootstrap for Expat ()
chmod 644 "Expat.bs"
"/home/user1/perl5/perlbrew/perls/perl-5.10.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Expat.bs ../blib/arch/auto/XML/Parser/Expat/Expat.bs 644
"/home/user1/perl5/perlbrew/perls/perl-5.10.1/bin/perl" "/home/user1/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/ExtUtils/xsubpp" -noprototypes -typemap '/home/user1/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/ExtUtils/typemap' -typemap /home/user1/.cpanm/work/1532923694.18203/XML-Parser-2.44/Expat/typemap' Expat.xs > Expat.xsc
mv Expat.xsc Expat.c
cc -c -m32 -march=i686 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"2.44\" -DXS_VERSION=\"2.44\" -fPIC "-I/home/user1/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/x86_64-linux/CORE" Expat.c
Expat.xs:12:19: fatal error: expat.h: No such file or directory
#include <expat.h>
^
compilation terminated.
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/home/user1/.cpanm/work/1532923694.18203/XML-Parser-2.44/Expat'
make: *** [subdirs] Error 2
-> FAIL Installing XML::Parser failed. See /home/user1/.cpanm/work/1532923694.18203/build.log for details. Retry with --force to force install it.
-> FAIL Installing the dependencies failed: Module 'XML::Parser' is not installed
-> FAIL Bailing out the installation for XML-SAX-Expat-0.51.
-> FAIL Installing the dependencies failed: Module 'XML::SAX::Expat' is not installed
-> FAIL Bailing out the installation for XML-Simple-2.25.
~
I have tried installing expat locally via:
wget https://sourceforge.net/projects/expat/files/expat/2.2.4/expat-2.2.4.tar.bz2
tar xjf expat-2.2.4.tar.bz2
cd expat-2.2.4
./configure --prefix=/home/user1/perl5/perlbrew/perls/perl-5.10.1/
make
make install
I've verified that expat.h is in ~/perl5/perlbrew/perls/perl-5.10.1/include. I updated my path to include that location.
Every fix I see is to install expat via the operating system tools (for the various flavors).
The issue is that I don't have root access and while I can technically ask the admin to install it, my project requires a solution that doesn't require root access as it will be copied through multiple environments and servers.
Is there a way to install XML::Simple without expat? Or a way to install expat in perlbrew such that XML::Simple will find it and use it?
Install XML::Parser manually and tell ExtUtils::MakeMaker where to find the C libraries. See INC and LIBS.
cpanm --look XML::Parser
PERLPREFIX=/home/user1/perl5/perlbrew/perls/perl-5.10.1/
perl Makefile.PL INC=-I$PERLPREFIX/include LIBS=-L$PERLPREFIX/lib
make && make test && make install
If you use cpan instead of cpanm, you can make this hands-off and permanent. Set the option makepl_arg, e.g. by running at the CPAN shell prompt):
o conf makepl_arg "INC=-I/home/user1/perl5/perlbrew/perls/perl-5.10.1/include LIBS=-L/home/user1/perl5/perlbrew/perls/perl-5.10.1/lib"
o conf commit
P.S. expat 2.2.5 is out

sslscan.c:94:25: fatal error: openssl/err.h: No such file or directory compilation terminated. #163

I am need to install sslscan tool for ssl scanning (from here) in ubuntu virtual machine (virtualbox).
Following their installation instructions provided here, I installed openssl-chacha from here. Note that I am aware that this fork of openssl contains weak cipehrs (I use the tool and openssl for testing-scanning purposes not real application).
Then, after installing the above openssl, the first thing I did is executing: make. Note that it is unclear to me when to use these commands that he sslscan mentioned here (I did not execute them). But I want to use the chacha version of openssl:
apt-get install build-essential git zlib1g-dev
apt-get build-dep openssl
make static
When I try to run the command: make I get this error:
make: git: Command not found
cc -o sslscan -Wall -Wformat=2 -Wformat-security -pie -z relro -z now -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl -DVERSION=\"1.11.11\" sslscan.c -lssl -lcrypto -ldl
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:91: recipe for target 'sslscan' failed
make: *** [sslscan] Error 1
I am in this directory: /home/myuser/Downloads/sslscan-master
I made sure that openssl in:
/usr/local/ssl
Can you please point to me what is missing? I am not familiar with Linux system (Windows user) but I prefer to use the tool in Linux. So I will appreciate your help and patience.
make: git: Command not found
So start by installing the git command:
apt-get install git
(or maybe git-core)

/usr/bin/ld: cannot find -lstdc++ for Ubuntu while trying to "swift build" Perfect2 project

Description:
I've followed the installation steps for Swift3 and Perfect2
and I've cloned the PerfectTemplate test project proposed by Perfect and I've tried swift build
Error Message:
warning: minimum recommended clang is version 3.6, otherwise you may
encounter linker errors. Linking ./.build/debug/PerfectTemplate
/usr/bin/ld: cannot find -lstdc++ clang: error: linker command failed
with exit code 1 (use -v to see invocation) :0: error: link
command failed with exit code 1 (use -v to see invocation)
:0: error: build had 1 command failures error: exit(1):
/etc/swift301/usr/bin/swift-build-tool -f
/home/XXXX/ClionProjects/PerfectTemplate/.build/debug.yaml
What I've tried:
I've gone on different SO questions that seemed similar but all on different projects and attempted to try their solutions without luck:
For example:
Matlab Kalman /usr/bin/ld: cannot find -lstdc++
I also noticed the warning coming from the clang version, I am aware that my current version is 3.4, but that is what was installed via sudo apt-get install clang as mentioned in the documentation.
I've also tried installing the 3.6 version of clang with: sudo apt-get install clang-3.n
However, after when I try swift build again I get the following error:
error: invalid inferred toolchain: could not find clang
Question:
How do I get rid of the /usr/bin/ld: cannot find -lstdc++ error, so I can build the PerfectTemplate project?
Try this. It might not work, but it's worth a shot.
Update packages and dependencies:
sudo apt-get update
Then install clang 3.6:
sudo apt-get install clang-3.6
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
I hope this helps, but apologies if it doesn't. Best of luck!
If this error appears:
/usr/bin/ld.gold: error: cannot open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../libstdc++.‌​so: No
such file or directory
It's most likely that the libstdc++.so symbolic link points to an inexisting file.
In my case it was pointing to:
/usr/lib/libstdc++.so -> /usr/lib/libstdc++.so.6
Which was incorrect because libstdc++.so.6 did not exist in that area. Simply find it's location via: sudo find / -name libstdc++.so.6 which gave me:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Then recreate the link with:
sudo rm /usr/lib/libstdc++.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so
sudo apt-get install build-essential
I faced with same problem and update-alternatives didn't help me, but after
sudo apt-get update && sudo apt-get upgrade
swift build ran successfully. Looks like some dependencies were deprecated.

linking to python library using EPD Canopy

Summary: I'm trying to install the theano python package, and the theano install can't find "-lpython2.7" in my EPD Canopy installation.
More details: Recently I installed the Enthought EPD Canopy python distribution (64-bit academic) in OS X 10.6.8. Next I installed pip via "easy_install pip".
Next I installed Theano via "sudo pip install theano". The install looks OK, but then python -c "import theano" fails. The full output is at https://gist.github.com/anonymous/5548936, but it seems like the main point is:
Problem occurred during compilation with the command line below:
g++ -dynamiclib -g -D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY -D NPY_ARRAY_ALIGNED=NPY_ALIGNED -D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE -D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL -D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS -D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS -fPIC -undefined dynamic_lookup -m64 -I/Users/rkeisler/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/core/include -I/Applications/Canopy.app/appdata/canopy-1.0.0.1160.macosx-x86_64/Canopy.app/Contents/include/python2.7 -o /Users/rkeisler/.theano/compiledir_Darwin-10.8.0-x86_64-i386-64bit-i386-2.7.3/lazylinker_ext/lazylinker_ext.so /Users/rkeisler/.theano/compiledir_Darwin-10.8.0-x86_64-i386-64bit-i386-2.7.3/lazylinker_ext/mod.cpp -L/Applications/Canopy.app/appdata/canopy-1.0.0.1160.macosx-x86_64/Canopy.app/Contents/lib -lpython2.7
===============================
ld: library not found for -lpython2.7
collect2: ld returned 1 exit status
I've had some discussions with the theano google group, and the main message I get is to look for "libpython2.7.so", which I can't find. I checked /Users/rkeisler/Library/Enthought/Canopy_64bit/User/lib/. Inside is python2.7/os.py and python2.7/site-packages, but no "libpython*" files.
I also did a more thorough check for libpython* files. The only things I could find were:
/usr/lib/python2.5/config/libpython2.5.a
/usr/lib/python2.6/config/libpython2.6.a
/usr/lib/libpython.dylib
/usr/lib/libpython2.5.dylib
/usr/lib/libpython2.6.dylib
Finally, on the EPD Canopy package list, I see "libpython" listed. However, when I try to install libpython using the Canopy package manager, "libpython" doesn't appear. It's not an available package. I'm not sure where to go from here.
Following #RobertKern# information, it is now fixed in the development version of Theano.
To update to the development version, do:
pip -U --no-deps git+git://github.com/Theano/Theano.git