cmake error with a software bam-window software - linux

I am trying to install the tool bam-window but I am getting cmake error. I downloaded the bam-window-master.zip in linux. The link of the tool is hosted in git https://github.com/genome-vendor/bam-window. I downloaded and follow the below commands.
unzip bam-window-master.zip
cd bam-window-master
mkdir build
cd build
cmake ..
On doing cmake .. After compiling I for a while I get an error
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- 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
-- Found Git: /usr/bin/git (found version "1.7.10.4")
CMake Error at cmake/GitHelper.cmake:15 (message):
Failed to get git revision, abort: fatal: Not a git repository (or any
parent up to mount point /scratch/GT)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
!
Call Stack (most recent call first):
CMakeLists.txt:9 (get_git_version_info)
How do I get rid of this and make the installation proper?

The CMakeLists.txt for this project assumes (unfortunately) that the source code is not downloaded as a zip file, but instead cloned from github.
So instead of using "Dowload ZIP" link, just clone it using regular GIT commands:
git clone https://github.com/genome-vendor/bam-window.git

Related

Q: conan error: Incorrect 'clang', is not the one detected by CMake: 'GNU' when I use the option "-s build_type=Debug"

I tried to manage the gtest package by conan in my project. The conanfile.txt is as follow:
[requires]
gtest/1.10.0
[generators]
cmake
And my CMakeLists.txt is as follow:
cmake_minimum_required(VERSION 3.5)
project(TinyWebServer)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(CMAKE_CXX_STANDARD 11)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-Wthread-safety )
endif()
add_compile_options(
# -DVALGRIND
-DCHECK_PTHREAD_RETURN_VALUE
-D_FILE_OFFSET_BITS=64
-Wall
-Wno-unused-parameter
-Woverloaded-virtual
-Wpointer-arith
-Wwrite-strings
)
enable_testing()
add_subdirectory(Logger)
add_subdirectory(Tools)
add_subdirectory(Pools)
add_subdirectory(Http)
add_subdirectory(Timer)
add_subdirectory(Net)
add_subdirectory(Test)
add_executable(${PROJECT_NAME} main.cc Config.cc)
target_link_libraries(${PROJECT_NAME}
Threads::Threads
Log::lib
Tools::lib
Pools::lib
Http::lib
Net::lib
Timer::lib
)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_SOURCE_DIR})
When I use command which is shown below to build my project, everything goes well.
mkdir -p build/
cd build/
conan install .. --build missing -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++11 -s build_type=Release
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release
make install -j4
But when I switched the build_type option from Release to Debug, just like :
conan install .. --build missing -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++11 -s build_type=Debug
I got some error message :
phoenix#phoenix-virtual-machine:~/MyProject/MyTinyWebServer/build$ conan install .. --build missing -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++11 -s build_type=Debug
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=clang
compiler.libcxx=libstdc++11
compiler.version=3.8
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
gtest/1.10.0: WARN: Package is corrupted, removing folder: /home/phoenix/.conan/data/gtest/1.10.0/_/_/package/d5608ac34c43db836b618b9cfd33cb77c7dec959
conanfile.txt: Installing package
Requirements
gtest/1.10.0 from 'conan-center' - Cache
Packages
gtest/1.10.0:d5608ac34c43db836b618b9cfd33cb77c7dec959 - Build
Installing (downloading, building) binaries...
gtest/1.10.0: WARN: Build folder is dirty, removing it: /home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959
gtest/1.10.0: Copying sources to build folder
gtest/1.10.0: Building your package in /home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959
gtest/1.10.0: Generator cmake created conanbuildinfo.cmake
gtest/1.10.0: Calling build()
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
CMake Error at conanbuildinfo.cmake:578 (message):
Incorrect 'clang', is not the one detected by CMake: 'GNU'
Call Stack (most recent call first):
conanbuildinfo.cmake:141 (conan_check_compiler)
CMakeLists.txt:5 (conan_basic_setup)
-- Configuring incomplete, errors occurred!
See also "/home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959/CMakeFiles/CMakeOutput.log".
gtest/1.10.0:
gtest/1.10.0: ERROR: Package 'd5608ac34c43db836b618b9cfd33cb77c7dec959' build failed
gtest/1.10.0: WARN: Build folder /home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959
ERROR: gtest/1.10.0: Error in build() method, line 59
cmake = self._configure_cmake()
while calling '_configure_cmake', line 53
cmake.configure()
ConanException: Error 1 while executing cd '/home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="clang" -DCONAN_COMPILER_VERSION="3.8" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++11" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/home/phoenix/.conan/data/gtest/1.10.0/_/_/package/d5608ac34c43db836b618b9cfd33cb77c7dec959" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DCUSTOM_DEBUG_POSTFIX="d" -DBUILD_GMOCK="True" -DGTEST_NO_MAIN="False" -Dgtest_hide_internal_symbols="False" -Wno-dev '/home/phoenix/.conan/data/gtest/1.10.0/_/_/build/d5608ac34c43db836b618b9cfd33cb77c7dec959'
That really makes me confuse. The command conan install .. --build missing -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++11 -s build_type=Debug has specified the compiler to be clang. But from the message Incorrect 'clang', is not the one detected by CMake: 'GNU', it looks as if the conan detected the gcc compiler. Why this happend? And how should I do if I want to build my project to a debug version?
Thanks~
Oh, I think I have made some mistakes. To use conan install the gtest package and to build my project to debug version are two totally different things. So if I want to build my project to a debug version, I should use comand like this:
conan install .. --build missing -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++11 -s build_type=Release
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug
That the version of gtest is Release doesn't prevent me me from compiling my project to the debug version. 😅
1.conanfile.txt
[generators]
cmake
virtualenv
2.after conan install,use env
source activate.sh
cmake ..
3.quit env
source deactivate.sh

Unable to build VTK examples

I'm having lots of difficulties just building VTK examples - can someone help please?
I've downloaded and installed VTK-9.0.1 on my ubuntu 18.04.4 system. Now I want to install and run the VTK examples at this link., so I clone that repo. Then I follow the instructions to "Build all of the examples" at this link.. So I do this:
% mkdir VTKExamples-build
% cd VTKExamples-build
% cmake ../VTKExamples
cmake outputs these messages:
-- 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
-- VTKWikiExamples: Building VTKWikiExamples stand-alone
-- VTKWikiExamples: Building VTKWikiExamples stand-alone - yes
-- VTKWikiExamples: Setting executables prefix
-- VTKWikiExamples: Setting executables prefix - no
-- VTKWikiExamples: VTK VERSION: 9.0.1(OpenGL2)
-- VTKWikiExamples: Example executables are stored in /home/oreilly/VTKExamples-build/bin
-- VTKWikiExamples: Tests will not be built
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
The "No MODULES passed to vtk_modules_autoinit" error message is repeated over 400 times, and no Makefile is generated.
What am I doing wrong???
Thanks!

CMake: find_library result depends on selected compiler?

I'm confused about how find_library is supposed to work, and I don't know if this could be a CMake bug, or a misuse or misconfiguration on my part. I have installed both GCC and PGI compilers, and when I try this simple CMakeLists.txt file (with both 2.8.11 and 3.5.1):
cmake_minimum_required(VERSION 2.8.11)
find_library( LIBdl dl )
message("LIBdl ${LIBdl}")
I get the following:
$ CC=gcc CXX=g++ cmake .
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- 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/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
LIBdl /usr/lib/x86_64-linux-gnu/libdl.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/molcas-test/test/cmake
That's OK, but:
$ CC=pgcc CXX=pgc++ cmake .
-- The C compiler identification is PGI 17.1.0
-- The CXX compiler identification is PGI 17.1.0
-- Check for working C compiler: /opt/pgi/linux86-64/17.1/bin/pgcc
-- Check for working C compiler: /opt/pgi/linux86-64/17.1/bin/pgcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/pgi/linux86-64/17.1/bin/pgc++
-- Check for working CXX compiler: /opt/pgi/linux86-64/17.1/bin/pgc++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
LIBdl LIBdl-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/molcas-test/test/cmake
Note dl was not found.
Leaving out either pgcc or pgc++ causes the library to be found, so it must be something in how the compilers are configured. And yet just compiling from the command line finds dl without complain:
$ pgcc -ldl hello_world.c -o hello_world
$ ./hello_world
Hello world!
So I believe something's not right if pgcc can find the library and CMake can't. I could of course set LIB=/usr/lib/x86_64-linux-gnu before running cmake, to force a search in that directory, but that doesn't feel right.
It seems the problem is with gcc. I get /lib/x86_64-linux-gnu included in CMAKE_C_IMPLICIT_LINK_DIRECTORIES, so CMAKE_LIBRARY_ARCHITECTURE is set. But with pgcc this directory is absent and CMAKE_LIBRARY_ARCHITECTURE is empty.
And the directory is missing with pgcc, because pgcc -v doesn't include a -L/lib/x86_64-linux-gnu flag, while gcc -v does. However, ld finds libraries in the directory in either case.
So CMake is not searching libraries in the same places as ld. Should it? Is there an easy way to change this, other than, e.g., manually inspecting all files in /etc/ld.so.conf.d and setting the LIB environment variable?

Compiling OpenVAS-SMB on Debian Stretch

I'm trying to build the OpenVAS-SMB plugin on Debian Stretch from source, but it fails, although it builds successfully with the same prerequisites on Debian Jessie.
CMake confirms all required dependencies before starting to build:
root#xxxx:/home/xxxx/openvas-smb-1.0.2# cmake . && make
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.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
-- Found Perl: /usr/bin/perl (found version "5.24.1")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
-- Checking for module 'popt'
-- Found popt, version 1.16
-- Found Popt: /usr/lib/x86_64-linux-gnu/libpopt.so
-- Found GSSAPI: /usr/lib/x86_64-linux-gnu/libcom_err.so
-- Install prefix: /usr/local
-- Checking for module 'gnutls>=3.2.15'
-- Found gnutls, version 3.5.8
-- Checking for module 'glib-2.0'
-- Found glib-2.0, version 2.50.3
-- Found GnuTLS: /usr/lib/x86_64-linux-gnu/libgnutls.so (found version "3.5.8")
-- Looking for xmltoman...
-- Looking for xmltoman... /usr/bin/xmltoman
-- Looking for xmlmantohtml... /usr/bin/xmlmantohtml
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13")
-- Configuring done
-- Generating done
It builds samba and the libs correctly, but fails when it comes to winexe:
../samba/libsamba-static.a(kerberos.c.o): In function `kerberos_kinit_password_cc':
kerberos.c:(.text+0x124): undefined reference to `krb5_get_init_creds_opt_init'
kerberos.c:(.text+0x133): undefined reference to `krb5_get_init_creds_opt_set_default_flags'
kerberos.c:(.text+0x153): undefined reference to `krb5_get_init_creds_password'
kerberos.c:(.text+0x182): undefined reference to `krb5_cc_initialize'
kerberos.c:(.text+0x196): undefined reference to `krb5_cc_store_cred'
kerberos.c:(.text+0x1d2): undefined reference to `krb5_free_cred_contents'
kerberos.c:(.text+0x1e7): undefined reference to `krb5_free_cred_contents'
collect2: error: ld returned 1 exit status
winexe/CMakeFiles/winexe.dir/build.make:186: recipe for target 'winexe/winexe' failed
make[2]: *** [winexe/winexe] Error 1
CMakeFiles/Makefile2:145: recipe for target 'winexe/CMakeFiles/winexe.dir/all' failed
make[1]: *** [winexe/CMakeFiles/winexe.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
I'm guessing that there's an issue with either heimdal-dev or the libglib2.0-dev causing this.
These are the requirements for building OpenVAS-SMB besides the typical build tools: gcc-mingw-w64 libgnutls28-dev perl-base heimdal-dev heimdal-multidev libpopt-dev libglib2.0-dev
Anyone know of any differences between the libs that could make the build fail on Stretch, but work on Jessie? Or maybe can provide a hint on how to do further troubleshooting?
Thanks!

cmake kdev-executebrowser plugin for kdevelop

I am trying to install kdev-executebrowser from https://github.com/KDE/kdev-executebrowser into kdevelop.
So I cloned the plugin from git hub and tried to cmake and got an error (please check the quote below).
I can't figure how how to solve this. Please help
I also attached my system info and hope it might help
System Info
waleed#waleed-Dell-System-Inspiron-N411Z:~/Downloads/kdev-executebrowser$
cmake .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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 CMake Error at /usr/share/cmake-3.5/Modules/FindKDE4.cmake:111
(message):
ERROR: cmake/modules/FindKDE4Internal.cmake not found in
/home/waleed/.kde/share/apps;/usr/share/kubuntu-default-settings/kde4-profile/default/share/apps;/usr/share/kde4/apps Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
-- Configuring incomplete, errors occurred! See also
"/home/waleed/Downloads/kdev-executebrowser/CMakeFiles/CMakeOutput.log".
FindKDE4Internal.cmake
http://packages.ubuntu.com/search?searchon=contents&keywords=FindKDE4Internal.cmake&mode=exactfilename&suite=saucy&arch=any
The missing package is usually kdelibs5-dev.

Resources