fatal error while compiling pybind11 test cases on raspbian - c++

Following this question, I'm now trying to compile the pybind11 test cases as instructed here on a Raspberry Pi. What I have done so far:
installed Raspbian Raspbian Buster Lite from the official page
updated/upgraded all packages
updated/upgraded python packages following the instructions here
compiled and installed pybind11 following the instructions here
my environment is:
Raspbian buster version 10
python 3.7.3
pip 20.0.2
gcc 8.3.0
Then running the command make check -j 4 the compiler stops at:
[ 68%] Building CXX object CmakeFiles/pybind11_tests.dir/test_numpy_dtypes.cpp.o
and the errors are:
c++: fatal error: Killed signal terminated program cplusplus
compilation terminated.
make[3]: *** [CMakeFiles/pybind11_tests.dir/build.make:297: CMakeFiles/pybind11_tests.dir/test_local_bindings.cpp.o] Error 1
make[3]: *** waiting for unfinished jobs...
make[2]: *** [CMakeFiles/Makefile2:110: CMakeFiles/pybind11_tests.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:191: CMakeFile/check.dir/rule] Error 2
make: *** [Makefile:157: check] Error 2
I would appreciate it if you could help me understand what is the problem and how I can solve it.

Doing more research and using the right keyword query, it seems this issue has nothing to do with bypynd11 or Raspbian for that matter. The issue seems to be with memory overflow as described in numerous posts before (including here and here). The solution might be to use fewer parallel processes -j <n> where n < 4, or do not use it at all as suggested here. For example, I tested the
make check -j 3
and it works. Or alternatively to create a swape file as described here.

Yes you have to create first swap file. After that you can do it. Acctually swap file will increase yor ram memory. It will use rom space for ram performance.
Please go through with below link it would help you.
https://youtu.be/Cr5mDFxvsb0

Related

Buildroot compile error - Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)

Appreciate help if anyone have insight how to fix following compile error for buildroot that I have been struggling for almost a week.
I used following commands to pull buildroot repo and have tried this multiple times. I am using arm64 default config and before make enabling following flags
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT=”ttyAMA0″
After compile starts
git clone git://git.buildroot.net/buildroot
make qemu_aarch64_virt_defconfig
make
I see following error
mke2fs 1.46.3 (27-Jul-2021)
mkfs.ext4: No such file or directory while trying to determine filesystem size
*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)
fs/ext2/ext2.mk:46: recipe for target '/home/jn4/linux-buildroot/buildroot/output/images/rootfs.ext2' failed
make[1]: *** [/home/jn4/linux-buildroot/buildroot/output/images/rootfs.ext2] Error 1
Makefile:84: recipe for target '_all' failed
make: *** [_all] Error 2
To change file system size I have tried modifying following parameter in .config file
BR2_TARGET_ROOTFS_EXT2_SIZE="250M"
I have tried many sizes - 60M, 120M, 250M, 256M, 512M, 1024M, however all have failed to compile with same error. This seems like a common problem with buildroot and there are few other posts in git or other places which recommends size of 250M to solve the problem. I continue to see compile error with many sizes I have tried.
Appreciate any insight since I am stuck at this point. Thank you.

Error using Cygwin: "collect2: fatal error: ld terminated with signal 11 [Segmentation fault]"

I'm trying to use cygwin to download openslide (building natively on Windows) on a Windows 10 x64 system. I ran into an error earlier relating to chk_fail and set the line in the build file with -D_FORTIFY_SOURCE to 0 instead of the default (2). You can probably tell by now I don't really know what I'm doing. But I got a new error below relating to a memory error from what I've read. I tried deleting the whole package folder including the makefiles and object files, then clone from Github again and rebuild, but it didn't work. Can anyone give me pointers about what's happening here and how to fix it? It would be much appreciated.
Scanning dependencies of target ziptool
[ 90%] Building C object src/CMakeFiles/ziptool.dir/ziptool.c.obj
[ 90%] Linking C executable ziptool.exe
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make[2]: *** [src/CMakeFiles/ziptool.dir/build.make:109: src/ziptool.exe] Error 1
make[2]: *** Deleting file 'src/ziptool.exe'
make[1]: *** [CMakeFiles/Makefile2:442: src/CMakeFiles/ziptool.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
Failed: make $parallel (line 417)
I solved this problem. Firstly, don't even bother to build this package using Cygwin. It won't work because of dependency issues and there is no record for version control in the package README.
For anyone else who has this problem like I did, you can download the latest versions of the code here: https://github.com/openslide/openslide-winbuild/releases and pick the latest one.
I first pip installed openslide-python. Then I moved openslide-win64-20171122 (from Github) into anaconda3/site-packages (not necessary, but nice), and then from anaconda3/site-packages/openslide I opened lowlevel.py.
In lowlevel.py, you need to add the following lines:
(in the beginning after importing libraries)
os.environ['PATH'] = "path/to/openslide-win64-20171122/bin" + ";" + os.environ['PATH']
You can also change this line:
if platform.system() == 'Windows':
_lib = cdll.LoadLibrary('libopenslide-0.dll')
to this:
if platform.system() == 'Windows':
_lib = cdll.LoadLibrary(util.find_library("libopenslide-0.dll"))
so that it searches for the libopenslide-0.dll file. Then don't forget to add from ctypes import util at the beginning.

How to correct path to overcome Error 127?

I'm trying to run a c++ file which requires an mkl library. I installed that library in a folder on home. But I'm getting following error. I searched that this error is due to incorrect path assign. How can I correct that path?
`/public/intel/bin/icpc -g -I/public/intel/mkl/include -c main.cc
make: /public/intel/bin/icpc: Command not found
[main.o] Error 127
makefile:6: recipe for target 'main.o' failed
make: *** [main.o] Error 127`
Jerry,
It looks like you are using Linux or UNIX. Also it looks like you are trying to use ICC (the Intel compiler) with MKL. If you are using ICC, the Linux compile command is "icc", the Windows compile command is "icl".
Beyond that, you need to source the ??vars.sh files if you have not set the environment variables manually. For example, if you installed Parallel Studio, you would set up compiler environment variables as explained here: https://software.intel.com/en-us/articles/setting-up-the-build-environment-for-using-intel-c-or-fortran-compilers; and you would set up MKL environment variables as explained here: https://software.intel.com/en-us/mkl-linux-developer-guide-scripts-to-set-environment-variables.
Let me know if this helps.

Error when build Ogre on Linux: narrowing conversion

I am trying to get Ogre on Linux. I downloaded the source files and uncompressed them. Then I created the build folder then I ran "cmake ..". After that completed, I ran "make -j4" (I do have 4 cores and I have also tried just make). I get to 49% and it stops every time. I have downloaded the cmake gui and ran configure and checked all the boxes. I hit configure again and then generate. I tried running "make" again.
Downloads/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_‌​1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing] };
That is the error that pops up several times except they refer to a different line of the code in ps_1_4.cpp and the number ‘-35051’ is different.
Also, There are several warnings for casting the const GLboolean* to GLboolean* throughout the build but this is the message that I have at the end:
RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/build.make:542: recipe for target 'RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/__/__/RenderSystem_GL/compile_RenderSystem_GL_0.cpp.o' failed
make[2]: *** [RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/__/__/RenderSystem_GL/compile_RenderSystem_GL_0.cpp.o] Error 1
CMakeFiles/Makefile2:1057: recipe for target 'RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/all' failed
make[1]: *** [RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
Also every time that I have tried a new way I delete the build folder and start all over. Each time it appears to end with this message. I am still relatively new to Linux and CMake, so can you explain what is going on and how you came to this conclusion?
Note: I have found one forum that talks about this but I don't know where the build function is or how to change the CXX_FLAG.
Referenced post suggests that Ogre can be successfully built using gnu++98 standard (which is actually a c++98 plus GNU extensions).
The standard is set via compiler flags, in case of cmake flags may be passed as:
cmake -DCMAKE_CXX_FLAGS="--std=gnu++98" ..

Building emulator for AOSP 4.2.2 with make -j4

I am trying to build emulator for Android open source project (AOSP) 4.2.2 and when I compile make -j4, I get the following error.
ost C: acp <= build/tools/acp/acp.c
host C: libhost <= build/libs/host/CopyFile.c
host C++: libandroidfw <= frameworks/base/libs/androidfw/AssetDir.cpp
host C++: libandroidfw <= frameworks/base/libs/androidfw/AssetManager.cpp
/var/folders/1v/7qwg76xn3fs34bpkbj7sw0k00000gq/T//ccmomvtt.s:1854:FATAL:Symbol _isSourceNewer.eh already defined.
/var/folders/1v/7qwg76xn3fs34bpkbj7sw0k00000gq/T//ccGfRe2w.s:829:FATAL:Symbol _process.eh already defined.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [out/host/darwin-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
What is going wrong? I followed source website to build this. My system configuration: Mac OS 10.7.5
I finally figured out the what the problem is. I did couple of things to make this work.
Remove any previous version of Xcode on your machine running on
OS x 10.7.
Look for Developer/ folder in the home directory. Move that to trash (It belongs to Xcode)
Reinstall Xcode 4.2 (which I used and it worked)
Follow the AOSP documentation to update the rest using macports.