Unsupported protocol while download tar.gz package - linux

I have just upgrade my CMake from version 2.8 to 3.2.
It's working like a charm in CMake 2.8 but, after the upgrade, it's failing.
I'm trying to build third party library using ExternalProject_Add() CMake function.
ExternalProject_Add(
luacov
URL https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
DOWNLOAD_DIR ${EXTERNAL_PROJECT_DOWNLOAD_DIR}
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE}
SOURCE_DIR ${EXTERNAL_PROJECT_SRC_DIR}/luacov
BINARY_DIR ${EXTERNAL_PROJECT_BUILD_DIR}/luacov
UPDATE_COMMAND ""
PATCH_COMMAND ""
)
MY OBSERVATION:
Using GIT_REPOSITORY option, ExternalProject_Add() allow http and https protocol to download external project.
Using URL option, ExternalProject_Add() only allow http, but not https protocol to download external project.
PROBLEM:
Is there any way to download and build external project using https protocol?
ERROR:
[ 16%] Performing download step (download, verify and extract) for 'luacov'
-- downloading...
src='https://github.com/keplerproject/luacov/archive/v0.7.tar.gz'
dst='/home/build/my_build/external_projects/downloads/v0.7.tar.gz'
timeout='none'
CMake Error at /home/build/my_build/luacov-prefix/src/luacov-stamp/download-luacov.cmake:21 (message):
error: downloading
'https://github.com/keplerproject/luacov/archive/v0.7.tar.gz' failed
status_code: 1
status_string: "Unsupported protocol"
log: Protocol "https" not supported or disabled in libcurl
Closing connection -1
make[3]: *** [luacov-prefix/src/luacov-stamp/luacov-download] Error 1
make[2]: *** [CMakeFiles/luacov.dir/all] Error 2
make[1]: *** [CMakeFiles/luacov.dir/rule] Error 2
make: *** [luacov] Error 2

The problem may be that the CURL library shipped with CMake isn't build with SSL support by default. I had to compile cmake with:
./bootstrap --system-curl
make
sudo make install
... and that worked, because my system's curl has SSL support.

What it worked for me is the following:
Update openssl
sudo apt-get install openssl libssl-dev
Modify bootstrap file to enable CMAKE_USE_OPENSSL. Replace this line by:
cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"
Run bootstrap script normally in cmake folder
/#path_to_cmake/bootstrap

In my ExternalProject_Add(), I have use GIT_REPOSITORY insted of URL option.
#URL https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
GIT_REPOSITORY https://github.com/keplerproject/luacov.git
And luacov download and build successfully.
For any https protocol use DOWNLOAD_COMMAND option of ExternalProject_Add() function.
DOWNLOAD_COMMAND wget https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
and its working as expected.
Thanks.

I was having the same problem building a library in a computer in which CMake had not support to https protocol.
I had to build cmake myself with the option -DCMAKE_USE_OPENSSL=ON as suggested by #dekkard's comment.

For CMake 3.8.0 this worked for me:
Install/update openssl:
yum install openssl openssl-devel
Adapt the solution from a CMake forum reply by Brad King:
./configure --prefix=/software/cmake-3.8.0/ --parallel=${NPROC} -- \
-/DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON
make -j ${NPROC}
make install
Enjoy!

Looks like with Cmake 3.2.1 it works as expected.
Here's my sample project/CMakeLists.txt:
PROJECT(TestDownload)
SET(CMAKE_CXX_COMPILER "/path/to/bin/g++")
SET(CMAKE_C_COMPILER "/path/to/bin/gcc")
SET(CMAKE_CXX_FLAGS "")
SET(CMAKE_C_FLAGS "")
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
ExternalProject_Add(
luacov
URL https://github.com/keplerproject/luacov/archive/v0.7.tar.gz
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/luacov
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
)
And the commands:
$ cd project
$ mkdir build && cd build
$ cmake ..
...
$ make all
Scanning dependencies of target luacov
[ 12%] Creating directories for 'luacov'
[ 25%] Performing download step (download, verify and extract) for 'luacov'
-- downloading...
src='https://github.com/keplerproject/luacov/archive/v0.7.tar.gz'
dst='/tmp/project/build/luacov/v0.7.tar.gz'
timeout='none'
-- [download 7% complete]
-- [download 21% complete]
-- [download 76% complete]
-- [download 100% complete]
-- downloading... done
-- verifying file...
file='/tmp/project/build/luacov/v0.7.tar.gz'
-- verifying file... warning: did not verify file - no URL_HASH specified?
-- extracting...
src='/tmp/project/build/luacov/v0.7.tar.gz'
dst='/tmp/project/build/luacov-prefix/src/luacov'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 37%] No patch step for 'luacov'
[ 50%] No update step for 'luacov'
...

I will often just modify the url from https to http.

Related

binutils not able to find isl

yes this question has been asked before. no the other answers doesn't solve my problem.
I have just built isl from source both 0.15 and 0.22.
I have isl and I know where it is and I am amazed that even though I have pointed to where the program is in configure binutils can't find it.
It did work a few months ago to do it this way.
../gitrepos/binutils/configure --prefix=/tools --with-sysroot=x86_64-w64-cygwin --with-lib-path=/tools/lib --disable-nls --disable-werror lt_cv_objdir=.libs --target=x86_64-w64-cygwin --with-isl=/home/brazg/usr/isl/0.22
I am getting the following error: required isl version is 0.15 or
later configure: error: Unable to find a usable isl. See config.log
for details.
/tmp/cc3B0zAy.s: Assembler messages:
/tmp/cc3B0zAy.s:14: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:14: Error: junk at end of line, first unrecognized character is `-'
/tmp/cc3B0zAy.s:20: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:20: Error: unknown pseudo-op: `.lvu1'
/tmp/cc3B0zAy.s:23: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:23: Error: unknown pseudo-op: `.lvu2'
configure:5079: $? = 1
configure: failed program was:
Yes I am aware that there are a whole lot of assembler errors because of the version of GCC in Cygwin. I am trying to replace it by building a more current version of gcc.
This is a common problem I have been running into. when building some source code in Cygwin. It seems one of the programs that runs into this is binutils...
I'm not sure what to do.
and yes, I could try cross compiling in Linux, no I don't want to and I'm hoping I don't have to. I'd like to do this naively to Windows if I can.
It seems to me that you are complicating yourself the life (x86_64-pc-cygwin is platform specific, not your choice) and you should start using the standard cygport tool, the same configuration already used for the binutils cygwin package and the isl 0.16.1 available. When you have problem with configure the proper config.log will provide the hint on what is going wrong.
Herebelow the a recipe to build the last released binutils 2.33.1 and create a cygwin package. For my test I am using the stable packages:
$ cygcheck -cd binutils gcc-core libisl-devel
Cygwin Package Information
Package Version
binutils 2.31.1-1
gcc-core 7.4.0-1
libisl-devel 0.16.1-1
but you can also try with the test 8.3.0-1 gcc compiler.
Download the source package and extract the binutils.cygport
$ wget http://mirrors.kernel.org/sourceware/cygwin/x86/release/binutils/binutils-2.31.1-1-src.tar.xz
$ tar -xf binutils-2.31.1-1-src.tar.xz
$ cp binutils-2.31.1-1.src/binutils.cygport .
Adjusting the cygport file to build from release 2.33.1 and not from git
$ cat binutils.cygport
TOOLCHAIN_TARGET="native"
# GIT_URI="git://sourceware.org/git/binutils-gdb.git"
# inherit toolchain git
# GIT_REV=be46fa23042ec88a7a42030476a301bf72a80e7e
# SRC_DIR=binutils-gdb
NAME="binutils"
VERSION=2.33.1
RELEASE=1
CATEGORY="Devel"
SUMMARY="GNU assembler, linker, and similar utilities"
DESCRIPTION="This directory contains various GNU compilers, assemblers, linkers,
debuggers, etc., plus their support routines, definitions, and documentation."
HOMEPAGE="http://www.gnu.org/software/binutils/"
case ${VERSION} in
*.*.[5-9][0-9])
SRC_URI="ftp://sourceware.org/pub/binutils/snapshots/binutils-${VERSION}.tar.bz2" ;;
*) SRC_URI="mirror://gnu/binutils/binutils-${VERSION}.tar.xz"
SRC_DIR=${PN}-${PV}
;;
esac
#PATCH_URI+=" 2.24.51-shared-libs.patch"
#2.24.51-ld-__dso_handle.patch
#PATCH_URI+="
#2.24.51-ld-__dso_handle.patch
#detect-rebasing-and-compute-an-address-bias.patch
#"
#PATCH_URI="e643cb45bf85fa5c8c49a89ff177de246af4212e.patch"
# gdb,etc.: https://sourceware.org/ml/binutils/2014-01/msg00341.html
# for shared libbfd/libopcodes, add:
# --enable-shared
CYGCONF_ARGS="
--enable-install-libiberty
--disable-gdb
--disable-libdecnumber
--disable-readline
--disable-sim
--enable-64-bit-bfd
"
# --enable-targets=i686-efi-pe,x86_64-efi-pe,ia64-efi-elf,x86_64-pc-cygwin,i686-pc-cygwin
src_install() {
cd ${B}
cyginstall
# for shared libbfd/libopcodes, add:
# APIs are unstable, do not allow linking against DLLs
# rm -f ${D}/usr/lib/*.dll.a
# sed -i -e '/^library_names=/d' ${D}/usr/lib/lib*.la
}
As you can note that I have NOT changed the arguments of binutils configuration. So now I can build the 2.33.1 package:
$ cygport binutils.cygport download
...
binutils-2.33.1.tar 100%[===================>] 20.50M 1.50MB/s in 15s
2020-01-04 17:07:52 (1.38 MB/s) - ‘binutils-2.33.1.tar.xz.tmp’ saved [21490848/21490848]
$ cygport binutils.cygport almostall
>>> Preparing binutils-2.33.1-1.x86_64
>>> Unpacking source binutils-2.33.1.tar.xz
>>> Preparing working source directory
...
>>> Creating source patches
0 files changed
>>> Creating source package
binutils-2.33.1-1.src/
binutils-2.33.1-1.src/binutils-2.33.1.tar.xz
binutils-2.33.1-1.src/binutils.cygport
>>> binutils requires: cygwin libgcc1
and you can also test the build:
$ cygport binutils.cygport check
=== binutils Summary ===
# of expected passes 136
# of unexpected failures 1
# of expected failures 1
# of unsupported tests 5
I notice an hang at the end of the test, but the check seems completed, co it could be to other factors that I will not investigate.

Error installing nokogiri: Failed to build gem native extension

I want to execute the following command
bundle install && rake install
but an error comes up and I try to figure out whats going on. I found that i need to install nokogiri. But when I try to install it an error comes up again. Any ideas? :/
sudo gem install nokogiri -v '1.8.5'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181210-12550-orku3c.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.5
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/gem_make.out

How to build OpenSSH with no dependence on OpenSSL?

I am trying to build OpenSSH 7.3 without OpenSSL.
I ran $ ./configure --without-openssl.
And then running either $ make OPENSSL=no or $ make give the following error:
In file included from ../entropy.h:30:0,
from ../includes.h:174,
from arc4random.c:27:
../buffer.h:50:29: fatal error: openssl/objects.h: No such file or directory
compilation terminated.
make[1]: *** [arc4random.o] Error 1
make[1]: Leaving directory /local/store/openssh/openssh-7.3p1/openbsd-compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
These includes are not properly wrapped with #ifdef WITH_OPENSSL, so are still reachable. What am I doing wrong?
How do I configure and build OpenSSH 7.3 without OpenSSL dependencies?
It seems that as of version 6.8 OpenSSH can be built without OpenSSL. From 6.8 release notes:
Support --without-openssl at configure time
Disables and removes dependency on OpenSSL. Many features,
including SSH protocol 1 are not supported and the set of crypto
options is greatly restricted. This will only work on systems
with native arc4random or /dev/urandom.
Also I found this message on OpenBSD CVS:
CVSROOT: /cvs
Module name: src
Changes by: markus#cvs.openbsd.org 2014/04/29 12:01:49
Modified files:
usr.bin/ssh : Makefile.inc auth.c authfd.c authfile.c
bufaux.c cipher.c cipher.h hostfile.c kex.c
key.c mac.c monitor.c monitor_wrap.c
myproposal.h packet.c roaming_client.c
ssh-agent.c ssh-keygen.c ssh-keyscan.c
ssh-keysign.c ssh-pkcs11.h ssh.c sshconnect.c
sshconnect2.c sshd.c
usr.bin/ssh/lib: Makefile
usr.bin/ssh/ssh: Makefile
usr.bin/ssh/sshd: Makefile
Log message:
make compiling against OpenSSL optional (make OPENSSL=no);
reduces algorithms to curve25519, aes-ctr, chacha, ed25519;
allows us to explore further options; with and ok djm
I built OpenSSH 7.7p1 without openssl using:
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-privsep-path=/var/empty --libexecdir=/usr/lib/openssh --without-openssl
I also used the patch from Linux From Scratch.

Changing python headers directory for configure

I'm trying to build gnome-weather using jhbuild, but running build process results in the following errors:
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for headers required to compile python extensions... ./configure: line 14697: /usr/local/bin/python-config: No such file or directory
not found
configure: error: Python headers not found
*** Error during phase configure of gobject-introspection: ########## Error running ./autogen.sh --prefix /home/pgolinski/jhbuild/install --disable-static --disable-gtk-doc *** [7/36]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
[7] Go to phase "clean"
[8] Go to phase "distclean"
Strangely the error says that Python headers were not found even though I have python-devel installed. I managed to find python-config in usr/bin so how to change its directory for configure? Or maybe the problem lies elsewhere? (I just want to build gnome-weather)
you can download the last version of gnome-weather here:
https://git.gnome.org/browse/gnome-weather/snapshot/gnome-weather-3.14.1.zip
and compile that with these command after unzip it:
libtoolize
aclocal
autoheader
autoconf
automake --add-missing --foreign
./configure
make && make install
this should work.8y3
Here's what finally worked for me if someone struggles with something similair in future:
PYTHON=/usr/bin/python jhbuild build gnome-weather

CMake Error: The following variables are used in this project, but they are set to NOTFOUND

I am trying to configure the whalebot crawler with the tar file whalebot-0.02.00.tar.gz. I have extracted it correctly with:
root#Admin1:~/dls# tar xvzf whalebot-0.02.00.tar.gz
After that I want to configure it with:
root#Admin1:~/dls/whalebot# ./configure
It gives me error:
bash: ./configure: No such file or directory
also I have run the command:
root#Admin1:~/dls/whalebot# cmake ./
It gives me the following result:
root#Admin1:~/dls/whalebot# cmake ./
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.44.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- thread
-- program_options
-- date_time
CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):
This command specifies the relative path
../statsem_string/bin
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):
This command specifies the relative path
../3dparty/google-url
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
HTMLCXX_LIBRARY
linked by target "whalebot" in directory /root/dls/whalebot/webspider
-- Configuring incomplete, errors occurred!
How do I proceed?
It appears that CMake is unable to find the htmlcxx library.
In the whalebot documentation, htmlcxx is listed as a dependency.
You need to download htmlcxx, unzip it, then install it:
cd <path to unzipped htmlcxx>
./configure --enable-static=on --enable-shared=off
make
sudo make install
You may need to add #include <cstddef> to the top of html/tree.h to get it to build successfully. It will install to usr/local/ by default.
You also need icu installed if you don't already have it:
sudo apt-get install libicu-dev
Finally, you can now build and install whalebot. Again, making might fail if you have a reasonably up-to-date boost installation.
In line 57 of webspider/src/webspider_options.cpp, you need to replace boost::filesystem::initial_path().native_directory_string() with boost::filesystem::initial_path().string(). Then you should be good to build and install:
cd <path to unzipped whalebot>
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
This too will install to usr/local/ by default.
Check if in CMakeLists you have written find_library(..) or find_path(.), then replace it by find_package(..).
It solved the error in my case.

Resources