Why build of mono failed - mono

I built mono 5.20.1.19 from tarball successfully. But the build of master from github was failed. Instead of using a existing mono installation for the build, I run make get-monolite-latest for the mcs. On RedHat 6.9 (gcc6.3, cmake3.7.2) the build was crashed(segment fault). On SUSE 12.4(gcc6.3, cmake 3.5.2), the build ended with errors. I thought I might need to checkout the branch 5.20.1.19, but I couldn't find any branch newer then 4.8. Why there doesn't exist such a branch? Thanks in advance. Below are my build errors:
RedHat 6.9
make -C build-shared
make[4]: Entering directory mono-src/mono/btls/build-shared'
make[5]: Entering directorymono-src/mono/btls/build-shared'
make[6]: Entering directory mono-src/mono/btls/build-shared'
Scanning dependencies of target pqueue
make[6]: Leaving directorymono-src/mono/btls/build-shared'
make[6]: Entering directory mono-src/mono/btls/build-shared'
[ 1%] Building C object boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o
^[l/bin/sh: line 1: 42877 Segmentation fault (core dumped) /opt/anss/bin/ccache /opt/anss/bin/gcc -DBORINGSSL_IMPLEMENTATION -Imono-src/external/boringssl/ssl/../include -Imono-src/external/boringssl/ssl/pqueue/../../include -Wall -Wsign-compare -Wmissing-field-initializers -fPIC -ggdb -fvisibility=hidden -Wall -Wformat=2 -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden -Wshadow -std=c11 -D_XOPEN_SOURCE=700 -o CMakeFiles/pqueue.dir/pqueue.c.o -c mono-src/external/boringssl/ssl/pqueue/pqueue.c
make[6]: *** [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o] Error 139
make[6]: Leaving directorymono-src/mono/btls/build-shared'
make[5]: * [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/all] Error 2
make[5]: Leaving directory mono-src/mono/btls/build-shared'
make[4]: *** [all] Error 2
make[4]: Leaving directorymono-src/mono/btls/build-shared'
make[3]: [build-shared/libmono-btls-shared.so] Error 2
make[3]: Leaving directory mono-src/mono/btls'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directorymono-src/mono'
make[1]: [all-recursive] Error 1
make[1]: Leaving directory `mono-src'
make: * [all] Error 2
SUSE12.4
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
// gensources produced 8 error(s) and a set of 155 filename(s)
// Invoked with 'mono-src/mcs/class/lib/build/gensources.exe --strict --platformsdir:./../../build ../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.sources Microsoft.NuGet.Build.Tasks.dll xbuild_14'
// Working directory was 'mono-src/mcs/class/Microsoft.NuGet.Build.Tasks'
make[8]: * No rule to make target '../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.sources', needed by '../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.response'. Stop.
../../build/rules.make:226: recipe for target 'do-all' failed
make[7]: * [do-all] Error 2

Related

unable to build valgrind for armv7 in yocto

Unable to build valgrind in yocto
I have highleted the problem i am facing
arm-poky-linux-gnueabi-gcc: error: unrecognized argument in option '-march=armv7ve'
arm-poky-linux-gnueabi-gcc: note: valid arguments to '-march=' are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv8-a armv8-a+crc iwmmxt iwmmxt2 native
make[5]: *** [intdiv-intdiv.o] Error 1
make[5]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests/arm'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests/arm'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build'
make: *** [check] Error 2
make: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build'
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile_ptest_base (log file is located at /home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/temp/log.do_compile_ptest_base.29480)
The error means that the cross gcc doesn't contain the support for armv7ve architecture. The support for armv7ve has been added in gcc-4.9 as evident from the gcc Changelog https://gcc.gnu.org/gcc-4.9/changes.html. Please check your gcc recipe in yocto sources and make sure the gcc version is 4.9 or greater.

CMake not finding files - Can't build detectron with pytorch

make ops for detectron isn't working
export Caffe2_DIR=<path to my pytorch>/torch
make ops
Error Message
[ 40%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o
In file included from /home/ubtuntu/detectron/detectron/ops/zero_even_op.cc:17:0:
/home/ubtuntu/detectron/detectron/ops/zero_even_op.h:20:33: fatal error: caffe2/core/context.h: No such file or directory
compilation terminated.
CMakeFiles/caffe2_detectron_custom_ops.dir/build.make:62: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o] Error 1
make[3]: Leaving directory '/home/ubtuntu/detectron/build'
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/all' failed
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/home/ubtuntu/detectron/detectron/ops/zero_even_op.cu:17:37: fatal error: caffe2/core/context_gpu.h: No such file or directory
compilation terminated.
CMake Error at caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o.cmake:219 (message):
Error generating
/home/ubtuntu/detectron/build/CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/./caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o
CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/build.make:63: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o] Error 1
make[3]: Leaving directory '/home/ubtuntu/detectron/build'
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all' failed
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all] Error 2
make[2]: Leaving directory '/home/ubtuntu/detectron/build'
Makefile:129: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/ubtuntu/detectron/build'
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 2
What I've Tried
In the error message, it says it can't find caffe2/core/context.h however the file exists in pytorch/caffe2/core/context.h. So I've tried exporting the caffe2 folder instead of the torch folder, but then the build fails earlier
- I've also tried setting it to pytorch/cmake and pytorch/build folders
I then tried creating a caffe2 link to pytorch/caffe2 inside of pytorch/torch, however that had no effect. I'm out of ideas :(

How to compile latest stable Mono

I tried
cd /usr/local/src
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-4.2.tar.gz
tar -xvf libgdiplus-4.2.tar.gz
cd libgdiplus-4.2
mkdir /opt/m511
./configure --prefix=/opt/m511
make
make install
cd /usr/local/src
wget http://download.mono-project.com/sources/mono/mono-5.11.0.89.tar.bz2
tar jxf mono-5.11.0.89.tar.bz2
cd /usr/local/src/mono-5.11.0.89
./autogen.sh --prefix=/opt/m511
make
but got error
...
make[3]: Entering directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make all-am
make[4]: Entering directory `/usr/local/src/mono-5.11.0.89/mono/utils'
CC os-event-unix.lo
os-event-unix.c: In function ‘mono_os_event_wait_multiple’:
os-event-unix.c:121: warning: ‘data’ may be used uninitialized in this function
os-event-unix.c:123: warning: ‘start’ may be used uninitialized in this function
CC mono-md5.lo
CC mono-sha1.lo
CC mono-logger.lo
CC mono-codeman.lo
In file included from ../../mono/metadata/metadata-internals.h:12,
from ../../mono/metadata/class-internals.h:12,
from ../../mono/metadata/profiler-private.h:10,
from mono-codeman.c:22:
../../mono/metadata/domain-internals.h:10:42: error: mono/metadata/object-forward.h: No such file or directory
In file included from ../../mono/metadata/metadata-internals.h:12,
from ../../mono/metadata/class-internals.h:12,
from ../../mono/metadata/profiler-private.h:10,
from mono-codeman.c:22:
../../mono/metadata/domain-internals.h:615: error: expected declaration specifiers or ‘...’ before ‘MonoReflectionTypeBuilder’
make[4]: *** [mono-codeman.lo] Error 1
make[4]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/mono-5.11.0.89'
make: *** [all] Error 2
How to compile it ? Mono 4.4.2 compiled OK with those commands.

Why does using 'make' when compiling Apache2 return "recipe for target 'httpd' failed" and how can I fix it?

lsb_release:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
I am trying to install Apache2 and I struggling to compile the source. I have successfully configured it, but when I use 'make' it responds with "recipe for target 'httpd' failed". Here is the full output from using 'make' - relevant information at the bottom. I'd like to know why this happened and how I can prevent it from happening. Thank-you!
jack#jw-xubuntu-desk1:~/Documents/apache/httpd-2.4.23$ make
Making all in srclib
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/srclib'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/srclib'
Making all in os
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os'
Making all in unix
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os'
Making all in server
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server'
Making all in mpm
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm'
Making all in event
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[4]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[4]: Nothing to be done for 'local-all'.
make[4]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm'
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server'
Making all in modules
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules'
Making all in aaa
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/aaa'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/aaa'
Making all in cache
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/cache'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/cache'
Making all in core
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
Making all in database
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/database'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/database'
Making all in debugging
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/debugging'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/debugging'
Making all in filters
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/filters'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/filters'
Making all in http
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
Making all in ldap
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ldap'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ldap'
Making all in loggers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/loggers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/loggers'
Making all in metadata
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/metadata'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/metadata'
Making all in proxy
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy'
Making all in session
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/session'
make[2]: Leaving directory '/home/jack/DoThankyou!cuments/apache/httpd-2.4.23/modules/session'
Making all in slotmem
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/slotmem'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/slotmem'
Making all in ssl
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ssl'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ssl'
Making all in proxy/balancers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy/balancers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy/balancers'
Making all in arch/unix
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix'
Making all in dav/main
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main'
Making all in generators
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/generators'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/generators'
Making all in dav/fs
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/fs'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/fs'
Making all in mappers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/mappers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/mappers'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules'
Making all in support
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[2]: Nothing to be done for 'local-all'.
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23'
x86_64-linux-gnu-gcc -pthread -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/home/jack/Documents/apache/httpd-2.4.23/os/unix -I/home/jack/Documents/apache/httpd-2.4.23/include -I/usr/include/apr-1.0 -I/usr/include -I/usr/local/pcre/include -I/home/jack/Documents/apache/httpd-2.4.23/modules/aaa -I/home/jack/Documents/apache/httpd-2.4.23/modules/cache -I/home/jack/Documents/apache/httpd-2.4.23/modules/core -I/home/jack/Documents/apache/httpd-2.4.23/modules/database -I/home/jack/Documents/apache/httpd-2.4.23/modules/filters -I/home/jack/Documents/apache/httpd-2.4.23/modules/ldap -I/home/jack/Documents/apache/httpd-2.4.23/modules/loggers -I/home/jack/Documents/apache/httpd-2.4.23/modules/lua -I/home/jack/Documents/apache/httpd-2.4.23/modules/proxy -I/home/jack/Documents/apache/httpd-2.4.23/modules/session -I/home/jack/Documents/apache/httpd-2.4.23/modules/ssl -I/home/jack/Documents/apache/httpd-2.4.23/modules/test -I/home/jack/Documents/apache/httpd-2.4.23/server -I/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix -I/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main -I/home/jack/Documents/apache/httpd-2.4.23/modules/generators -I/home/jack/Documents/apache/httpd-2.4.23/modules/mappers -c /home/jack/Documents/apache/httpd-2.4.23/server/buildmark.c
/usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc -pthread -o httpd modules.lo buildmark.o -export-dynamic server/libmain.la modules/core/libmod_so.la modules/http/libmod_http.la server/mpm/event/libevent.la os/unix/libos.la /usr/lib/x86_64-linux-gnu/libaprutil-1.la /usr/lib/x86_64-linux-gnu/libapr-1.la
server/.libs/libmain.a(util_pcre.o): In function `ap_regfree':
util_pcre.c:(.text+0x109): undefined reference to `pcre_free'
server/.libs/libmain.a(util_pcre.o): In function `ap_regcomp':
util_pcre.c:(.text+0x196): undefined reference to `pcre_compile2'
util_pcre.c:(.text+0x1f4): undefined reference to `pcre_fullinfo'
server/.libs/libmain.a(util_pcre.o): In function `ap_regexec_len':
util_pcre.c:(.text+0x3b5): undefined reference to `pcre_exec'
server/.libs/libmain.a(util_pcre.o): In function `ap_regname':
util_pcre.c:(.text+0x5c3): undefined reference to `pcre_fullinfo'
util_pcre.c:(.text+0x5e3): undefined reference to `pcre_fullinfo'
util_pcre.c:(.text+0x603): undefined reference to `pcre_fullinfo'
collect2: error: ld returned 1 exit status
/home/jack/Documents/apache/httpd-2.4.23/build/program.mk:22: recipe for target 'httpd' failed
make[1]: *** [httpd] Error 1
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23'
/home/jack/Documents/apache/httpd-2.4.23/build/rules.mk:75: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I solved this problem by using the --with-pcre with configure and pointing to the correct path of the installed PCRE.
For example: ./configure --prefix=/u01/app/apache/apr/ --with-pcre=/u01/app/apache/pcre/bin.

cmake make cannot find -lprotocol

I have these files in the directory:
CMakeLists.txt datalink.c datalink.h protocol.a protocol.h
All these files were got from my teacher except CMakeLists.txt.
#CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(DataLinkSimulator)
INCLUDE_DIRECTORIES(.)
set(SOURCE_FILES datalink.c protocol.a datalink.h protocol.h)
add_executable(DataLinkSimulator ${SOURCE_FILES})
target_link_libraries(DataLinkSimulator protocol.a)
I run 'cmake .' in this directory, and it works.
However, when I run 'make' , it gives me these errors.
Scanning dependencies of target DataLinkSimulator
[ 50%] Building C object CMakeFiles/DataLinkSimulator.dir/datalink.c.o
[100%] Linking C executable DataLinkSimulator
/usr/bin/ld: cannot find -lprotocol
collect2: 错误:ld 返回 1 #(means "error: ld return 1")
CMakeFiles/DataLinkSimulator.dir/build.make:94: recipe for target 'DataLinkSimulator' failed
make[2]: *** [DataLinkSimulator] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/DataLinkSimulator.dir/all' failed
make[1]: *** [CMakeFiles/DataLinkSimulator.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
The error "cannot find -lprotocol" must caused by ld's mistaking protocol as a shared lib. But my protocol is a static lib. So I am confused.
If I edit makefile by myself instead of using cmake, it works correctly.
datalink: datalink.c datalink.h
gcc datalink.c protocol.a -o datalink -lm -lstdc++ -m32
clean:
${RM} datalink
${RM} *.o
I used a "make VERBOSE=1":
/usr/local/bin/cmake -H/home/shantom/Desktop/FileRecv/Lab1-linux -B/home/shantom/Desktop/FileRecv/Lab1-linux --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/shantom/Desktop/FileRecv/Lab1-linux/CMakeFiles /home/shantom/Desktop/FileRecv/Lab1-linux/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
make -f CMakeFiles/DataLinkSimulator.dir/build.make CMakeFiles/DataLinkSimulator.dir/depend
make[2]: Entering directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
cd /home/shantom/Desktop/FileRecv/Lab1-linux && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/shantom/Desktop/FileRecv/Lab1-linux /home/shantom/Desktop/FileRecv/Lab1-linux /home/shantom/Desktop/FileRecv/Lab1-linux /home/shantom/Desktop/FileRecv/Lab1-linux /home/shantom/Desktop/FileRecv/Lab1-linux/CMakeFiles/DataLinkSimulator.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
make -f CMakeFiles/DataLinkSimulator.dir/build.make CMakeFiles/DataLinkSimulator.dir/build
make[2]: Entering directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
[ 50%] Linking C executable DataLinkSimulator
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/DataLinkSimulator.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/DataLinkSimulator.dir/datalink.c.o -o DataLinkSimulator -Wl,-Bstatic -lprotocol -Wl,-Bdynamic
/usr/bin/ld: cannot find -lprotocol
collect2: 错误:ld 返回 1
CMakeFiles/DataLinkSimulator.dir/build.make:94: recipe for target 'DataLinkSimulator' failed
make[2]: *** [DataLinkSimulator] Error 1
make[2]: Leaving directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/DataLinkSimulator.dir/all' failed
make[1]: *** [CMakeFiles/DataLinkSimulator.dir/all] Error 2
make[1]: Leaving directory '/home/shantom/.wine/drive_c/Program Files/QQ/Users/1044950475/FileRecv/Lab1-linux'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
In order to understand the error you need to launch make command from the command line using verbose mode; on Linux paltform it means launching:
make VERBOSE=1
In this manner you will have the entire command line used to compile the code.
In order to resolve your error you could:
add a link_directories(directory_where_you_have_library) CMake line adding the directory where you have protocol.a before target_link_libraries line
add protocol.a with absolute path.
Your modified Makefile works because probably you have it in the same directory of all the files while CMake creates many Makefiles in various directories starting from build root directory so it needs -L gcc flags (obtainable through link_directories) or -l with absolute path (obtainable adding protocol.a with absolute path).