Can't build LLVM examples | unknown component name: jit - llvm

I have built LLVM & Clang according to the docs here.
The steps were
export SRC_DIR=/work/llvm
export BUILD_DIR=/work/make_llvm
cd $BUILD_DIR
$SRC_DIR/configure --prefix=/work/my_llvm
make -j 4
make install
My PATH does have /work/my_llvm/bin at the front.
Then I cd $BUILD_DIR/examples and type make to which the system responds,
llvm-config: unknown component name: jit
make[1]: Entering directory `/work/make_llvm/examples/BrainF'
/work/llvm/Makefile.rules:1071: *** llvm-config --libs failed. Stop.
make[1]: Leaving directory `/work/make_llvm/examples/BrainF'
make: *** [BrainF/.makeall] Error 2
Seems like there's not JIT support, or llvm-config can't find it. But LLVM compiles with JIT support enabled by default according configure --help, and I see at least one JIT related library called libLLVMMCJIT.a in /work/my_llvm/lib.
How do I build the LLVM examples?

The legacy JIT component has been removed from upstream LLVM just this week (and all its uses switched to MCJIT). I recall seeing reports of problems with the examples on the mailing list, but they were fixed. Is this a fresh check-out of LLVM or an older one? If it's a fresh check-out, you should send a note to llvmdev# or open a bug about it, because it would mean this example was left behind.

Related

fatal error while compiling pybind11 test cases on raspbian

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

Building U-Boot is failing

I am trying to build u-boot
Toolchain:
http://web.archive.org/web/20130823131954/http://www.angstrom-distribution.org/toolchains/
U-boot: git.denx.de
I am following this site to build this u-boot
http://beagleboard.org/linux
It says to put cross compiler path before building.
export PATH=/usr/local/angstrom/arm/bin:$PATH
1) I can see angstrom folder in /usr/local. Also I think that we need the toolchain's actual place of binaries. Let suppose in /home/myhome/BBB/angtrom_x_y_z/usr/local/angstrom/arm/bin
So which path actually i should export?
2)I have tried to put both paths, but I am getting errors.
3)I have downloaded three toolchains
angstrom-2011.03-i686-linux-armv5te-linux-gnueabi-toolchain
angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3
angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3
1st gives errors as
CROSS_COMPILE=arm-angstrom-linux-gnueabi- make am335x_evm
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
GEN include/autoconf.mk
arm-angstrom-linux-gnueabi-gcc: 0: No such file or directory
arm-angstrom-linux-gnueabi-gcc: unrecognized option '-G'
cc1: error: unrecognized command line option "-mabicalls"
make[1]: *** [include/autoconf.mk] Error 1
make: *** No rule to make target `am335x_evm'. Stop.
second one is I think for 64 bit processor, I have i386 one, so it also doesn't worked
Third one is corrupted.
Can anybody tell me how to compile it as the site says. Maybe the site is outdated but still if anybody can tell me a straightforward way how to do this.
It looks like Angstorm toolchian is too old to deal with recent U-Boot. I tried your procedure and get other errors. I'm not sure why you try to use that old toolchain and if you have to use it. But I quickly check Linaro toolchain gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux, which I use for boards like Cubietruck and A20-OLinuXino-MICRO and it works fine.
git clone git://git.denx.de/u-boot.git
cd u-boot
export PATH=${PATH}:${PATH_TO_TOOLCHAIN}/gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux/bin
CROSS_COMPILE=arm-linux-gnueabihf- make am335x_evm_defconfig
CROSS_COMPILE=arm-linux-gnueabihf- make -j$(nproc)

How to Add antsense protocol for ns2.35?

I'm working on ns2.35/ubuntu 14.04 LTS.
I want to add ant-sense (ant colony optimization ) module in NS2 I have made changes to make file for INCLUDES & OBJ_CC. And when type make in the terminal get this error
make: gcc command not found
make : *** [tcp/linux/tcp_naivereno.o] error 127
It sounds like make does not know where gcc is located.
Try this:
Type gcc --version. If nothing displays, then you need to go find your gcc executable.
Once you have found the gcc executable...
export PATH=$PATH:/path/to/gcc/executable.
After that, running make should work.

Building RaLink RT2860 WiFi Network driver (kernel 3.0.4 x64)

I have a problem to build the rt2860 wifi driver.
Its the first time i have to do this.
I downloaded the driver from the RaLink website, modified it and then i ran make as root.
root:2010_07_16_RT2860_Linux_STA_v2.4.0.0/ $ make
make -C tools
make[1]: Entering directory `/home/root/2010_07_16_RT2860_Linux_STA_v2.4.0.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/root/2010_07_16_RT2860_Linux_STA_v2.4.0.0/tools'
/home/root/2010_07_16_RT2860_Linux_STA_v2.4.0.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/root/2010_07_16_RT2860_Linux_STA_v2.4.0.0/os/linux/Makefile
make -C /lib/modules/3.0.4/build SUBDIRS=/home/root/2010_07_16_RT2860_Linux_STA_v2.4.0.0/os/linux modules
make[1]: Entering directory `/lib/modules/3.0.4/build'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/lib/modules/3.0.4/build'
make: *** [LINUX] Error 2
This error message makes me assume, that there should be a makefile with a target named 'modules'. The build folder is absolutely empty... what to do now? Should i get the specific kernel sources and place them into /lib/modules/3.x.x/build/?
EDIT:
I also downloaded the firmware files and
my distri. is Crux.
root:~/ $ grep -i rt2800pci /boot/linux-3.0.4-x64
# CONFIG_RT2800PCI is not set
root:~/ $ for BUSID in $(lspci | awk '{ IGNORECASE=1 } /net/ { print $1 }'); do lspci -s $BUSID -m; lspci -s $BUSID -n; done
03:00.0 "Network controller" "RaLink" "RT2860" "Unknown vendor 1a3b" "Device 1059"
03:00.0 0280: 1814:0781
There rt2xx-based devices are already supported in the mainline kernel quite well, so there's no need to download anything from the RaLink website. The kernel module for the RT2860 is "rt2800pci".
You can either run menuconfig, select this driver as a module and rebuild OR you can use the compat-wireless package.
EDIT: You will also need the firmware for it (rt2860.bin). You can get it from the firmware-ralink Debian package.
I'm using debian-sid on a eeepc1000 that has a ralink as well.
when i was on the 2.6 kernels, i had to add all in-kernel drivers for ralink to the blacklist, and compile that.
when i upgraded to kernel 3.2 it was a mess. i had some new module in the kernel that was not affected by the blacklist somewhat working with the card... my AP got only 10% signal or so, and it was messy...
after upgrading the debian package (from linux-image-3.2.0-3 to 3.2.0-4) the support was completely gone.
i got it back by removing the blacklist. the modules i'm using now are rt2x00pci,rt2800lib,rt2800pci
so, if you compiled the drivers on 2.6 and added the blacklists... simply remove the blacklists and ignore whatever you had compiled (the STA drivers... they will not even be probed if the ones in the kernel work for you. but if they are being probed, add the STA ones to the blacklist)
I honestely do not know hows the support on 3.0, but on 3.2 it's as good as it was on 2.6 with the ra drivers.

Cross-Compiling gcc

I am following the instructions here for cross-compiling GCC. I am on a mac. When I run this command from the gcc source folder: ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,fortran,java,objc,obj-c++,treelang I get this error: configure: error: GMP 4.1 and MPFR 2.2.1 or newer versions required by fortran. When I change the command to this (I couln't compile GMP): ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,java,objc,obj-c++,treelang I get this error:
The following requested languages could not be built: ada
Recognised languages are: c,ada,c++,fortran,java,objc,obj-c++,treelang
which doesn't make sense to me because it says ada is recognized. All other configurations of the enable-languages settings (and when the setting isn't changed and the default is used) give me this error:
/usr/local/cross/i586-elf/bin/ranlib ./libgcov.a
_error_not_here_yet - havent even thought about it - it may even work
make[1]: _error_not_here_yet: Command not found
make[1]: *** [treelang.all.cross] Error 127
make: *** [all-gcc] Error 2
How can I cross compile GCC?
Are you running configure from the gcc source tree? If so: don't do that. Follow the instructions (verbatim) in the page you linked to.
Look carefully and you'll notice that they're running the configure command from outside the gcc source tree.
If your platform is supported by it, the crosstool script (also linked from the bottom of your instructions page) is very helpful.
Edit: As potatoswatter points out in a comment, your installation is probably hosed at this point. Remove the whole tree and start from scratch. (It sounds like it will take too long, and you'll want to take a short cut, but it will be faster in the end if you just start from scratch now.)