CPM failed to get the hash for HEAD - visual-studio-2012

I'm trying to use CMake for the following CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
#-----------------------------------------------------------------------
# CPM configuration
#-----------------------------------------------------------------------
set(CPM_MODULE_NAME "arc_ball")
set(CPM_LIB_TARGET_NAME ${CPM_MODULE_NAME})
if ((DEFINED CPM_DIR) AND (DEFINED CPM_UNIQUE_ID) AND (DEFINED CPM_TARGET_NAME))
set(CPM_LIB_TARGET_NAME ${CPM_TARGET_NAME})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CPM_DIR})
include(CPM)
else()
set (CPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/cpm-packages" CACHE TYPE STRING)
find_package(Git)
if(NOT GIT_FOUND)
message(FATAL_ERROR "CPM requires Git.")
endif()
if (NOT EXISTS ${CPM_DIR}/CPM.cmake)
message(STATUS "Cloning repo (https://github.com/iauns/cpm)")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone git#github.com:iauns/cpm.git ${CPM_DIR}
RESULT_VARIABLE error_code
OUTPUT_QUIET ERROR_QUIET)
if(error_code)
message(FATAL_ERROR "CPM failed to get the hash for HEAD")
endif()
endif()
include(${CPM_DIR}/CPM.cmake)
endif()
#-----------------------------------------------------------------------
# CPM Modules
#-----------------------------------------------------------------------
# ++ MODULE: GLM
CPM_AddModule("GLM"
GIT_REPOSITORY "https://github.com/iauns/cpm-glm"
GIT_TAG "1.0.2"
USE_EXISTING_VER TRUE
EXPORT_MODULE TRUE # Use EXPORT_MODULE sparingly. We expose GLM's interface
) # through our own interface hence why we export it.
# This call will ensure all include directories and definitions are present
# in the target. These correspond to the modules that we added above.
CPM_InitModule(${CPM_MODULE_NAME})
#-----------------------------------------------------------------------
# Source
#-----------------------------------------------------------------------
# Globbing has some downsides, but the advantages outweigh the
# disadvantages.
file (GLOB Sources
"arc-ball/*.cpp"
"arc-ball/*.hpp"
)
#-----------------------------------------------------------------------
# Library setup
#-----------------------------------------------------------------------
# Build the library.
add_library(${CPM_LIB_TARGET_NAME} ${Sources})
if (NOT EMSCRIPTEN AND CPM_LIBRARIES)
target_link_libraries(${CPM_LIB_TARGET_NAME} ${CPM_LIBRARIES})
endif()
My system is windows 8.1 and I'm using Visual Studio 11 2012 as a generator. However when I try to configure, I get the following error:
CMake Error at
CMakeLists.txt:26 (message):
CPM failed to get the hash for HEAD
Meaning that it's happening on that line:COMMAND "${GIT_EXECUTABLE}" clone git#github.com:iauns/cpm.git ${CPM_DIR}
Would anyone know why?
Thanks in advance for the help.

Related

How to build libXrender

I get an error when configuring the libXrender package
checking for RENDER... configure: error: Package requirements (x11 renderproto >= 0.9) were not met:
No package 'x11' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables RENDER_CFLAGS
and RENDER_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
my configure is
./configure --prefix=/tmp/instigate-software/gnu_system/3.2/x86_64/
but when I write echo $PKG_CONFIG_PATH I get
/tmp/instigate-software/gnu_system/3.2/x86_64/lib/pkgconfig
this is what is contained in the pkgconfig folder
ls /tmp/instigate-software/gnu_system/3.2/x86_64/lib/pkgconfig/
bigreqsproto.pc freetype2.pc libpng16.pc mpfr.pc recordproto.pc videoproto.pc xcb-proto.pc xcb-sync.pc xcb-xv.pc
binutils.pc gettext.pc libpng.pc ncurses.pc renderproto.pc xau.pc xcb-randr.pc xcb-xevie.pc xcmiscproto.pc
bison.pc glproto.pc libtiff-4.pc pciaccess.pc resourceproto.pc xcb-composite.pc xcb-record.pc xcb-xf86dri.pc xdmcp.pc
compositeproto.pc gmp.pc libxcb.pc pixman-1.pc scrnsaverproto.pc xcb-damage.pc xcb-render.pc xcb-xfixes.pc xextproto.pc
damageproto.pc ice.pc libXdmcp.pc pthread-stubs.pc sigc++-2.0.pc xcb-dpms.pc xcb-res.pc xcb-xinerama.pc xf86driproto.pc
expat.pc inputproto.pc libxml-2.0.pc python-2.7.pc sm.pc xcb-dri2.pc xcb-screensaver.pc xcb-xprint.pc xineramaproto.pc
fixesproto.pc kbproto.pc libxslt.pc python.pc stdc++.pc xcb-glx.pc xcb-shape.pc xcb-xtest.pc xproto.pc
fontsproto.pc libexslt.pc m4.pc randrproto.pc tiff.pc xcb.pc xcb-shm.pc xcb-xvmc.pc zlib.pc
and this is what is contained in the renderproto.pc file
prefix=/tmp/instigate-software/gnu_system/3.2/x86_64
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: RenderProto
Description: Render extension headers
Version: 0.11
Cflags: -I${includedir}
from what can it be ?

How to set the path for module command?

This is my .modulepath file, the last two lines are the paths where I have my modules mounted from another hard drive. Even though I added these lines module avail command does not fetch me any of the modules in those folders. If anyone could help it would be of great help.
#
# #(#)$Id: 38aa24cc33a5f54a93781d63005a084f74418022 $
# Module version 3.2.10
# init/.modulespath. Generated from .modulespath.in by configure.
#
# Modulepath initial setup
# ========================
#
# This file defines the initial setup for the module files search path.
# Comments may be added anywhere, which begin on # and continue until the
# end of the line
# Each line containing a single path will be added to the MODULEPATH
# environment variable. You may add as many as you want - just
# limited by the maximum variable size of your shell.
#
/etc/environment-modules/modules
#/usr/share/modules/versions # location of version files
#/usr/Modules/$MODULE_VERSION/modulefiles # Module pkg modulefiles (if versioning)
#/usr/Modules/modulefiles # Module pkg modulefiles (if no versioning)
#/usr/share/modules/modulefiles # General module files
#/usr/Modules/3.2.10/your_contribs # Edit for your requirements
/opt/apps/modulefiles/Core
/opt/apps/modulefiles/Compiler
I have even tried using module use /opt/apps/modulesfiles/Core
user#user-N501VW:~$ module use /opt/apps/modulefiles/Core
user#user-N501VW:~$ $MODULEPATH
bash: /opt/apps/modulefiles/Core:/etc/environment-modules/modules:/usr/share/modules/versions:/usr/Modules/$MODULE_VERSION/modulefiles:/usr/share/modules/modulefiles: No such file or directory
akhila#akhila-N501VW:~$ module avail
------------------------------------------------------------- /usr/share/modules/versions --------------------------------------------------------------
3.2.10
------------------------------------------------------------ /usr/share/modules/modulefiles ------------------------------------------------------------
dot module-git module-info modules null use.own
Even though your specific modulepaths are correctly set in MODULEPATH environment variable, module avail does not return any modulefiles for these directories. It means module has not found a file in these directories that is a modulefile.
So I suggest you to:
check if your mountpoint is correctly mounted
verify that the files in the directories are modulefiles compatible with the module command you use (on the module command version you use, the content of a modulefile should start with the #%Module magic cookie)

How to put an extra file in the kernel image by yocto

I have a trouble of putting my initramfs.cpio in my kernel image by yocto.
I have two bb files, one is used to build an initramfs, and the other one is used to build a fitimage.
I successful to build the fitimage bundled with my initramfs image.
But it always failed to build a fitImage that has an initramfs.cpio.gz in the /usr directory in the fitImage.
( I mean, I want to see a file named initramfs.cpio in the /usr when I use my fitImage booting to console )
====================================================================
Here are my error message..
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: QA Issue: linux-mine: Files/directories were installed but not shipped in any package:
/usr
/usr/initramfs-mine-qemu.cpio
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
linux-mine: 2 installed and not shipped files. [installed-vs-shipped]
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Fatal QA errors found, failing task.
ERROR: linux-mine-1_4.9.27+gitAUTOINC+d87116e608-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/paul/projects/Test/yocto/build/tmp/work/mine-poky-linux-gnueabi/linux-mine/1_4.9.27+gitAUTOINC+d87116e608-r0/temp/log.do_package.26149
ERROR: Task (/home/paul/projects/Test/yocto/yocto-2.2/poky/../meta-mine/recipes-kernel/linux/linux-mine_4.9.bb:do_package) failed with exit code '1'
====================================================================
Here is my kernel image bb file
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
LINUX_VERSION ?= "4.9.27"
SRCREV = "d87116e608e94ad684b5e94d46c892e33b9e2d78"
SRC_URI = "git://local/kernel;protocol=ssh;branch=master"
#FILES_${PN} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#FILES_${PN}-${PV} += "/usr /usr/initramfs-mine-${MACHINE_ARCH}.cpio"
#IMAGE_INSTALL = "initramfs-mine"
do_install_append () {
echo "WangPaul : S=[${S}]"
echo "WangPaul : B=[${B}]"
echo "WangPaul : D=[${D}]"
install -d ${D}/usr/
install -m 0444 ${B}/usr/initramfs-mine-${MACHINE_ARCH}.cpio ${D}/usr/
}
====================================================================
Here is my initramfs bb file
LICENSE = "GPLv2"
PACKAGE_INSTALL = "initramfs-live-boot ${VIRTUAL-RUNTIME_base-utils} udev ${ROOTFS_BOOTSTRAP_INSTALL}"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
inherit core-image
====================================================================
I have found similar questions:
Ship extra files in kernel module recipe and
An example of using FILES_${PN}
The way in aboves discussion are not work...
Any information would be appreciate !!
Thanks !!
The error seems to QA issues it means the source is compiled but not adding to rootfs. Add below line to yourkernel-image.bb. it will solve the issue.
FILES_${PN} += "${exec_prefix}/*"
Note: may be In your kernel.bb file you have given wrong format

CMake best practice using shared libraries versions

I'm organizing my "development policies in C" and distributing some codes in static and shared libs.
Static libs are ok, but I found a "gap" about shared libraries in documentation: How to specify the SOVERSION on "find_library".
At this moment I'm building libraries this way:
cmake_minimum_required (VERSION 2.8.11)
set (INSTALL_BIN_DIR "" CACHE PATH "full binary path")
set (INSTALL_LIB_DIR "$ENV{HOME}/embedded/llib/lib" CACHE PATH "full binary path")
set (INSTALL_INCLUDE_DIR "$ENV{HOME}/embedded/llib/include" CACHE PATH "full include path")
set (SRC_DIR "src" CACHE PATH "Source files path")
set (H_DIR "include" CACHE PATH "Source files path")
set (C_FILES )
list (
APPEND C_FILES
${SRC_DIR}/cJSON.c
)
set (H_FILES )
list (
APPEND H_FILES
${H_DIR}/cJSON.h
)
# Define Project name
project (cJSON)
# Create a library called "cJSON" which includes the source and header files.
add_library (cJSON SHARED "${C_FILES}")
#set_target_properties(cJSON PROPERTIES
# PUBLIC_HEADER "include/cJSON.h")
include_directories (include)
# Make sure the compiler can find include files for our Hello library
# when other libraries or executables link to Hello
#target_include_directories (cJSON PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties (cJSON
PROPERTIES
VERSION 1.0 SOVERSION 1
PUBLIC_HEADER "${H_FILES}"
)
install(TARGETS cJSON
# IMPORTANT: Add the foo library to the "export-set"
EXPORT cJSONTargets
LIBRARY
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT shlib
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT dev
)
Running cmake, make and make install it results in:
lrwxrwxrwx 1 takaite takaite 13 Dez 7 11:52 libcJSON.so -> libcJSON.so.1
lrwxrwxrwx 1 takaite takaite 15 Dez 7 11:52 libcJSON.so.1 -> libcJSON.so.1.0
-rw-r--r-- 1 takaite takaite 27194 Dez 7 15:03 libcJSON.so.1.0
And in another library, I'm including this way:
cmake_minimum_required (VERSION 2.8.11)
set (INSTALL_BIN_DIR "" CACHE PATH "full binary path")
set (INSTALL_LIB_DIR "$ENV{HOME}/embedded/llib/lib" CACHE PATH "full binary path")
set (INSTALL_INCLUDE_DIR "$ENV{HOME}/embedded/llib/include" CACHE PATH "full include path")
set (SRC_DIR "src" CACHE PATH "Source files path")
set (H_DIR "include" CACHE PATH "Source files path")
set (C_FILES )
list (
APPEND C_FILES
${SRC_DIR}/dict.c
)
set (H_FILES )
list (
APPEND H_FILES
${H_DIR}/dict.h
)
# Define Project name
project (dict)
set (CMAKE_FIND_LIBRARY_SUFFIXES_BKP ${CMAKE_FIND_LIBRARY_SUFFIXES})
# Set lib version to be used
set (CMAKE_FIND_LIBRARY_SUFFIXES ".so.1")
find_library (
CJSON_LIB
NAMES cJSON
PATHS ${INSTALL_LIB_DIR}
)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BKP})
message ("cJSON_lib: ${CJSON_LIB}")
# Create a library called "cJSON" which includes the source and header files.
add_library (dict SHARED "${C_FILES}" ${CJSON_LIB})
include_directories (${H_DIR} ${INSTALL_INCLUDE_DIR})
# Make sure the compiler can find include files for our Hello library
# when other libraries or executables link to Hello
#target_include_directories (cJSON PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties (dict
PROPERTIES
VERSION 1.0 SOVERSION 1
PUBLIC_HEADER "${H_FILES}"
)
install(TARGETS dict
# IMPORTANT: Add the foo library to the "export-set"
EXPORT DictTargets
LIBRARY
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT shlib
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT dev
)
I can't believe this is the right way to do it. Could any one show me a better way?
For search specific soversion of library you can use precise filename in NAMES option for find_library:
find_library (
CJSON_LIB
NAMES libcJSON.so.1
PATHS ${INSTALL_LIB_DIR}
)
From the documentation for find_library:
Each library name given to the NAMES option is first considered as a library file name and then considered with platform-specific prefixes (e.g. lib) and suffixes (e.g. .so). Therefore one may specify library file names such as libfoo.a directly. This can be used to locate static libraries on UNIX-like systems.
Note, that different soversions of the same library are assumed to be ABI compatible with each other. So it is rarely needed to search specific soversion of the library.
Changes in the library, which introduce ABI incopatibility should be accompanied with changing library's version. E.g: libcJSON2.so. So you cannot accidentally find incompatible library using find_library.

Gnome Software shows error even though everything is fine

When refreshing updates tab I get either
[core]: Unexpected system error
[core]: invalid or corrupted database (PGP signature)
I am using Arch Linux with Gnome 3.18. here is my pacman config
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
[infinality-bundle]
SigLevel = Never
Server = http://bohoomil.com/repo/$arch
[infinality-bundle-multilib]
SigLevel = Never
Server = http://bohoomil.com/repo/multilib/$arch
[infinality-bundle-fonts]
SigLevel = Never
Server = http://bohoomil.com/repo/fonts
And when updating with pacman there are no issues.
I have no issues to use terminal, I just want to know what is the problem with gnome software and is it a false positive error or there is some issues indeed with my repos?

Resources