Failed to link osmesa correctly - opengl

Mesa version = 12.0.1
Tried version before this as well.
At link time this error comes up: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libGL.so: undefined reference to _glapi_tls_Dispatch'.
The script i am using to install mesa:
#!/bin/bash
make -j4 distclean # if in an existing build
autoreconf -fi
./configure \
CXXFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
CFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
--disable-xvmc \
--disable-glx \
--disable-dri \
--with-dri-drivers="" \
--with-gallium-drivers="swrast" \
--enable-texture-float \
--enable-shared-glapi \
--disable-egl \
--with-egl-platforms="" \
--enable-gallium-osmesa \
--enable-llvm-shared-libs=yes \
--enable-gallium-llvm=yes \
--prefix=/home/ec2-user/new-mesa/mesaBuild/
make -j2
make -j4 install
After installation :
Added prefix(defined in script) to /etc/ld.so.conf' and ran ldconfig
Then in link command: -Lprefix -lOSMesa
What am i doing wrong?

Related

CMake Cross compile Arm64 error “unrecognised command line option ‘-msse’”

I am trying to cross-compile openCV for an Arm64 linux platform and am getting the following errors
aarch64-linux-gnu-gcc: error: unrecognised command line option ‘-msse’; did you mean ‘-fdse’?
aarch64-linux-gnu-gcc: error: unrecognised command line option ‘-msse2’
aarch64-linux-gnu-gcc: error: unrecognised command line option ‘-msse3’
I understand that the -msse flags are not compatible with arm64, yet when I generate my makefile from CMake, these flags are include.
My CMake command is
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-10/bin/nvcc \
-DCUDA_HOST_COMPILER=/opt/l4t-gcc-toolchain-64-bit-32-7.1/bin/aarch64-linux-gnu-gcc \
-DCUDA_INCLUDE_DIRS=/usr/local/cuda-10/targets/aarch64-linux/include \
-DCUDA_CUDART_LIBRARY=/usr/local/cuda-10/targets/aarch64-linux/lib/libcudart.so \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D BUILD_EXAMPLES=OFF \
-D WITH_CUDA=ON \
-D CUDA_ARCH_BIN="6.2" \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.4.0/modules/ \
-D ENABLE_CXX11=ON ..
I am building on linux ubuntu 18.4.
How to do I tell CMake that the platform is Arm64?
Thanks
I resolved the issue, the missing flag I was looking for was
-D CMAKE_TOOLCHAIN_FILE=../platforms/linux/aarch64-gnu.toolchain.cmake

building c++ opencv 4 with cuda ubuntu 16/04

I'm trying to build opencv' with cuda 10.2. When the following command :
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DWITH_TBB=ON -DWITH_CUDA=ON \
-DBUILD_opencv_cudacodec=OFF \
-DENABLE_FAST_MATH=1 \
-DWITH_CUBLAS=1 \
-DWITH_V4L=ON \
-DWITH_OPENGL=ON \
-DWITH_GSTREAMER=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DOPENCV_ENABLE_NONFREE=ON \
-DBUILD_EXAMPLES=TRUE \
-DBUILD_PERF_TESTS=FALSE \
-DEBUILD_TESTS=FALSE ../../opencv
I have the following issue :
Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) (Required is at least version "6")
of course I have installed cudnn7 corresponding to cuda 10.2, I the installation test passed.
Can someone help ?
To fix the problem I added the following options for cmake :
-DCUDNN_INCLUDE_DIR=/usr/local/cuda/include \
-DCUDNN_LIBRARY=/usr/local/cuda/lib64/libcudnn.so.7.6.5 \
You may also need to add:
-DCUDNN_VERSION='7.6'
Or in my case it was:
-DCUDNN_VERSION='8.0'

Packages missing while compiling Inkscape source code on Windows with MINGW64

I am trying to compile the source code for Inkscape following this guide https://wiki.inkscape.org/wiki/index.php/Compiling_Inkscape_on_Windows_with_MSYS2
I get the following errors
-- Checking for modules 'harfbuzz;pangocairo;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42
-- No package 'harfbuzz' found
-- No package 'pangocairo' found
-- No package 'pangoft2' found
-- No package 'fontconfig' found
-- No package 'gsl' found
-- No package 'gmodule-2.0' found
-- No package 'libsoup-2.4' found
I found this answer Error while compiling Inkscape from source code but that only works for Ubuntu and I am working on Windows.
I ran this script
msys2installdeps.sh
# install Inkscape dependencies (required)
eval pacman -S $PACMAN_OPTIONS \
$ARCH-double-conversion \
$ARCH-gc \
$ARCH-gsl \
$ARCH-libxslt \
$ARCH-boost \
$ARCH-gtk3 \
$ARCH-gtkmm3 \
$ARCH-gdl \
$ARCH-libsoup
# install Inkscape dependencies (optional)
eval pacman -S $PACMAN_OPTIONS \
$ARCH-poppler \
$ARCH-potrace \
$ARCH-libcdr \
$ARCH-libvisio \
$ARCH-libwpg \
$ARCH-aspell \
$ARCH-aspell-en \
$ARCH-gtkspell3
# install ImageMagick (as Inkscape requires old version ImageMagick 6 we have to specify it explicitly)
# to prevent future updates:
# add the line
# "IgnorePkg = mingw-w64-*-imagemagick"
# to
# "C:\msys64\etc\pacman.conf"
# or (always!) run pacman with the additional command line switch
# --ignore=mingw-w64-*-imagemagick
for arch in $(eval echo $ARCH); do
wget -nv https://gitlab.com/ede123/bintray/raw/master/${arch}-imagemagick-6.9.10.69-1-any.pkg.tar.xz \
&& pacman -U $PACMAN_OPTIONS ${arch}-imagemagick-6.9.10.69-1-any.pkg.tar.xz \
&& rm ${arch}-imagemagick-6.9.10.69-1-any.pkg.tar.xz
done
# install Python and modules used by Inkscape
eval pacman -S $PACMAN_OPTIONS \
$ARCH-python3 \
$ARCH-python3-pip \
$ARCH-python3-lxml \
$ARCH-python3-numpy \
$ARCH-python3-pillow \
$ARCH-python3-six \
$ARCH-python3-gobject
PACKAGES="coverage pyserial scour"
for arch in $(eval echo $ARCH); do
case ${arch} in
mingw-w64-i686)
/mingw32/bin/pip3 install --upgrade --upgrade-strategy eager ${PACKAGES} || \
/mingw32/bin/pip3 install --upgrade ${PACKAGES}
;;
mingw-w64-x86_64)
C:/MinGW/opt/python3/Scripts/pip3 install --upgrade --upgrade-strategy eager ${PACKAGES} || \
C:/MinGW/opt/python3/Scripts/pip3 install --upgrade ${PACKAGES}
;;
esac
done
The script downloads and installs Inkscape's dependencies.

Correct iOS architecture names for autotools?

What are the standard architecture names of mobile platforms, namely ARM-based, for autotools?
I've tried to build some C/C++ libs for iOS including arm64, armv7, and iOS simulators (i386 and x86_64), but I always ended up having identical binaries for arm64 and x86_64-simulator, which in turns fails the universal binary build by lipo. I've tried to set the --build and --host switches to one of the following pairs
For arm64: --build=x86_64-apple-darwinuname -r, --host=arm64
For x86_64-simulator: --build=x86_64-apple-darwinuname -r, --host=x86_64-apple-darwinuname -r
To my surprise, running the following script,
## Environments
ScriptDir="$( cd "$( dirname "$0" )" && pwd )"
cd - &> /dev/null
# Exit the build pass if any command returns a non-zero value
#set -o errexit
# Echo commands
set -x
DARWIN=darwin`uname -r`
MIN_SDK_VERSION=8.0
IPHONEOS_SYSROOT=`xcrun --sdk iphoneos --show-sdk-path`
IPHONESIMULATOR_SYSROOT=`xcrun --sdk iphonesimulator --show-sdk-path`
# Verbose clang output
#CLANG_VERBOSE="--verbose"
CC=/usr/bin/clang
CXX=/usr/bin/clang
SILENCED_WARNINGS="-Wno-unused-local-typedef -Wno-unused-function"
STDLIB=libc++
CFLAGS="${CLANG_VERBOSE} ${SILENCED_WARNINGS} -DNDEBUG -g -O0 -pipe -fPIC -fcxx-exceptions"
CXXFLAGS="${CFLAGS} -std=c++11 -stdlib=${STDLIB}"
LDFLAGS="-stdlib=${STDLIB}"
LIBS="-lc++ -lc++abi"
PROTOC=`which protoc`
SOURCE_DIR="$ScriptDir"
PREFIX="$ScriptDir"/_build
if [ -d ${PREFIX} ]
then
rm -rf "${PREFIX}"
fi
mkdir -p "${PREFIX}/platform" &> /dev/null
## Functions
build_arch() {
HOST=$1
ARCH=$2
PLATFORM_CFLAGS=$3
PLATFORM_NAME=${ARCH}
SYSROOT=${IPHONEOS_SYSROOT}
ARCH_BITS=x86_64
if [[ $ARCH==armv7 || $ARCH==armv7s ]]; then
ARCH_BITS=i386
fi
CC="${CC}"
CFLAGS="${CFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch ${ARCH} -isysroot ${SYSROOT} ${PLATFORM_CFLAGS}" \
CXX="${CXX}" \
CXXFLAGS="${CXXFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch ${ARCH} -isysroot ${SYSROOT}" \
LDFLAGS="-arch ${ARCH} -miphoneos-version-min=${MIN_SDK_VERSION} ${LDFLAGS}" \
LIBS="${LIBS}" \
./configure \
--without-gcc \
--disable-ld-version-script \
--build=x86_64-apple-${DARWIN} \
--host=${HOST} \
--with-protoc=${PROTOC} \
--disable-shared \
--prefix=${PREFIX} \
--exec-prefix=${PREFIX}/platform/${PLATFORM_NAME}
make -j8
make install
}
build_simulator() {
ARCH=$1
PLATFORM_CFLAGS=$2
HOST=${ARCH}-apple-${DARWIN}
PLATFORM_NAME=${ARCH}-simulator
SYSROOT=${IPHONESIMULATOR_SYSROOT}
CC="${CC}" \
CFLAGS="${CFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch ${ARCH} -isysroot ${SYSROOT} ${PLATFORM_CFLAGS}" \
CXX="${CXX}" \
CXXFLAGS="${CXXFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch ${ARCH} -isysroot ${SYSROOT}" \
LDFLAGS="-arch ${ARCH} -mios-simulator-version-min=${MIN_SDK_VERSION} ${LDFLAGS}" \
LIBS="${LIBS}" \
./configure \
--without-gcc \
--disable-ld-version-script \
--build=x86_64-apple-${DARWIN} \
--host=${HOST} \
--with-protoc=${PROTOC} \
--disable-shared \
--prefix=${PREFIX} \
--exec-prefix=${PREFIX}/platform/${PLATFORM_NAME}
make -j8
make install
}
build_fat_lib() {
OUT=${PREFIX}/universal
mkdir -p ${OUT}
PLATFORM_ROOT=${PREFIX}/platform
LIPO=lipo
LIB=libprotobuf.a
${LIPO} ${PLATFORM_ROOT}/arm64/lib/${LIB} \
${PLATFORM_ROOT}/x86_64-simulator/lib/${LIB} \
-create \
-output ${OUT}/${LIB}
LIB_LITE=libprotobuf-lite.a
${LIPO} ${PLATFORM_ROOT}/arm64/lib/${LIB_LITE} \
${PLATFORM_ROOT}/x86_64-simulator/lib/${LIB_LITE} \
-create \
-output ${OUT}/${LIB_LITE}
}
## Build pass
cd ${SOURCE_DIR}
./autogen.sh
build_simulator x86_64 "-fembed-bitcode"
build_arch arm arm64 "-fembed-bitcode"
build_fat_lib
echo DONE!
, I end up getting complaints from lipo:
+ lipo /path/to/protobuf/_build/platform/arm64/lib/libprotobuf.a /path/to/protobuf/_build/platform/x86_64-simulator/lib/libprotobuf.a -create -output /path/to/protobuf/_build/universal/libprotobuf.a
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /path/to/protobuf/_build/platform/arm64/lib/libprotobuf.a and /path/to/protobuf/_build/platform/x86_64-simulator/lib/libprotobuf.a have the same architectures (x86_64) and can't be in the same fat output file
My first impression is that I'm misusing architecture names, and I don't know where to get the standard names. Is that it?
Solved it myself.
It turns out that the real problem is not a wrong arch triplet, but an inappropriate compiler executable assigned to CC/CXX. You gotta use
SDK="iphoneos"
export CC=$(xcrun --find --sdk "${SDK}" clang)
export CXX=$(xcrun --find --sdk "${SDK}" clang++)
export CPP=$(xcrun --find --sdk "${SDK}" cpp)
GOTCHA #1
config.guess as suggested by #JohnBolinger will always return
x86_64-apple-darwin18.7.0
This leads to the wrong x86_64 build that I had before.
GOTCHA #2
Observe the Xcode build log and you may find -target arm64-apple-ios13.1 as a Clang option, not to be confused with the autotool configure option --target. This one is useless either, unfortunately.

centos 7 make FFmpeg /libavutil/common.h:33:19: fatal error: errno.h: No such file or directory

ndk build ffmpeg 3.4.2 configure success ,but when I make it .fatal error like this
configure script is
I make it in CentOS Linux release 7.4.1708 (Core)
similar, I make fdkaac fatal error too like this
I don't know I what is the problem of system
I think you should change android ndk version
I use the ndk r16b I get the problem also
so I use the ndk r15c
I success
I holp this can help you
this is my .sh file
#!/bin/bash
rm -rf android/arm
echo "stone"
NDK=/xxxxxxx/android-ndk-r15c
NDK_VERSION=android-14
ARCH=arm
SYSROOT=$NDK/platforms/$NDK_VERSION/arch-$ARCH
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64
CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-symver \
--cross-prefix=$CROSS_COMPILE \
--target-os=android \
--arch=$ARCH \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j8
make install
}
build_one
~~~~~~~~~~~~