configure llvm fail. Host Clang must be able to find libstdcxx4.7 or newer - cmake

my project depends on llvm+clang+cmake.I use ninja to make compile simple.
my OS is : OS X Yosemite(10.10.5).here is how the error occurs.
1) get llvm&clang
$ mkdir ~/clang-llvm && cd ~/clang-llvm
$ git clone http://llvm.org/git/llvm.git
$ cd llvm/tools
$ git clone http://llvm.org/git/clang.git
$ cd clang/tools
$ git clone http://llvm.org/git/clang-tools-extra.git extra
2) install CMake and Ninja
$ cd ~/clang-llvm
$ git clone https://github.com/martine/ninja.git
$ cd ninja
$ git checkout release
$ ./bootstrap.py
$ sudo cp ninja /usr/bin/
$ cd ~/clang-llvm
$ git clone git://cmake.org/stage/cmake.git
$ cd cmake
$ git checkout next
$ ./bootstrap
$ make
$ sudo make install
3)compile ninja
$ cd ~/clang-llvm
$ mkdir build && cd build
$ cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON # Enable tests; default is off.
$ ninja
$ ninja install
4)config clang
$ cd ~/clang-llvm/build
$ ccmake ../llvm
after that , I get into the advanced mode (by press t)
CMAKE_CXX_COMPILER:*I change it to clang++*
CMAKE_C_COMPILER:*I change it to clang*
LLVM_ENABLE_EH and LLVM_ENABLE_RTTI: *I change it from OFF to ON*
and then I press c to configure. error happens.ERROR is :
**CMake Error at cmake/modules/HandleLLVMOptions.cmake:43 (message):
Host Clang must be able to find libstdc++4.7 or newer!
Call Stack (most recent call first):
CMakeLists.txt:358 (include)**
Any ideas?
Thanks

Related

invalid command name "Queue/LTEQueue"

I`ve installed lte in ns2.35 but it gives the folowing error:
invalid command name "Queue/LTEQueue"
while executing
"Queue/LTEQueue set qos_ true "
(file "lte.tcl" line 21)
when i run lte.tcl
please hepe meto solve it
Your error: You are using a (wrong) copy of 'ns' with no LTE, or you have a failed build.
LTE, Howto ....
$ tar xvf ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0
$ cd ns-allinone-2.35/
$ patch -p0 < LTE-ns235_2014-2.patch
https://drive.google.com/file/d/0B7S255p3kFXNLVlDZ29EWWxJTFk/view?usp=sharing
$ ./install
$ cd ns-2.35/
$ sudo make install ('make install' will copy the executable 'ns' to /usr/local/bin/)
$ cp ns ns235-lte ( This is your backup and the recognizable "lte ns" )
$ sudo cp ns235-lte /usr/local/bin/
$ cd ../nam-1.15/
$ sudo make install
The examples : lte-examples-0614.tar.gz https://drive.google.com/file/d/0B7S255p3kFXNRWV4Mzc0bGYtQzA/view?usp=sharing
Run some examples:
$ ns235-lte bicfixdownlink.tcl
$ ns235-lte deVacto-lte.tcl
$ ns235-lte 24_downl413.tcl
EDIT : New example package, lte-examples-06.17.tar.gz, added 24_downl413.tcl, etc. https://drive.google.com/file/d/0B7S255p3kFXNSmd4Q3h3dXp1QWc/view?usp=sharing
And ns-allinone-2.35: gt-itm updated → ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing

How to setup crosstool-ng with wxwidgets

I want to setup the ct-ng for my gui application and now I want to use wxwidgets.
For setting up the crosstool, I have used:
# Install prerequisites:
apt-get -y install gcc gperf bison flex gawk libtool automake libncurses5-dev texinfo
# Setup toolchain
# instructions from https://github.com/crosstool-ng/crosstool-ng
cd toolchain/crosstool-ng
./bootstrap
./configure --prefix=$HOME/.local
make && make install
echo -ne "\n\nif [ -d \"$HOME/.local/bin\" ]; then\n PATH=\"$HOME/.local/bin:$PATH\"\nfi" >> ~/.profile
source ~/.profile
mkdir ../tc/
cd ../tc/
ct-ng list-samples
ct-ng x86_64-w64-mingw32
ct-ng build # lasts 30 minutes...
##################### WxWidgets ######################
cd ../wxWidgets/
sh autogen.sh
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --enable-unicode --without-libtiff --without-libjpeg --with-expat=builtin --with-libpng=builtin
make
The only way I have found is to clone wxwidgets from github and compile it as above in the script. Then, I included as path -I
WXWIDGET=../toolchain/wxWidgets/include/
$(CXX) -I$(FLEX) -I$(WXWIDGET) $(WXWIDGETSFLAGS) $(CPPFLAGS) $(header) $(src) $(obj3) -o $(OUTPUT)/$(bin)
Hundreds of errors appearing while compiling:
In file included from ../toolchain/wxWidgets/include/wx/platform.h:485:0,
from ../toolchain/wxWidgets/include/wx/defs.h:20,
from ../toolchain/wxWidgets/include/wx/string.h:24,
from ../toolchain/wxWidgets/include/wx/artprov.h:14,
from parser/include/gui.h:17,
from parser/include/customdialogs.h:17:
../toolchain/wxWidgets/include/wx/chkconf.h:282:9: error: #error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."
# error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."
What should I do?
You need to try "--host" and "--target" configure options.
Just try "../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode".
BTW, "--enable-unicode" should be turned on by default. So you can drop it.
Also, if you software required C++11, you should compile the library as:
CXXFLAGS="-std=c++11" ../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode

Building a .deb package of Mono itself

I'm currently compiling the latest version of Mono from Github on an original version Raspberry Pi, on latest Raspbian.
This is a very time consuming process, which when it's complete I would not like to have to repeat.
Can the compiled Mono installation be packaged into a .deb to, for example, allow me to re-install latest Raspbian, then dpkg -i my-mono-build.deb?
Sure, and it's very easy to do if you choose the proper tool so that you don't need a master on debian packaging. As for me, I chose fpm to do exactly this. (Note: install via gem, not apt-get.)
And here you have an example of a script of how to build a Mono .deb with this, which I copy+paste here for posterity (just in case I delete the github repo by mistake, or github stops being a thing in the future):
#!/bin/bash
set -e
die () {
echo >&2 "$#"
exit 1
}
[ "$#" -eq 1 ] || die "Please specify the version of Mono you want to build as the argument. (Check the versions in the tarball list here: http://download.mono-project.com/sources/mono/)"
which fpm > /dev/null || (echo "Please install fpm (from gem, not apt-get)" && exit 1)
if mono --version > /dev/null 2>&1; then
echo "Mono is installed locally; please uninstall first" && exit 1
fi
WORK_DIR=/tmp/7digital-mono-work
rm -rf $WORK_DIR
mkdir $WORK_DIR
cd $WORK_DIR
MONO_VERSION=$1
MONO_DIR="mono-$MONO_VERSION"
SEVEND_VERSION="701"
MONO7D_VERSION=$MONO_VERSION'.'$SEVEND_VERSION
MONO7D_NAME="mono-7d"
echo "Downloading $MONO_VERSION"
wget http://download.mono-project.com/sources/mono/mono-$MONO_VERSION.tar.bz2
tar -jxf mono-$MONO_VERSION.tar.bz2
TARGET_DIR="$WORK_DIR/destdir"
mkdir $TARGET_DIR
cd "$WORK_DIR/$MONO_DIR"
./configure --prefix=/usr
make
make install DESTDIR="$TARGET_DIR"
cd $WORK_DIR
fpm -s dir \
-t deb \
-n $MONO7D_NAME \
-v $MONO7D_VERSION \
-C $TARGET_DIR \
-d "libglib2.0-dev (>= 0)" \
usr/bin usr/lib usr/share usr/include usr/etc
echo "Done. Your package should be ready in $WORK_DIR"

Using CMake's fixup_bundle for bundling linux-only application

We developing some CV application, based of OpenCV, Boost, LibVLC and Caffe. Some of our customers want to deploy it on outdated(or unpopular) Linux distributions, so we must bundle all it's dependencies(and some vlc plugins), most of them can be found in any actual distro, but we have custom build of libcaffe vendored in our repo. So, now i solve it with this bash script:
#!/bin/bash
set -uex
export LD_LIBRARY_PATH=./contrib/caffe.arch32/lib/
function copy_deps {
libs=$(LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux.so.2 "$1" | cut -d" " -f 3 | sort |uniq | grep -v '^$')
for lib in $libs
do
cp -un "$lib" ./bundle
done
}
mkdir -p bundle
mkdir -p ./bundle/vlc/plugins
cp -r /usr/lib/vlc/plugins ./bundle/vlc
rm -rf ./bundle/vlc/plugins/lua
rm -rf ./bundle/vlc/plugins/gui
rm -rf ./bundle/vlc/plugins/visualization
for plugin in $(find ./bundle/vlc/plugins -name "*.so")
do
copy_deps "$plugin"
done
copy_deps ./detector
cp /lib/ld-linux.so.2 ./bundle
cp ./detector ./bundle
cp ./config.ini ./bundle
mkdir -p ./bundle/config
cp -r ./config/nn ./bundle/config
cp -r ./config/neuron ./bundle/config
echo "LD_LIBRARY_PATH=./ ./ld-linux.so.2 ./detector 2> /dev/null" > ./bundle/run.sh
chmod +x ./bundle/run.sh
zip -q -r bundle.zip bundle
It works fine, but only for executable build(we need shared lib too), only for x86_32 distros. We build our project with cmake, so after reading it's docs i noticed, that fixup_bundle is cmake-way for bundling. All examples and blogs about fixup_bundle is very simple, or related with OSX or Windows. So, i append my CMakeLists.txt
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
set(BUNDLE_NAME ${PROJECT_NAME})
set(BUNDLE_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}")
set(APPS ${BUNDLE_PATH})
list(APPEND DIRS ${CMAKE_INSTALL_PREFIX}/${LIBDIR} ${CAFFE_LINK_PATH} /lib/ /usr/lib)
list(APPEND LIBS)
INSTALL(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${LIBS}\" \"${DIRS}\")
" COMPONENT Runtime)
And then try to run make install, I noticed that only our custom libcaffe is bundled, no boost, no opencv, no VLC. Why? How to bundle all dependencies?
OS: Arch Linux.

Can I remove directory after $git clone and $make install

I wrote myself a litte script to install opencv under ubuntu14.04. Can I remove the directory 3party after the make install sorted the lib into system directories or are there dependencies? (Remove not only the MYBUILD but the complete 3party)
echo "\nInstall OpenCV?...<any key>\n"
read inp1; # $inp1
mkdir 3party;
cd 3party;
git clone https://github.com/Itseez/opencv.git
cd opencv;
mkdir MYBUILD;
cd MYBUILD;
#sudo mkdir -p /usr/local/lib/opencv;
cmake -L -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local .. ;
echo"check if path is ok?...<any key> or abort";
read inp1; # $inp1
make;
#sudo mkdir -p /usr/local/lib/opencv;
make install;
cd ../../..;
chmod -R 777 3party;
echo "\nDone.\nPlease exit...<any key>";
EDIT: I did tag it cmake because the configuration step is performed with this build tool. Also the tutorial on the OpenCV website stated it. Please correct me if wrong.
Building OpenCV from Source Using CMake, Using the Command Line
Normally, after installation of any package its source and binary directories can be safetly removed. OpenCV follows this convention too.