Issues seen during compilation of Net::SSLeay on linux and windows - perl-module

We have downloaded Net::SSLeay module source from cpan and would like to compile it locally and use it. We are facing issues in two situations.
We need your suggestions on couple of items:
1) We need to use Net::SSLeay module. We have compiled it on Linux x86_64 box using the following statements:
perl Makefile.PL INC=-I”/include" LIBS=-L” /lib"
This generates a Makefile which doesn’t seem to use –lcrypto option. I want to use this option since we are seeing the following error at the runtime:
undefined symbol: X509_EXTENSION_free
From the below link, it appears that we need to include –lcrypto option. Please help us how to include this option. I tried looking into Makefile.pl but could not understand much since I am new to this Makefile.
http://w3facility.org/question/what-is-undefined-symbol-x509_extension_free/
2) Secondly, while building on Windows, we need to include openssl_path, but INC= and LIBS= doesn’t seem to work. Openssl libraries are already present in a local directory. Please let us know how to include the path with the #perl Makefile.pl option.
Your suggestions will be very much appreciated.

I don't know if it may help you, but I had a similar issue with Net::SSLeay when trying to install LWP::Protocol::https (in my custom path /root/perl):
debian:~# apt-get install libssl-dev
debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
Can't load '/root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay: /root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so: undefined symbol: X509_EXTENSION_free at /root/perl/lib/5.14.2/armv5tejl-linux/DynaLoader.pm line 190.
As suggested HERE, I solved by manually compiling Net-SSLeay-1.74 in this way:
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# perl Makefile.PL LIBS="-L/root/perl/lib -lssl -lcrypto -lcrypt3" INC="-I/root/perl/include"
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make install
Then it works correctly:
debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
debian:~#

Related

MSYS2: pkg-config doesn't resolve/list dependencies of gtk+-3.0

after I successfully set up my gcc/g++ environment under my Linux installation, I decided to do that for my Windows 11 machine as well. For that purpose I decided to use MSYS2. With the help of that handy tool I quickly installed MinGW as well as corresponding libraries.
One library which gives me headache (under Windows) is pkg-config. But before the installation of pkg-config, I installed gtk-3.0 first. I just installed it with the following command:
pacman -S mingw-w64-x86_64-gtk3
After that I installed pkg-config with the following command:
pacman -S mingw-w64-x86_64-pkg-config
After that, I tried to get all include and library flags for gtk3:
pkg-config --cflags gtk+-3.0
However after entering that command, the following error message occurs:
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
The thing is that this exact command works like a charm under my Linux installation but somehow pkg-config can't find the package in the pkg-config search path. Why is that the case? Is that a known problem within the MSYS2 environment?
I would appreciate every tip I can get from you.
Thank you in advance!
EDIT: It looks like I just had to start the MinGW64 shell and not the one from MSYS2. Within that environment the files can be found and no error will occur. Thanks #HolyBlackCat!
The following answer is outdated, written in italic style and shouldn't be followed.
I just solved it by myself. I found out that I had to copy all .pc files from msys64\mingw64\lib\pkgconfig to the path I get from echoing PKG_CONFIG_PATH:
echo $PKG_CONFIG_PATH
gives me
/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
So I just copied the files to /usr/lib/pkgconfig - problem solved!
Thank you anyway! :)

Error during RNNLib configuration: netcdfcpp.h cannot be found

When attempting to compile RNNLib, I got an error in NetcdfDataset.hpp:26:24 saying that Netcdfcpp.h could not be found. I looked around and found a bug report from 2011 that suggested that this was a bug, but it claimed to have been fixed. I have tried everything I can think of, including rebuilding NetCDF (a dependency of RNNLib) with various different flags, and have been unable to fix this bug. Can anyone give me a hand?
I had some trouble on a virtual machine building rnnlib.
I had to install the C and C++ version of NetCDF to get it to work.
The C version can be installed via sudo apt-get install libnetcdf-dev
I had to install the C++ version by building it.
Hope it will help. It's quite a difficult lib to install.
Maybe this helps someone: you can avoid some of the pain by installing packages from APT, and access the correct version mentioned by user3620756, which contains the netcdfcpp.h header file
. This happens through a legacy package, available on Ubuntun 16.04 (Xenial universe, see APT repository).
First install libnetcdf for C, then install libnetcdf-cxx-legacy-dev which should depend on libnetcdf-c++4 and install required C++ libraries on the go:
sudo apt install libnetcdf-dev libnetcdf-cxx-legacy-dev
The newest version doesn't have this netcdfcpp.h file anymore.
I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working.
I have also followed the same process and it worked for me
"The newest version doesn't have this netcdfcpp.h file anymore. I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working."
After downloading the folder, I had to build it by entering into the netcdf folder. I used simple command for the task :
.\configure
make
sudo make install
But in the file named as "NetcdfDataset.hpp", I have to give the complete path of the netcdfcpp.h file. For my case the path of the include file is :
#include "/Volumes/Macintosh_HD_2/WordSpottingProj/trunk/CODE C++/rnnlib_source_forge_version/netcdf-cxx-4.2/cxx/netcdfcpp.h"
I had this problem in the context of trying to use a makefile that called for netcdfcpp.h:
$ make -f makefile_MAC
c++ -O2 -o burn7.x burn7.cpp -I/opt/local/include -L/opt/local/lib -lm -lnetcdf_c++
burn7.cpp:31:10: fatal error: 'netcdfcpp.h' file not found
#include <netcdfcpp.h>
^
1 error generated.
make: *** [burn7.x] Error 1
I'm on a Mac, so I used Homewbrew to install the NetCDF package, but version 4.3.3.1 didn't appear to have netcdfcpp.h:
brew install homebrew/science/netcdf
However, I found that installing it with an additional flag resulted in this version being included:
brew install homebrew/science/netcdf --with-cxx-compat
I assume that the same is true of other installation/compilation methods, and not that this file has been taken out of versions since 4.2 as others answers state. Maybe it was a default option before and now it isn't?

automake configure ignoring option --with-libxml2=yes

I am trying to compile, libgphoto2 with libxml2 support followint the guidelines here. Everything is ok until I try to run ./configure:
./configure --prefix=/tmp/gphoto2/local --with-libxml2=yes
That appears to me as a correct syntax, however I got an output:
LIBXML2 to support Olympus ..: no
I have checked this in 2 different systems (LinuxMint 11 x64 and Ubuntu 13.04), and I have found the same problem.
Can anyone give me a clue or solution?
Is there any problem with the syntax?
Is there a common problem with the configure --with-PACKAGE[=yes] option?
Is there a common problem with LIBXML2 used in compilation?
Thanks for any help!
This problem as appears on Debian Wheezy (Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux) and the latest libgphoto2 release 2.5.2
libxml2-dev package is installed :-
Package: libxml2-dev
State: installed
Automatically installed: no
Multi-Arch: same
Version: 2.8.0+dfsg1-7+nmu1
Not totally familiar with configure scripts
but configure.ac file has line:-
AC_CHECK_HEADER(libxml/parser.h,[
which I assume looks for libmxl/parser.h
the libxml2-dev package delivers the file
/usr/include/libxml2/libxml/parser.h
It looks like libgphoto2 is designed for libxml2 library in a different place
Tried various solutions but only the following worked
as root I sym linked libxml2 to the place libgphoto2 was looking
ln -s /usr/include/libxml2/libxml /usr/include/libxml
After compiling libgphoto2 and gphoto2 this enabled gphoto2 to talk to my Olympus E-510
Bug raised on gphoto sourceforge site (https://sourceforge.net/p/gphoto/bugs/953/) and a patch fix has been provided
Just found another way. Thanks for your help.
After digging in the config.log file created after the ./configure tool, I found the libxml2 error (that I wrongly supposed to stop the configure script):
conftest.c:75:27: fatal error: libxml/parser.h: No such file or directory
But I knew it was there but can't find it! So I checked it and found it under
/usr/lib
And found somewhere else that libxml2 package comes with a script (xml2-config) to give library linking information and more so:
$ xml2-config --cflags
-I/usr/include/libxml2
And the just needed to add the output to the CFLAGS environment variable when configuring:
$ CFLAGS="-I/usr/include/libxml2" ./configure --prefix=/tmp/gphoto2/local --with-libxml2=yes
And everything else was just ok!
Usually, a --with-some-package=yes option checks for the existence of header files for some-package on your system. If it doesn't find the required header files, then it still outputs "no" to the terminal. Have you installed your distribution's libxml2-devel (or similarly named) package?

Errors when installing a Perl module using make - Mac OSX 10.7

The problem:
I can't seem to install perl modules correctly, JSON-2.53 in particular.
I have done the following:
Searched for a similar problem and tried its solution - did not work.
perl ".../config.h, needed by `Makefile'" not working after OSX Lion upgrade
Installed XCode command line developer utilities (c compiler, make, etc)
Read version compatibility documentation on this particular perl module: http://metacpan.org/pod/JSON
Ran the following commands to make and install the desired perl module:
$perl Makefile.PL
Welcome to JSON (v.2.53)
If you install JSON::XS v.2.27, it makes JSON faster.
************************** CAUTION **************************
This is 'JSON version 2' and there are many differences *
to version 1.xx *
Please check your applications useing old version. *
See to 'INCOMPATIBLE CHANGES TO OLD VERSION' and 'TIPS' *
Writing Makefile for JSON
(verified that the Makefile has been written)
$make
make: *** No rule to make target `/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/config.h', needed by `Makefile'. Stop.
What does that error even mean? What can I do to successfully make install this module?
Here are some additional items that may help you assist me in debugging this issue:
$which make
/Applications/Xcode.app/Contents/Developer/usr/bin/make
$which perl
/usr/bin/perl
$perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level
I think you need to download and reinstall XCode. If I recall correctly for 10.7, after downloading Xcode from the app store it drops an installer into your Applications folder. You need to run it and try installing the command line tools again (from Xcode's prefernces pane). I know you mentioned you did this already, but a bit more background might explain why it's worth another try.
Here are the relevant lines in the Makefile from my Mac:
PERL_INC = /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
Later on in the Makefile CONFIGDEP is used as a dependency in a target. I believe in your case make is looking for /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/config.h and can't find it. The error you're seeing is make's obtuse way of saying file not found.
config.h contains specific information about the OS but is not needed for running scripts. It's only referenced when you want to compile a module. With stock OSX you get enough perl to execute scripts. Install XCode and you get the bits (like config.h) to do perl "development". I use quotes because you can write and run perl scripts without Xcode. But as you discovered, compiling a module requires the additional files Xcode provides. (Incidentally, RedHat does the same thing. You have to install the perl-devel package to get config.h. The perl runtime is in a separate package.)
Here are some things you can try:
Verify /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/config.h exists. If not, Xcode command line utilities were not installed properly. Try it again.
If config.h exists, check its content and make sure it looks sane. It's a C header file and consists of comments and #define statements.
If you don't have access to view config.h, you have a permission issue. Try using sudo make as a bypass. Disk Utility (found in Applications -> Utilities) might be able to permanently fix this.
You could risk changing the Makefile by removing "$(PERL_INC)$(DFSEP)config.h" from CONFIGDEP. I did this on my 10.8 Mac and it worked without issue (it passed all tests as well). However, if you don't find the root cause of your config.h issue, the next time you want to install a perl module you may find yourself right back where you started.
I had this exact same error, whilst this may not be a solution for you.... after reinstalling an updated xcode compatible with the OSX version (+rebooting after the install) I still had the error - to cut a long story short I noticed there was no config.h in /CORE/ after the error.....the solution that worked was to touch config.h and create the file first and then re-run the make. Hope this helps someone.

cl.h not found - how to link in makefile

I have a project which requires opencl. I have installed CUDA and openCL on my machine but when I 'make' my project the following error occurs:
CL/cl.h: No such file or directory
I know that the i can create a hard link (in my unix (ubuntu) system) to fix the problem:
ln -s /usr/include/nvidia-current/CL
But i consider this a quick fix and not the correct solution. I would like to handle this in my makefile (i guess) so that a simple "make" command would compile. How could I do this?
You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). -I/usr/include/nvidia-current sounds like it'd work.
I saw this thread from compile opencl program using CL/cl.h file
I installed 7.5 and added below link in /usr/include, it works for my opencl program. looks like CUDA forget to implement this link after the installation.
ln -s /usr/local/cuda-7.5/include/CL /usr/include
Are you using Ubuntu or Debian distro? Then now you can use this package:
sudo apt-get install opencl-headers

Resources