How to Add antsense protocol for ns2.35? - c++

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.

Related

NPM sqlite3 with sqlcipher support

I am trying to cross compile NPM Sqlite3 with sqlcipher support. I am using Ubuntu 16.04 to cross compile for linux armv7 based SOC(system on chip).
So I started with cross-compiling OpenSSL to build sqlcipher for arm. I successfully cross compiled sqlcipher to produce a static library (libsqlcipher.a).
Now I am trying to get the NodeJS side of the project. I need sqlite with sqlcipher support, compiled for arm. I am using SOC SDK to built till now.
I am using node v4.6.1 and npm v2.15.9 to cross compile. I made sure I have the same version installed on Ubuntu as the SOC.
The command I use to cross compile is as follows :
npm install sqlite3 --target_arch=arm --enable-static=yes --build-from-source --sqlite_libname=sqlcipher -fPIC --sqlite=home/onkar/Library/sqlcipher-master/.libs --verbose
I exported the location of the libsqlcipher.a to LDFLAGS. I get the following error when I try to cross compile. Can someone help me with this error?
/home/linuximage/sdk/sysroots/x86_64-angstromsdk-linux/usr/libexec/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/5.2.1/real-ld: error: /home/Library/sqlcipher-master/.libs/libsqlcipher.a(sqlite3.o): requires unsupported dynamic reloc R_ARM_THM_MOVW_ABS_NC; recompile with -fPIC
collect2: error: ld returned 1 exit status
node_sqlite3.target.mk:129: recipe for target 'Release/obj.target/node_sqlite3.node' failed
make: *** [Release/obj.target/node_sqlite3.node] Error 1
Please let me know if you require any additional information, I would be more than happy to provide you with the same.
Thanks,
Onkar
In the first instance, you should check if the -fPIC (position independent code) flag was correctly applied when the libsqlcipher.a file was originally created.
In your output above, it looks like the linker is using the file at:
/home/Library/sqlcipher-master/.libs/libsqlcipher.a
Run the command
objdump -r /home/Library/sqlcipher-master/.libs/libsqlcipher.a | more
... and check for a line close to the start of the output beginning with the text
RELOCATION RECORDS FOR
If you see this line, then the library doesn't contain position independent code.

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)

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

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.

dev c++ compiler error

i am getting this error at compile (actually this is a very simple project and the syntax is absolutely ok)
E:\proj1\Makefile.win [Build Error] [main.o] Error 1
this is my compiler log (dev c++ v 4.9.9.2)
Compiler: Default compiler
Building Makefile: "E:\proj1\Makefile.win"
Executing make...
make.exe -f "E:\proj1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
'C:\Users\r' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
make.exe: *** [main.o] Error 1
Execution terminated
my user path is 'c:\Users\r&d', i think the '&' is makeing trouble in compile process , does anybody has any idea ?, i can not reinstall windows because i have got many softwares installed on my current windows and it is very time consuming to me, how can i fix this /
r&d is definitely a problem. Try surrounding it with quotes: "c:\users\r&d" and hope for the best. If it doesn't work, change the folder to something without an ampersand (you don't need to reinstall Windows for that, just create another user).
You can try creating another user without the ampersand, and then copying your profile to it to keep all your settings and application preferences, as well as documents.
You might want to try another build enviroment, like code:blocks which has its own internal build system. You probably want make sure you are using the latest gcc mingw compiler and build system from mingw(use their installer, I think it was http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/ ), and even if you don't go with code::blocks, make sure you are using the new branch of devc++ that was forked and still being developed. One last thing is if you go with code::blocks, use a nightly build in the forum, http://forums.codeblocks.org/index.php/board,20.0.html as they are much more up to date.
The escape character in Windows is ^. So try
C:\Users\r^&d

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.)