Cannot cmake box86 on arm cpu, unrecognized option '-marm' - cmake

I'm trying to install box86 with cmake in a script, the error I get in console is:
Scanning dependencies of target WRAPPERS
Scanning dependencies of target dynarec_arm
[ 0%] Built target PRINTER
[ 0%] Generating ../src/wrapped/generated/functions_list.txt
[ 0%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o
[ 1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:76: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:63: CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o] Error 1
[ 1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:89: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/dynarec_arm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Detected same build as last run, skipping
[ 1%] Built target WRAPPERS
make: *** [Makefile:163: all] Error 2
My script for this installation is:
git clone https://github.com/ptitSeb/box86
cd box86
echo 'cd box86'
mkdir build; cd build; cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo; make -j$(nproc)
exit
I'm not sure what this error means since I never specified -marm as an option... where is this coming from?

Related

what is "error: variable 'writable' set but not used [-Werror,-Wunused-but-set-variable]" ?and how fix it?

i want build linphone sdk by below commands but i get error.how fix it?
git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git --recursive
cd linphone-sdk
mkdir build-osx
cmake .. -DLINPHONESDK_PLATFORM=Desktop
make
and this is error:
how fix it?
-- Build files have been written to: /Users/sia/Desktop/compile1/linphone-sdk/WORK/mac-arm64/Build/ms2
[ 85%] Forcing build for 'EP_ms2'
[ 85%] Performing build step for 'EP_ms2'
[ 0%] Built target ms2-yuv2rgb-vs-header
CMake Warning at /Users/sia/Desktop/compile1/linphone-sdk/linphone-sdk/mac-arm64/share/bctoolbox/cmake/BcGitVersion.cmake:43 (message):
Project version (5.2.0) and git tag (5.2.0-alpha) differ. Please put them
identical
[ 0%] Built target ms2-git-version
[ 0%] Built target ms2-basedescs-header
[ 0%] Built target ms2-voipdescs-header
[ 0%] Built target ms2-fragment-shader-header
[ 0%] Built target ms2-vertex-shader-header
[ 0%] Built target ms2-yuv2rgb-fs-header
Consolidate compiler generated dependencies of target mediastreamer
[ 1%] Building C object src/CMakeFiles/mediastreamer.dir/audiofilters/macsnd.c.o
/Users/sia/Desktop/compile1/linphone-sdk/mediastreamer2/src/audiofilters/macsnd.c:372:10: **error: variable 'writable' set but not used [-Werror,-Wunused-but-set-variable]
Boolean writable;
^**
1 error generated.
make[8]: *** [src/CMakeFiles/mediastreamer.dir/audiofilters/macsnd.c.o] Error 1
make[7]: *** [src/CMakeFiles/mediastreamer.dir/all] Error 2
make[6]: *** [all] Error 2
make[5]: *** [/Users/sia/Desktop/compile1/linphone-sdk/WORK/mac-arm64/Stamp/EP_ms2/EP_ms2-build] Error 2
make[4]: *** [CMakeFiles/EP_ms2.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [mac-arm64-prefix/src/mac-arm64-stamp/mac-arm64-build] Error 2
make[1]: *** [CMakeFiles/mac-arm64.dir/all] Error 2
make: *** [all] Error 2

Dependency for add_jar cmake

I am actually generating java source files dynamically through code generators. I want to create jar file containing the java files created through this code generator.
add_custom_target(lang ALL)
add_custom_command(
TARGET lang
COMMAND ${Protobuf_PROTOC_EXECUTABLE} ${CMD_PRG_LNG} --proto_path=${PROTO_FILES} ${COMMONS}/*.proto")
If I run my cmake without add_jar command, it successfully run and generate java files in the respective folders. But, if I add add_jar
add_jar(${JAR_NAME} ${JAVA_SOURCES})
The above instruction fails with the following error message.
Scanning dependencies of target ProtoJava
make[2]: *** No rule to make target '../protoJava/Data.java', needed by 'CMakeFiles/ProtoJava.dir/java_compiled_ProtoJava'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ProtoJava.dir/all' failed
make[1]: *** [CMakeFiles/ProtoJava.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
How to get the jar file created? I tried putting add_jar inside add_custom_command under the same target as java file creation.
add_custom_command(
TARGET lang_java
COMMAND add_jar(${JAR_NAME} ${JAVA_SOURCES}))
but it errors out with message
/bin/sh: 1: Syntax error: word unexpected (expecting ")")
CMakeFiles/lang_java.dir/build.make:57: recipe for target 'lang_java' failed
make[2]: *** [lang_java] Error 2
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/lang_java.dir/all' failed
make[1]: *** [CMakeFiles/lang_java.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
How to fix this one?

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.

How to fix cmGLobalNInjaGenerator.cxx.o" error of cmake?

I am installing a newer version of cmake which is cmake 3.10.1 and the make command is giving me error while building CXX object source.
I have installed the ninja 1.5.1 but still getting the same error.
used this to install the cmake:
wget <link of the cmake3.10.1>
./configure
make # (at this stage getting error)
The error is:
[ 83%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx: In member function ‘void cmGlobalNinjaGenerator::AppendTargetDependsClosure(const cmGeneratorTarget*, cmNinjaOuts&, bool)’:
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx:1077:40: error: ‘class std::map<const cmGeneratorTarget*, std::set<std::basic_string<char> > >’ has no member named ‘emplace_hint’
Source/CMakeFiles/CMakeLib.dir/build.make:5942: recipe for target 'Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o' failed
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o] Error 1
CMakeFiles/Makefile2:2355: recipe for target 'Source/CMakeFiles/CMakeLib.dir/all' failed
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

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 :(