CMake cannot find include libpq-fe.h - postgresql

I'm trying to build a program which requieres libpq-fe.h include file.
This file is in E:\MinGW\msys\1.0\local\pgsql\include
In my CMakeLists.txt I have:
cmake_minimum_required(VERSION 3.0)
# declare project
PROJECT(localscp)
set(pg_SOURCE_DIR /usr/local/pgsql)
INCLUDE_DIRECTORIES(
"E:/MinGW/msys/1.0/local/psql/include"
)
# declare executables
ADD_EXECUTABLE(localscp localscp.cc)
TARGET_LINK_LIBRARIES(localscp
dl pthread z pq)
When I do cmake . I get:
-- Configuring done
-- Generating done
-- Build files have been written to: E:/informemedico/localscp
When I do mingw32-make I get:
[ 50%] Building CXX object CMakeFiles/localscp.dir/localscp.cc.obj
E:\informemedico\localscp\localscp.cc:24:22: fatal error: libpq-fe.h: No such file or directory compilation terminated.
CMakeFiles\localscp.dir\build.make:62: recipe for target 'CMakeFiles/localscp.dir/localscp.cc.obj' failed
mingw32-make[6]: *** [CMakeFiles/localscp.dir/localscp.cc.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/localscp.dir/all' failed
mingw32-make[5]: *** [CMakeFiles/localscp.dir/all] Error 2
makefile:82: recipe for target 'all' failed
mingw32-make[4]: *** [all] Error 2
Why the compiler can't find that include file?.

Related

make: *** [.build_release/src/caffe/solvers/sgd_solver.o] Error 1

I'm trying to install caffe on ubuntu but I'm getting errors.
root#c8f75a5e7268:/work/caffe# make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/solvers/sgd_solver.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/blob.hpp:8,
from ./include/caffe/net.hpp:10,
from ./include/caffe/solver.hpp:7,
from ./include/caffe/sgd_solvers.hpp:7,
from src/caffe/solvers/sgd_solver.cpp:4:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No
such file or directory
compilation terminated.
Makefile:591: recipe for target '.build_release/src/caffe/solvers/sgd_solver.o' failed
make: *** [.build_release/src/caffe/solvers/sgd_solver.o] Error 1

libwebsockets libuv error: ‘m’ may be used uninitialized in this function

I cross compiled libuv successfully and I'm trying to cross compile libwebsockets but I get the following error in make for arm with a buildroot toolchain.
Please advise.
libwebsockets
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=~/buildroot/output/host/share/buildroot/toolchainfile.cmake \
-DLWS_LIBUV_INCLUDE_DIRS=/tmp/cross/include \
-DLWS_ZLIB_LIBRARIES=/tmp/cross/lib/libuv.so
make
[ 31%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/server.c.o
[ 32%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/lws-spa.c.o
[ 33%] Building C object CMakeFiles/websockets_shared.dir/lib/event-libs/poll/poll.c.o
[ 33%] Building C object CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o
~/libwebsockets/lib/event-libs/libuv/libuv.c: In function ‘elops_destroy_context1_uv’:
~/libwebsockets/lib/event-libs/libuv/libuv.c:526:7: error: ‘m’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (m)
^
cc1: all warnings being treated as errors
CMakeFiles/websockets_shared.dir/build.make:1166: recipe for target 'CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o' failed
make[2]: *** [CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o] Error 1
CMakeFiles/Makefile2:363: recipe for target 'CMakeFiles/websockets_shared.dir/all' failed
make[1]: *** [CMakeFiles/websockets_shared.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
Why are you building libwebsockets manually, instead of using the libwebsockets package that we have in Buildroot ?

unable to build core-image-sato with yocto rocko

I'm just starting out with yocto. Reading Embedded Linux Systems with the Yocto Project. Downloaded latest rocko release with git, created a new environment and ran bitbake core-image-sato. Got the following errors during build
ERROR: binutils-native-2.29-r0 do_install: oe_runmake failed
ERROR: binutils-native-2.29-r0 do_install: Function failed: do_install (log file is located at /home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/temp/log.do_install.73730)
ERROR: Logfile of failure stored in: /home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/temp/log.do_install.73730
...
...
...
ERROR: Task (virtual:native:/home/some-user/projects/poky/meta/recipes-devtools/binutils/binutils_2.29.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 826 tasks of which 431 didn't need to be rerun and 1 failed.
Looked at the home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/temp/log.do_install.73730 log file and found the following in it
/home/some-user/projects/rpi-yocto-build/tmp/hosttools/ld: cannot find ../bfd/.libs/libbfd.a: No such file or directory
collect2: error: ld returned 1 exit status
Makefile:1116: recipe for target 'ld-new' failed
make[4]: *** [ld-new] Error 1
make[4]: Leaving directory '/home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/git/build.x86_64-linux.x86_64-linux/ld'
Makefile:1760: recipe for target 'install-recursive' failed
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory '/home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/git/build.x86_64-linux.x86_64-linux/ld'
Makefile:1931: recipe for target 'install' failed
make[2]: *** [install] Error 2
make[2]: Leaving directory '/home/some-user/projects/rpi-yocto-build/tmp/work/x86_64-linux/binutils-native/2.29-r0/git/build.x86_64-linux.x86_64-linux/ld'
Makefile:7204: recipe for target 'install-ld' failed
make[1]: *** [install-ld] Error 2
make[1]: *** Waiting for unfinished jobs...
Is ../bfd/.libs/libbfd.a something I should have installed on my machine or it is rocko that is missing it? Is there a fix for this?
I'd suggest that that isn't the actual error, but a subsequent one. Can you do bitbake binutils-native -cclean (to wipe away the partial build) and then bitbake binutils-native, and assuming it breaks again pastebin the entire log.do_install.
Also I've not read that book but it might be worth trying with MACHINE=qemux86 from just a clone of Poky, so we can rule out other layers or configuration.

why u-boot source code remove while compiling?

I am perorming following steps for compiling source code locally. i am using poky version pyro of yocto. but after successfully clean the source code, while compiling source code is remove and error is display.
step 1
bitbake -v -c clean u-boot
step 2
bitbake -v u-boot
------------------------------Eroor-------------------------------
make: *** No rule to make target 'am335x_boneblack_config'. Stop.
make: Leaving directory '/u-boot/u-boot_v2017.01/u-boot_src'
ERROR: u-boot-1_2017.01-r0 do_compile: oe_runmake failed
ERROR: u-boot-1_2017.01-r0 do_compile: Function failed: do_compile (log file is located at /PYRO_BUILD/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/1_2017.01-r0/temp/log.do_compile.10915)
ERROR: Logfile of failure stored in: /PYRO_BUILD/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/1_2017.01-r0/temp/log.do_compile.10915
how should i resolve it?
make: *** No rule to make target 'am335x_boneblack_config'. Stop.
make: Leaving directory
'//src_bsp/u-boot/u-boot_v2017.01/u-boot_src'
From above error, It seems that you have uboot code locally at '//u-boot/u-boot_v2017.01/u-boot_src' which gets deleted on compiling(bitbake -v u-boot).
Try using EXTERNALSRC instead of S to specify path to u-boot source code as follows :
inherit externalsrc
EXTERNALSRC = "/<workspace>/u-boot/u-boot_v2017.01/u-boot_src"
EXTERNALSRC_BUILD = "/<workspace>/u-boot/u-boot_v2017.01/u-boot_src"

How can I solve a "do_compile ERROR" when building a Yocto recipe with Toaster?

everytime I want to build the rpi-basic-image I get the following error:
DEBUG: Executing shell function do_compile
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
Using /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source as source for kernel
CHK include/generated/utsrelease.h
CC scripts/mod/devicetable-offsets.s
In file included from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/linux/compiler.h:54:0,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/uapi/linux/stddef.h:1,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/linux/stddef.h:4,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/uapi/linux/posix_types.h:4,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/uapi/linux/types.h:13,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/linux/types.h:5,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/linux/mod_devicetable.h:11,
from /home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/scripts/mod/devicetable-offsets.c:2:
/home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/include/linux/compiler-gcc.h:121:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(__GNUC__)
^
compilation terminated.
/home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/scripts/Makefile.build:153: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[4]: *** [scripts/mod/devicetable-offsets.s] Error 1
/home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[3]: *** [scripts/mod] Error 2
/home/dennis/poky/build-toaster-3/tmp/work-shared/raspberrypi2/kernel-source/Makefile:555: recipe for target 'scripts' failed
make[2]: *** [scripts] Error 2
Makefile:146: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /home/dennis/poky/build-toaster-3/tmp/work/raspberrypi2-poky-linux-gnueabi/linux-raspberrypi/1_4.1.21+gitAUTOINC+ff45bc0e89-r0/temp/log.do_compile.11315)
Does anybody know how to solve it and what's the reason for it?
Thanks
This has been noticed on the yocto#yoctoproject.org mailing list.
Seems to be resolved with a patch, but I did not test it- I'm only forwarding the conversation and hoping this will help.
Last mail from the thread:
http://article.gmane.org/gmane.linux.embedded.yocto.general/30168/match=gcc+6.1+raspi
Patch used: http://article.gmane.org/gmane.linux.embedded.yocto.general/30093/