When trying to build Halide on Linux system with llvm-10.0 on release/10.x and master branches, facing the below issue - clang

[ 53%] Linking CXX executable test_function_dag
/bin/ld: ../../libHalide.so.10.0.0: undefined reference to `typeinfo for llvm::SectionMemoryManager'
collect2: error: ld returned 1 exit status
make[2]: *** [src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/build.make:134: src/autoschedulers/adams2019/test_function_dag] Error 1
make[1]: *** [CMakeFiles/Makefile2:2328: src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
I'm using pre-built LLVM binaries and below cmake command to configure
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=/home/harry/llvm/lib/cmake/llvm ../
Any advice and suggestions will be greatly appreciated.

I cloned Halide from release/10.x, and compiled against the LLVM 10.0.0 binaries obtained here. On Ubuntu 20.04 LTS, I had to also apt install libtinfo5 because these binaries are built against old system libraries.
I noticed that the official binaries are not built with RTTI enabled (ugh) and was able to repro and fix. There's a bug in dependencies/llvm/CMakeLists.txt. Find the line that reads:
$<$<COMPILE_LANG_AND_ID:CXX,GCC,Clang,AppleClang>:-fno-rtti>)
and change GCC to GNU. We don't test with non-RTTI LLVM, which is why this wasn't caught.

Related

ld can't find shared boost library in cmake build in a docker container

I'm working on a cmake project which linked to boost libraries. I want to link to shared boost_unit_test_framework and static the others. A part of cmakelists.txt as below:
set(Boost_USE_STATIC_LIBS on)
add_definitions(-DBOOST_TEST_DYN_LINK)
find_package (Boost REQUIRED COMPONENTS timer system OPTIONAL_COMPONENTS chrono)
find_library(boost_test boost_unit_test_framework /opt/boost/lib)
set (TEST test-suite)
add_executable (${TEST} ${Test_SRC})
message(STATUS "##########################${boost_test}")
target_link_libraries (${TEST} ${boost_test})
target_link_libraries (${TEST} ${Boost_LIBRARIES})
I tried to build it in a docker container, link errors reported:
/usr/bin/ld: cannot find -lboost_unit_test_framework
collect2: error: ld returned 1 exit status
make[2]: *** [QuantLib/test-suite/CMakeFiles/quantlib-test-suite.dir/build.make:1574: QuantLib/test-suite/quantlib-test-suite] Error 1
make[1]: *** [CMakeFiles/Makefile2:1267: QuantLib/test-suite/CMakeFiles/quantlib-test-suite.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Some information:
1.My cmake version is 3.11.4; boost version is 1.74, installed under /opt/boost.
2.If I build it on a linux server, there is no error; If I build it in a docker continer, errors emited. The docker continer has almose same settings with the linux server: centos8.1/cmake3.11/boost1.74
3.${boost_test} message in cmakelists.txt show a full path: /opt/boost/lib/libboost_unit_test_framework.so
4.Make a soft link to libboost_unit_test_framework.so under /usr/lib can fix the error, but I don't want to change the container environment. I want to fix it in CMake.
5.Shared libs:
Any idea?

ImageMagick 7.0.7-34 installation gives "undefined reference to `PNGSetExifProfile'"

I'm trying to install ImageMagick 7.0.7-34 on a ubuntu 16.04,
I'm using wget to download the latest version (7.0.7-34) from here http://www.imagemagick.org/download/ImageMagick.tar.gz, then after extracting the tar, I'm running the following inside the extracted folder:
sudo ./configure --with-pango
sudo make
which gives the following error:
make all-am
make[1]: Entering directory '/usr/local/sources/ImageMagick-7.0.7-34'
CCLD utilities/magick
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `PNGSetExifProfile'
collect2: error: ld returned 1 exit status
Makefile:7042: recipe for target 'utilities/magick' failed
make[1]: *** [utilities/magick] Error 1
make[1]: Leaving directory '/usr/local/sources/ImageMagick-7.0.7-34'
Makefile:5178: recipe for target 'all' failed
make: *** [all] Error 2
I've searched but found nothing concerning this error!, anyone knows how to fix this?
--Update--
A similar issue was opened on ImageMagick's github repo, just an hour ago
This was a mistake we made when adding support for the PNG eXIf chunk. This will be resolved in ImageMagick 7.0.7-35. If you upgrade your libpng library you can also fix the build. You will need a version of libpng that has PNG_READ_eXIf_SUPPORTED defined.
p.s. Next time it will be better to create an issue here: https://github.com/ImageMagick/ImageMagick/issues. You will get a much faster response.

"unable to find utility g++" while trying to compile a MobileSubstrate tweak with Theos (OSX)

OSX Yosemite 10.10.2
I recently installed Theos following this guide, got no problems. However when I try to compile a simple MS tweak, I get this error in Terminal.app:
MBP:noeditnc ned$ cd /Users/ned/noeditnc
MBP:noeditnc ned$ make
Making all for tweak NoEditNC...
Preprocessing Tweak.xm...
Compiling Tweak.xm (armv7)...
xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
make[3]: *** [.theos/obj/armv7/Tweak.xm.5e67a2f0.o] Error 72
make[2]: *** [.theos/obj/armv7/NoEditNC.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [NoEditNC.all.tweak.variables] Error 2
I have Command Line Tools and Xcode both installed and updated to the latest version. Google couldn't help... What am I doing wrong?
EDIT: Clang++ is installed.
MBP:noeditnc ned$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
EDIT 2: Found a solution! I had the wrong sdk version number in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ (iPhoneOS8.1 instead of iPhoneOS8.2)

compile vlc for android

I am trying to compile vlc for android in RHEL 6.4 (Santiago). I am following the instructions given in this page https://wiki.videolan.org/AndroidCompile. I am getting some errors.
First is when I build this, I get error in git.
error: unknown switch `B'. refer http://txt.do/6tjh for log
I changed the git checkout -B android ${TESTED_HASH} to git checkout -b android ${TESTED_HASH}. Then this error does not come
Then when I run sh compile.sh, I get following errors (refer http://tny.cz/bb552912 I have removed some part of log which had code to download packages like automake, protobuf, ragel etc)
rmdir: failed to remove /root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype/config': No such file or directory
make[1]: [install] Error 1 (ignored)
rmdir: failed to remove `/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype': No such file or directory
make[1]: [install] Error 1 (ignored)
Then if I again run sh compile.sh, weird things happen. I don't get this error again, but it builds some library and then stops.
First it build libdvdcss and then stops (refer http://tny.cz/5f3ab58f)
It ends like
Libraries have been installed in:
/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
use the `-Wl,-rpath -Wl,LIBDIR' linker flag
have your system administrator add LIBDIR to `/etc/ld.so.conf'
make[2]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
make[1]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
touch .dvdcss
Then each time I run "sh compile.sh" it build one more library and then stops.
it has build following libraries
libopenjpeg (http://tny.cz/86236e8b)
libgpg-error http://tny.cz/26c5626b)
ffmpeg (http://tny.cz/1f05aa0f)
gmp
libgcrypt
iconv
nettle
libjpeg
Finally I get an following error and I am not able to do any after that (http://tny.cz/ed7798ea)
autopoint: * The AM_GNU_GETTEXT_VERSION declaration in your configure.ac file requires the infrastructure from gettext-0.18 but this version is older. Please upgrade to gettext-0.18 or newer.
autopoint: * Stop.
autoreconf: autopoint failed with exit status: 1
configure.in:20: error: possibly undefined macro: AM_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /root/Documents/android/android/vlc/extras/tools/build/bin/autoconf failed with exit status: 1
make: *[.ogg] Error 1
I am not able to find gettext package with version > .18 for RHEL 6.4. Maximum available is .17 which is installed
Is not this weird. Should not doing "sh compile.sh" build all libraries and I should not have to do this again and again.
Also Is RHEL 6.4 (Santiago) compatible for building vlc android
Any help for these errors

I cannot obtain the rpm of ContextBroker

I have tried to obtain the rpm associated to ContextBroker component (https://github.com/telefonicaid/fiware-orion.git) but I have obtained the following error after executing make rpm.
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoNotifyContextAvailability.cpp.o
Linking CXX static library libmongoBackend.a
make[4]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
[ 98%] Built target mongoBackend
make[3]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next'
error: Bad exit status from /var/tmp/rpm-tmp.NPtnCN (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.NPtnCN (%build)
make: *** [rpm] Error 1
Previously to this stage I compiled and executed the unit tests as well as functional tests with no problems I am working on Red Hat 4.4.7-3 with repo/branch:
https://github.com/telefonicaid/fiware-orion/tree/release/iotplatform-v1
Thanks for your help
UPDATE:
The linux distribution used was CentOS 6.4
This problems is solved if you install cantcoap and COAP client, as described in the Orion README.md file, then execute make rpm.
Note that although COAP stuff is optional to build the code itself with make release or make debug the RPM building target needs them by the time being (we probably fix this in the future).
UPDATE: the fix of the RPM makefile target is being dealed at this Github.com issue: https://github.com/telefonicaid/fiware-orion/issues/579

Resources