How to enable ccache on Linux - linux

There is very little documentation on enabling ccache on GNU/Linux. Here is a response from launchpad.net:
At the moment, I think the best way to enable ccache is to add
"/usr/lib/ccache" to the front of your path. If you want to enable it
for all users by default, change the PATH variable in
/etc/environment.
Can someone give me more information on enabling ccache?

Download latest version of ccache for better performance.
After Downloading, Follow the steps as mentioned below:
A) Tar the file using the following command :
$tar -xvf ccache-3.2.4.tar.bz2
Note : I'm using ccache 3.2.4 Version.You can download the latest one.
B) Go inside ccache-3.2.4 folder and run the following commands:
$./configure
$./make
$ sudo make install
C) Go to your .bashrc and insert the following :
export CCACHE_DIR=/home/user_name/.ccache
export CCACHE_TEMPDIR=/home/user_name/.ccache
Note : Fill user_name with your User Name
D) Save your Bashrc and source it
$ source ~/.bashrc
E) To check ccache is working or not type :
ccache -M 10G : To Set the ccache Size to 10GB
F) To check ccache is working or not type :
ccache -s : To check ccache statistics

There are at least two methods:
i) Override the CC, CXX, ... flags in a Makefile. Within the R framework, a system and optional user configuration file is read, and I simply set
VER=4.7
CC=ccache gcc-$(VER)
CXX=ccache g++-$(VER)
SHLIB_CXXLD=g++-$(VER)
FC=ccache gfortran
F77=ccache gfortran
which also allows me to switch back and forth between gcc versions. Now all compilations involving R use ccache.
ii) For other uses, I have deployed the fact that /usr/local/bin/ is checked prior to /usr/bin. So one can do
root#max:/usr/local/bin# ls -l gcc
lrwxrwxrwx 1 root root 15 Jan 27 11:04 gcc -> /usr/bin/ccache
root#max:/usr/local/bin# ./gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root#max:/usr/local/bin#
and now gcc is invoked via ccache:
edd#max:/tmp$ cp -vax ~/src/progs/C/benfordsLaw.c .
`/home/edd/src/progs/C/benfordsLaw.c' -> `./benfordsLaw.c'
edd#max:/tmp$ time /usr/local/bin/gcc -c benfordsLaw.c
real 0m0.292s
user 0m0.052s
sys 0m0.012s
edd#max:/tmp$ time /usr/local/bin/gcc -c benfordsLaw.c
real 0m0.026s
user 0m0.004s
sys 0m0.000s
edd#max:/tmp$

The ccache manual has a section called Run modes which describes the official ways of activating ccache, so I suggest reading the manual.
Also, as you already noted, Linux distributions often set up a /usr/lib/ccache directory which is designed to be prepended to PATH.

Another possibility (instead of export CC=ccache commented by Keltar), if $HOME/bin/ is listed in your $PATH before /usr/bin/, would be to make a symlink
ln -s /usr/bin/ccache $HOME/bin/gcc
Then every execvp(3) of gcc would find that symlink

Ubuntu install ccache
sudo apt-get install ccache
Confirm installation execution after installation "which ccache"
$ which ccache
/usr/bin/ccache
Add the following contents to the "~/.bashrc" or "~/.zshrc==" file
# ccache
export USE_CCACHE=1
export CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros
export CCACHE_UMASK=002
source "~/.bashrc" or "~/.zshrc"
4. The 5 GB disk space set by default for ccache is normally enough. If you are worried about it, you can increase it, ccache -M 30G
5. Confirm successful installation through version
$ ccache --version
ccache version 3.4.1
Copyright (C) 2002-2007 Andrew Tridgell
Copyright (C) 2009-2018 Joel Rosdahl
You can view the current configuration through ccache - s
cache directory /home/username/.ccache
primary config /home/username/.ccache/ccache.conf
secondary config (readonly) /etc/ccache.conf
stats zero time Fri Jul 22 16:15:40 2022
cache hit (direct) 4186
cache hit (preprocessed) 875
cache miss 1069
cache hit rate 82.56 %
called for link 653
cleanups performed 0
files in cache 3209
cache size 159.3 MB
max cache size 30.0 GB
Use libzmq to test ccache
Through github download the source code of libzmq
$ git clone https://github.com/zeromq/libzmq.git
Cloning into 'libzmq'...
remote: Enumerating objects: 43791, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 43791 (delta 11), reused 24 (delta 8), pack-reused 43755
Receiving objects: 100% (43791/43791), 21.91 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (31951/31951), done.
Create the build directory in the libzmq directory
Modify CMakeLists. txt , '+' to add
──────┬───────────────────────────────────────────────────────────────────────────────────────
│ File: CMakeLists.txt
───────┼──────────────────────────────────────────────────────────────────────────────────────
1 │ # CMake build script for ZeroMQ
2 │ project(ZeroMQ)
3 │
4 │ if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
5 │ cmake_minimum_required(VERSION 3.0.2)
6 │ else()
7 │ cmake_minimum_required(VERSION 2.8.12)
8 │ endif()
9 │
10 + │ find_program(CCACHE_FOUND ccache)
11 + │ if(CCACHE_FOUND)
12 + │ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
13 + │ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
14 + │ message(STATUS "use ccache")
15 + │ endif(CCACHE_FOUND)
16 + │
17 │ include(CheckIncludeFiles)
Execute "cmake .." In the build directory
Print and display **"-- use ccache" **means enable ccache, but note that when each project is enabled ccache for the first time, it will not speed up the compilation speed, but save the compilation cache to the "/home/username/. cache" directory for later compilation
$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- use ccache
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
...
Use the "/usr/bin/time" command to record the compilation time
/usr/bin/time make -j3
result:
48.79user 14.25system 0:21.60elapsed 291%CPU (0avgtext+0avgdata 176036maxresident)k
0inputs+282248outputs (0major+2406923minor)pagefaults 0swaps
"rm - rf *" delete build all files in the directory
cmake ..
Use the "/usr/bin/time" command to record the compilation time
/usr/bin/time make -j3
result:
2.78user 2.42system 0:02.15elapsed 241%CPU (0avgtext+0avgdata 23736maxresident)k
0inputs+21744outputs (0major+232849minor)pagefaults 0swaps
https://www.cnblogs.com/jiangyibo/p/16516932.html

Related

How to fix "error: could not find native static library `c`, perhaps an -L flag is missing?" or how do I compile rust binaries for openwrt?

I'm wanting to compile binaries for openwrt 19.07.7 on mips with limited space.
OpenWrt 19.07.7, r11306-c4a6851c72
-----------------------------------------------------
root#OpenWrt:~# df /
Filesystem 1K-blocks Used Available Use% Mounted on
overlayfs:/overlay 3392 1276 2116 38% /
root#OpenWrt:~# ls -s
662 crosshello 3 helloworld
root#OpenWrt:~# ldd --version
musl libc (mips-sf)
Version 1.1.24
Above you can see the size of crosshello (cross compiled using rust) and helloworld (cross compiled using gcc). There is limited space on the target as you can see.
I followed https://github.com/japaric/rust-cross and it works. However I had to reduce the size of the binary to get it to fit. Following https://github.com/johnthagen/min-sized-rust I got the binary (the "Cross compiling with cargo" hello world with clap from the first link) to fit. I haven't compiled my own program yet. I got stuck a the "Optimize libstd with build-std" section.
I'm getting the above error:
$ cargo +nightly build -Z build-std=std,panic_abort --target=mips-unknown-linux-musl --release
Compiling libc v0.2.106
...
error: could not find native static library `c`, perhaps an -L flag is missing?
error: could not compile `libc` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
How do I fix that? I don't want to static link against the system libc, I want it dynamically linked like other binaries on that platform. But not sure how to do that. If I use the standard libstd the binaries are dynamically linked just fine.
Alternatively I could try nostd but my code would need significant modification and I'm not sure that would fix this problem anyway. Alternatively I could just go ahead compile my actual project with libstd and it might fit. However my project is doing data logging, so the binary is competing for space with data I want to store, so I want to minimize space as much as possible.
I've also seen reference to cargo-bloat so I'll probably check that out to find what all the space is being used for in the binary.
I'm open to different strategies to achieve what I want if anyone has ideas?
On my dev system:
$ cat .cargo/config
[target.mips-unknown-linux-musl]
ar = "/home/alex/projects/openwrt-sdk-19.07.7-ath79-generic_gcc-7.5.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.5.0_musl/bin/mips-openwrt-linux-ar"
linker = "/home/alex/projects/openwrt-sdk-19.07.7-ath79-generic_gcc-7.5.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.5.0_musl/bin/mips-openwrt-linux-gcc"
$ cat Cargo.toml
#cargo-features = ["strip"]
[package]
name = "crosshello"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
clap = "3.0.0-beta.5"
[profile.release]
#strip = true
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
(The binaries are stripped, currently I'm stripping them manually.)

Cannot CMake NGraph on Raspberry Pi due to NGRAPH_VERSION

The full build log is below
I am building following NGraph instructions on https://github.com/NervanaSystems/ngraph
Looking at these I am assuming these variables
NGRAPH_VERSION
NGRAPH_VERSION_SHORT
NGRAPH_API_VERSION
did not get set for some reason, even though the instructions never specifically require them to be set
My installation steps are:
git clone https://github.com/csullivan/ngraph.git
cd ngraph
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_INSTALL_PREFIX=/home/pi/openvino_files/ngraph/install
make -j install
I tried setting them manually in the command line and in the cmake file, adding
SET(NGRAPH_VERSION 1)
SET(NGRAPH_VERSION_SHORT 1)
SET(NGRAPH_API_VERSION 1)
but the error still did not go away. And i don't want to have to set the version manually every time.
Something else is wrong here, what am I doing wrong?
What command do I need to type in to make it build correctly?
Thanks,
pi#raspberrypi:~/openvino_files/ngraph/build $ cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_INSTALL_PREFIX=/home/pi/openvino_files/ngraph/install
-- Found Git: /usr/bin/git (found version "2.20.1")
From https://github.com/csullivan/ngraph.git
CMake Error at cmake/Modules/git_tags.cmake:39 (string):
string sub-command REGEX, mode MATCH needs at least 5 arguments total to
command.
Call Stack (most recent call first):
cmake/Modules/git_tags.cmake:60 (NGRAPH_GET_TAG_OF_CURRENT_HASH)
CMakeLists.txt:21 (NGRAPH_GET_VERSION_LABEL)
CMake Error at CMakeLists.txt:27 (list):
list GET given empty list
CMake Error at CMakeLists.txt:28 (list):
list GET given empty list
CMake Error at CMakeLists.txt:29 (list):
list GET given empty list
-- NGRAPH_VERSION
-- NGRAPH_VERSION_SHORT
-- NGRAPH_API_VERSION
CMake Deprecation Warning at CMakeLists.txt:41 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Installation directory: /home/pi/openvino_files/ngraph/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/openvino_files/ngraph/build/tbb
Scanning dependencies of target ext_tbb
[ 12%] Creating directories for 'ext_tbb'
[ 25%] Performing download step (git clone) for 'ext_tbb'
Cloning into 'tbb-src'...
Switched to a new branch 'tbb_2018'
Branch 'tbb_2018' set up to track remote branch 'tbb_2018' from 'origin'.
[ 37%] No patch step for 'ext_tbb'
[ 50%] No update step for 'ext_tbb'
[ 62%] No configure step for 'ext_tbb'
[ 75%] No build step for 'ext_tbb'
[ 87%] No install step for 'ext_tbb'
[100%] Completed 'ext_tbb'
[100%] Built target ext_tbb
CMake Error at src/ngraph/runtime/interpreter/CMakeLists.txt:27 (set_target_properties):
set_target_properties called with incorrect number of arguments.
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Building Intel TBB: /usr/bin/make -j4 compiler=gcc tbb_build_dir=/home/pi/openvino_files/ngraph/build/src/ngraph/runtime/cpu/tbb_build tbb_build_prefix=tbb
CMake Warning (dev) at src/ngraph/runtime/cpu/CMakeLists.txt:125 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable TBB_ROOT is set to:
/home/pi/openvino_files/ngraph/build/tbb/tbb-src
For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found TBB and imported target TBB::tbb
-- tools enabled
-- Adding unit test for backend INTERPRETER
-- Adding unit test for backend CPU
-- unit tests enabled
-- Configuring incomplete, errors occurred!
See also "/home/pi/openvino_files/ngraph/build/CMakeFiles/CMakeOutput.log".
I suggest you use a validated OpenVINO toolkit release with all the components (including ngraph). You can download the latest Raspberry Pi OpenVINO version from https://download.01.org/opencv/2020/openvinotoolkit/2020.4/
The OpenVINO Raspberry Pi installation guide is available at
https://docs.openvinotoolkit.org/2020.4/openvino_docs_install_guides_installing_openvino_raspbian.html

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 building go compiler from source

I am trying to build the latest version (tip of the master branch) of Go from source.
The official Go documentation (https://golang.org/doc/install/source) states that you should download Go 1.4 binaries to build a more recent version. However it should be possible to build all from source.
To do this, I set variables in .bashrc :
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME
then to build go 1.4 from source :
source ~/.bashrc
git clone https://go.googlesource.com/go
mkdir ~/go1.4
cd ~/go
git archive --format=tar go1.4.3 |tar -xv -C ~/go1.4
cd ~/go1.4/src
./make.bash
and finally build the latest version :
cd ~/go/src/
GOROOT_BOOTSTRAP=$HOME/go1.4 ./make.bash
I remember doing this months ago without problems, but today I get these errors building go 1.4 make.bash:
# cmd/pprof
.../go1.4/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
.../go1.4/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
...
Is there something wrong in my method ?
The error messages point to CGO, and environment variables that control make.bash are explained at the beginning of the file :
CGO_ENABLED: Controls cgo usage during the build. Set it to 1
to include all cgo related files, .c and .go file with "cgo"
build directive, in the build. Set it to 0 to ignore them.
so if you disable CGO while building GO 1.4 :
cd ~/go1.4/src
CGO_ENABLED=0 ./make.bash
everything works and pass the tests.

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