I have created a chaincode and I am trying to install it on the peer organization. I am able to package the chaincode on the peer organization but when it turns to install phase, I got error message:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 2
# github.com/Nik-U/pbc
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lpbc
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
I am using Nik-U's go wrapper of the PBC library Nik-U pbc. In his homepage, description shows:
This package must be compiled using cgo. It also requires the installation of GMP and PBC. During the build process, this package will attempt to include <gmp.h> and <pbc/pbc.h>, and then dynamically link to GMP and PBC.
Here's what I have tried:
I have manually configured the GMP and PBC under the Nik-U's directory and changed all the addresses of <gmp.h> and <pbc.h> to the right location.
I have tried to use command ln -s /usr/local/lib/libpbc.so libpbc.so and ln -s /usr/local/lib/libgmp.so to create link library files, but it shows the same error message.
As the Nik-U wrapper uses cgo, I changed the sentence in c.go file from #cgo LDFLAGS: -lpbc -lgmp to #cgo LDFLAGS: -L/usr/local/lib -lpbc -lgmp. Inside the /usr/loca/lib there are: libgmp.a libgmp.la libgmp.so libgmp.so.10 libgmp.so.10.4.1 libpbc.a libpbc.la libpbc.so libpbc.so.1 libpbc.so.1.0.0. This change did not work. I still got the same error message.
I copied all files of the directory /usr/local/lib to the same directory of the docker container using command docker cp **.so containerName:/usr/local/lib/. It does not work.
Here are what I doubt that may be the problem:
I am using go.mod file to manage all dependencies but the go.mod does not manage the original PBC library and GMP library. However, I do not know how to use go module to manage these two libraries (written in C?).
Nik-U's pbc wrapper has to link PBC and GMP libraries dynamically, which is why my efforts to manually configure and install them in the subdirectory, and change the include information such as from #include <pbc/pbc.h> to #include <pbc-0.5.14/include/pbc.h> of no use.
Can anybody help..
In hyperledger fabric, chaincode is executed in the form of sandbox based on virtual environment. In other words, it is not executed in the peer, but in a new docker container.
Even if you move the *.so file to the peer, it seems that a cannot find error has occurred because the newly created chaincode does not import it.
To solve this, two tasks are required.
1. import library to fabric-ccenv docker image
The go chaincode container of the fabric occurs in the image of fabric-ccenv. Based on the fabric-ccenv image, create a new image with your library embedded
FROM fabric-ccenv:<your_fabric_tag>
COPY <your_src_library_path> <your_target_library_path>
docker build -f <your_dockerfile> -t fabric-ccenv:<your_new_fabric_tag>
2. Change core.yaml of fabric-peer
You have to change the peer's configuration. That is, set the configuration for chaincode in core.yaml.
You can set information about fabric-ccenv in the builder item of chaincode. Change this value to the value of your image created in step 1 above.
chaincode:
id:
path:
name:
#builder: $(DOCKER_NS)/fabric-ccenv:$(TWO_DIGIT_VERSION)
builder: $(DOCKER_NS)/fabric-ccenv:<your_new_fabric_tag>
pull: false
golang:
runtime: $(DOCKER_NS)/fabric-baseos:$(TWO_DIGIT_VERSION)
dynamicLink: false
Related
We would like to integrate hugo for documentation generation in our automake project.
The problem i'm facing is, that I would like to support
out-of-tree builds
builds from read-only source trees (which is related to out-of-tree builds)
out-of-tree builds kind of work with:
hugo --source $(srcdir) --destination $(abs_builddir)
However, when my source-tree is read-only (e.g. as tested by make distcheck), this fails with:
$ make
hugo --source ../../../hugo --destination "<<SRCDIR>>/project-0.1/_build/sub/hugo"
Error: add site dependencies: create deps: failed to create file caches from configuration: mkdir <<SRCDIR>>/project-0.1/hugo/resources: permission denied
Total in 1 ms
make: *** [Makefile:555: all] Error 255
Obviously, hugo tries to create it's "file caches" as a resources/ directory in the (read-only) <<SRCDIR>>.
How can I tell hugo to creat this "file caches" directory in an alternative (writeable) place?
I tried setting --cacheDir (to $(abs_builddir), but this didn't change anything.
apparently there's a resourceDir config-file option, but afaict that is not available via the cmdline (and I don't know whether it would actually help).
My objective
I want to compile and install nfs-ganesha from source on a Oracle Linux machine.
Steps to reproduce
Using Oracle Linux Server release 7.4
Download nfs-ganesha from github: https://github.com/nfs-ganesha/nfs-ganesha
Follow steps from line 56 to 61 on this guide (just a normal compilation and installation): https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/COMPILING_HOWTO.txt
At some point, you might receive an error that you're missing userspace-rcu. Do sudo yum install userspace-rcu userspace-rcu-devel to fix it.
When I run the last command (make install) I get the following error:
Error
bash-4.2$ make install
[ 3%] Built target MainServices
normal build output...
[100%] Built target fsalmem
Install the project...
-- Install configuration: "Debug"
-- Installing: /etc/ganesha/ganesha.conf
CMake Error at cmake_install.cmake:54 (configure_file):
configure_file Problem configuring file
make: *** [install] Error 1
Some insights
I opened cmake_install.cmake to see what is failing, here is a fragment of the code:
I marked the faulty line with an arrow
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
set(_destfile "/etc/ganesha/ganesha.conf")
if (NOT "$ENV{DESTDIR}" STREQUAL "")
# prepend install root prefix with install-time DESTDIR
set(_destfile "$ENV{DESTDIR}//etc/ganesha/ganesha.conf")
endif ()
if (EXISTS ${_destfile})
message(STATUS "Skipping: ${_destfile} (already exists)")
execute_process(COMMAND "/usr/bin/cmake" -E compare_files
/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} RESULT_VARIABLE _diff)
if (NOT "${_diff}" STREQUAL "0")
message(STATUS "Installing: ${_destfile}.example")
configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile}.example COPYONLY)
endif ()
else ()
message(STATUS "Installing: ${_destfile}")
# install() is not scriptable within install(), and
# configure_file() is the next best thing
-------->>> configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} COPYONLY)
# TODO: create additional install_manifest files?
endif ()
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
What I found on this function is that it copies one file to another, but I'm not sure how to get more information from the error. My main concern is that it might have to do with permissions but when I use sudo, I just get:
bash-4.2$ sudo make install
CMake Error: The source directory "/home/carlhida/Documents/ganesha/src" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [cmake_check_build_system] Error 1
So I think it is not related to that.
Pivoting questions
Is there a way to know what exactly is the problem with those files? I would really appreciate if anyone knows how to get a verbose output on those errors.
Thank you for your help!
I solved this problem by moving the repo's folder and the build folder to a directory called /scratch. Then I issued the command again by being root. It installed correctly this time.
Currently I am having problems with loading an R package that I downloaded from github (https://github.com/hafen/operator). I downloaded the package and put it in my local R folder: "C:/..../Documents/R/win-library/3.2/operator".
However, I have not been able to load said package into R. I keep on receiving the following errors when trying to load the package. Can anyone help me. I found an error that I though was somewhat relevant that suggest updating "Rcpp" which I have already done with no success. Thank you in advance for any and all help!
I should add. I looked into this a bit more and realized the issue I am having is revolving around the C script that is contained within the package. If I remove the C script I can load the package, however, some of the package functions are dependent on the script and will not run as a result.
> require(operator)
Loading required package: operator
Failed with error: ‘‘operator’ is not a valid installed package’
or
> devtools::load_all("C:/..../Documents/R/win-library/3.2/operator")
Loading operator
Re-compiling operator
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:\Users\blakey1\Documents\R\win-library\3.2\operator" \
--library="C:\Users\blakey1\AppData\Local\Temp\Rtmpe611i9\devtools_install_499c5059149c" --no-R --no-data \
--no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch --no-test-load
* installing *source* package 'operator' ...
** libs
Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" SHLIB="operator.dll" WIN=64 TCLBIN=64 OBJECTS="loess_op.o"' had status 127
ERROR: compilation failed for package 'operator'
* removing 'C:/Users/blakey1/AppData/Local/Temp/Rtmpe611i9/devtools_install_499c5059149c/operator'
Error: Command failed (1)
I was facing the same issue with RTextTools, as RTextTools is now not available on CRAN.
I have Download RTextTools From Given Link
https://cran.r-project.org/src/contrib/Archive/RTextTools/
and copy
RTextTools_1.4.2.tar.gz file in project root folder
then
run this command in project folder in terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
After running this command I receive below error
"ERROR: dependencies ‘SparseM’, ‘randomForest’, ‘tree’, ‘e1071’, ‘ipred’, ‘caTools’, ‘maxent’, ‘glmnet’, ‘tau’ are not available for package ‘RTextTools’"
Now install each dependencies from RStudio or RConsole (Any Editor used by you) by simply running this code
install.packages("caTools")
Install all 9 required packages One By One (In My Case it was 9 Packages Dependencies required by RTextTools)
all packages will be installed except 'maxent'
Now download maxent from the given link
https://cran.r-project.org/src/contrib/Archive/maxent/
and copy maxent_1.3.3.1.tar file in project folder then
run this command in project folder in terminal
"R CMD INSTALL maxent_1.3.3.1.tar"
Now For RTextTools Run this command again in Terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz"
All is done Now..
But the Last Step is
Load the RTextTools using
library(RTextTools)
You will see one more Error: Load SparseM
Now Loading SparseM use code below
library(SparseM)
and in the last Load RTextTools
library(RTextTools)
Until now, When I compiled my kernel module, I installed: kernel-devel, kernel-headers.
Later on, I had to include kernel sources.
So now the packages I install in order to compile my kernel module are: kernel-devel, kernel-headers and kernel.src.rpm (kernel source).
Im in the process of creating a "build machine" that will check for Available latest kernel, download necessary packages and compile the kernel module for that kernel.
I dont want to install the package, just to download it, and copy the files to their location (download kernel.src.rpm, rpm2cpio, cpio, and copy to /lib/modules/kernel-X-Y/)
I noticed that if kernel src is installed, there is not need for kernel-headers.
kernel-devel is needed ??, I am not sure it is, when trying to install without kernel-devel, I get the following exception:
make[2]: Entering directory `/usr/src/kernels/3.10.0-693.el7.x86_64'
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.
What am I missing ? If i install kernel-devel, then i dont get this exception, I dont want to install kernel-devel.
Before you can run make to compile the kernel you need to run make oldconfig or copy a .config file over into the build tree. make oldconfig will then use the .config and update it to the newer kernel.
You also have other options:
a simple make help | grep -i config in the kernel source directory shows:
Configuration targets:
config - Update current config utilising a line-oriented program
nconfig - Update current config utilising a ncurses menu based
menuconfig - Update current config utilising a menu based program
xconfig - Update current config utilising a Qt based front-end
gconfig - Update current config utilising a GTK+ based front-end
oldconfig - Update current config utilising a provided .config as base
localmodconfig - Update current config disabling modules not loaded
localyesconfig - Update current config converting local mods to core
silentoldconfig - Same as oldconfig, but quietly, additionally update deps
defconfig - New config with default from ARCH supplied defconfig
savedefconfig - Save current config as ./defconfig (minimal config)
allnoconfig - New config where all options are answered with no
allyesconfig - New config where all options are accepted with yes
allmodconfig - New config selecting modules when possible
alldefconfig - New config with all symbols set to default
randconfig - New config with random answer to all options
listnewconfig - List new options
olddefconfig - Same as silentoldconfig but sets new symbols to their
kvmconfig - Enable additional options for kvm guest kernel support
xenconfig - Enable additional options for xen dom0 and guest kernel support
tinyconfig - Configure the tiniest possible kernel
kselftest-merge - Merge all the config dependencies of kselftest to existing
.config.
configuration. This is e.g. useful to build with nit-picking config.
i386_defconfig - Build for i386
x86_64_defconfig - Build for x86_64
make O=dir [targets] Locate all output files in "dir", including .config
I am trying to install the libwebsocket in my ubuntu .
so I downloaded the project https://github.com/warmcat/libwebsockets
unzipped it and I followed the installation instruction.
I type the command cmake FH and get the following messages.
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:State or Province Name (full name) [Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) [Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) []:Common Name (e.g. server FQDN or YOUR name) []:Email Address []:SUCCSESFULLY generated SSL certificate
Generating API documentation
-- Looking for RPMTools... - rpmbuild NOT FOUND
---------------------------------------------------------------------
Settings: (For more help do cmake -LH <srcpath>
---------------------------------------------------------------------
LWS_WITH_SSL = ON (SSL Support)
LWS_SSL_CLIENT_USE_OS_CA_CERTS = 1
LWS_USE_CYASSL = OFF (CyaSSL replacement for OpenSSL)
LWS_WITHOUT_BUILTIN_GETIFADDRS = OFF
LWS_WITHOUT_CLIENT = OFF
LWS_WITHOUT_SERVER = OFF
LWS_LINK_TESTAPPS_DYNAMIC = OFF
LWS_WITHOUT_TESTAPPS = OFF
LWS_WITHOUT_TEST_SERVER = OFF
LWS_WITHOUT_TEST_SERVER_EXTPOLL = OFF
LWS_WITHOUT_TEST_PING = OFF
LWS_WITHOUT_TEST_CLIENT = OFF
LWS_WITHOUT_TEST_FRAGGLE = OFF
LWS_WITHOUT_DEBUG = OFF
LWS_WITHOUT_EXTENSIONS = OFF
LWS_WITH_LATENCY = OFF
LWS_WITHOUT_DAEMONIZE = OFF
LWS_USE_LIBEV =
LWS_IPV6 = OFF
LWS_WITH_HTTP2 = OFF
---------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/maroua/libwebsocket/libwebsockets-master
-- Cache values
// Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=
// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
// Libwebsockets include directories
LIBWEBSOCKETS_INCLUDE_DIRS:PATH=/home/maroua/libwebsocket/libwebsockets-master/lib;/home/maroua/libwebsocket/libwebsockets-master
// Libwebsocket libraries
LIBWEBSOCKETS_LIBRARIES:STRING=websocket;websockets_shared
// Libwebsocket shared library
LIBWEBSOCKETS_LIBRARIES_SHARED:STRING=websockets_shared
// Libwebsocket static library
LIBWEBSOCKETS_LIBRARIES_STATIC:STRING=websocket
// Path to the CyaSSL include directory
LWS_CYASSL_INCLUDE_DIRS:PATH=
// Path to the CyaSSL library
LWS_CYASSL_LIB:PATH=
// Installation directory for executables
LWS_INSTALL_BIN_DIR:PATH=bin
// Installation directory for CMake files
LWS_INSTALL_CMAKE_DIR:PATH=lib/cmake/libwebsockets
// Installation directory for example files
LWS_INSTALL_EXAMPLES_DIR:PATH=bin
// Installation directory for header files
LWS_INSTALL_INCLUDE_DIR:PATH=include
// Installation directory for libraries
LWS_INSTALL_LIB_DIR:PATH=lib
// Compile with support for ipv6
LWS_IPV6:BOOL=OFF
// Link the test apps to the shared version of the library. Default is to link statically
LWS_LINK_TESTAPPS_DYNAMIC:BOOL=OFF
// Server SSL certificate directory
LWS_OPENSSL_CLIENT_CERTS:PATH=../share
// SSL support should make use of OS installed CA root certs
LWS_SSL_CLIENT_USE_OS_CA_CERTS:BOOL=ON
// Use CyaSSL replacement for OpenSSL. When settings this, you also need to specify LWS_CYASSL_LIB and LWS_CYASSL_INCLUDE_DIRS
LWS_USE_CYASSL:BOOL=OFF
// Search the system for ZLib instead of using the included one (on Windows)
LWS_USE_EXTERNAL_ZLIB:BOOL=OFF
// Don't use BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... Default is your libc provides it. On some systems such as uclibc it doesn't exist.
LWS_WITHOUT_BUILTIN_GETIFADDRS:BOOL=OFF
// Don't build the client part of the library
LWS_WITHOUT_CLIENT:BOOL=OFF
// Don't build the daemonization api
LWS_WITHOUT_DAEMONIZE:BOOL=OFF
// Don't compile debug related code
LWS_WITHOUT_DEBUG:BOOL=OFF
// Don't compile with extensions
LWS_WITHOUT_EXTENSIONS:BOOL=OFF
// Don't build the server part of the library
LWS_WITHOUT_SERVER:BOOL=OFF
// Don't build the libwebsocket-test-apps
LWS_WITHOUT_TESTAPPS:BOOL=OFF
// Don't build the client test application
LWS_WITHOUT_TEST_CLIENT:BOOL=OFF
// Don't build the ping test application
LWS_WITHOUT_TEST_FRAGGLE:BOOL=OFF
// Don't build the ping test application
LWS_WITHOUT_TEST_PING:BOOL=OFF
// Don't build the test server
LWS_WITHOUT_TEST_SERVER:BOOL=OFF
// Don't build the test server version that uses external poll
LWS_WITHOUT_TEST_SERVER_EXTPOLL:BOOL=OFF
// Compile with support for http2
LWS_WITH_HTTP2:BOOL=OFF
// Build latency measuring code into the library
LWS_WITH_LATENCY:BOOL=OFF
// Compile with support for libev
LWS_WITH_LIBEV:BOOL=OFF
// Include SSL support (default OpenSSL, CyaSSL if LWS_USE_CYASSL is set)
LWS_WITH_SSL:BOOL=ON
// The RPM builder tool
RPMTools_RPMBUILD_EXECUTABLE:FILEPATH=RPMTools_RPMBUILD_EXECUTABLE-NOTFOUND
I tried to compile a C program that uses libwebsocket.h, it tells me that it does not exist.
Can any one show me the right way to install this lib.
Thanks for any help .
A simple way to install libwebsocket in Ubuntu is to use this command in a terminal:
sudo apt-get install libwebsockets-dev
This command will install the version 1.2.
The libwebsockets.h file will be located at /usr/include/libwebsockets.h
An other way to have this library is to get the latest version (1.4 at the moment) from GitHub. To do that open a Terminal and go in the directory you want to get the library (I will call it lib_dir).
When you are in the lib_dir directory enter this command to get the code:
git clone https://github.com/warmcat/libwebsockets.git
When the command finish you will find a directory named libwebsockets.
The libwebsockets.h file will be located at lib_dir/libwebsockets/lib
If you need / want to build the library and install it in your system go in lib_dir then enter the following commands:
sudo apt-get install libssl-dev
mkdir build
cd build
cmake ..
make
sudo make install
ldconfig
This will install the library in /usr/local/include.
And to make sure of the version you just installed:
pkg-config --modversion libwebsockets
Finally you need to include in the compiler (include paths -I):
/usr/local/include
In the linker libraries (Libraries -l):
websockets
Finally (Library search path -L):
/usr/local/lib