How to compile caffe_rtpose on OSX? - c++

I've recently bumped spotted caffe_rtpose and I tried to compile and run the example. Unfortunately I'm super experienced with c++ so I ran into a lot of issues compiling and linking.
I've tried tweaking the Makefile config (modified from the existing Ubuntu config). (I'm using a system running OSX 10.11.5 with an nVidia GeForce 750M and I have installed CUDA 7.5 and libcudnn):
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1
# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50 \
-gencode arch=compute_52,code=sm_52 \
# -gencode arch=compute_60,code=sm_60 \
# -gencode arch=compute_61,code=sm_61
# Deprecated
#CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
# -gencode arch=compute_20,code=sm_21 \
# -gencode arch=compute_30,code=sm_30 \
# -gencode arch=compute_35,code=sm_35 \
# -gencode arch=compute_50,code=sm_50 \
# -gencode arch=compute_50,code=compute_50
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
BLAS_INCLUDE := /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/
BLAS_LIB := /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
# $(ANACONDA_HOME)/include/python2.7 \
# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
# INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
# LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib
# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
# Q ?= #
And this is the modified version of the install_caffe_and_cpm_osx.sh script:
#!/bin/bash
echo "------------------------- INSTALLING CAFFE AND CPM -------------------------"
echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail."
function exitIfError {
if [[ $? -ne 0 ]] ; then
echo ""
echo "------------------------- -------------------------"
echo "Errors detected. Exiting script. The software might have not been successfully installed."
echo "------------------------- -------------------------"
exit 1
fi
}
# echo "------------------------- Checking Ubuntu Version -------------------------"
# ubuntu_version="$(lsb_release -r)"
# echo "Ubuntu $ubuntu_version"
# if [[ $ubuntu_version == *"14."* ]]; then
# ubuntu_le_14=true
# elif [[ $ubuntu_version == *"16."* || $ubuntu_version == *"15."* || $ubuntu_version == *"17."* || $ubuntu_version == *"18."* ]]; then
# ubuntu_le_14=false
# else
# echo "Ubuntu release older than version 14. This installation script might fail."
# ubuntu_le_14=true
# fi
# exitIfError
# echo "------------------------- Ubuntu Version Checked -------------------------"
# echo ""
echo "------------------------- Checking Number of Processors -------------------------"
NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
echo "$NUM_CORES cores"
exitIfError
echo "------------------------- Number of Processors Checked -------------------------"
echo ""
echo "------------------------- Installing some Caffe Dependencies -------------------------"
# Basic
# sudo apt-get --assume-yes update
# sudo apt-get --assume-yes install build-essential
#General dependencies
brew install protobuf leveldb snappy hdf5
# with Python pycaffe needs dependencies built from source - from http://caffe.berkeleyvision.org/install_osx.html
# brew install --build-from-source --with-python -vd protobuf
# brew install --build-from-source -vd boost boost-python
# without Python the usual installation suffices
brew install boost
# sudo apt-get --assume-yes install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler
# sudo apt-get --assume-yes install --no-install-recommends libboost-all-dev
# Remaining dependencies, 14.04
brew install gflags glog lmdb
# if [[ $ubuntu_le_14 == true ]]; then
# sudo apt-get --assume-yes install libgflags-dev libgoogle-glog-dev liblmdb-dev
# fi
# OpenCV 2.4
# sudo apt-get --assume-yes install libopencv-dev
exitIfError
echo "------------------------- Some Caffe Dependencies Installed -------------------------"
echo ""
echo "------------------------- Compiling Caffe & CPM -------------------------"
cp Makefile.config.OSX.10.11.5.example Makefile.config
make all -j$NUM_CORES
# make test -j$NUM_CORES
# make runtest -j$NUM_CORES
exitIfError
echo "------------------------- Caffe & CPM Compiled -------------------------"
echo ""
# echo "------------------------- Installing CPM -------------------------"
# echo "Compiled"
# exitIfError
# echo "------------------------- CPM Installed -------------------------"
# echo ""
echo "------------------------- Downloading CPM Models -------------------------"
models_folder="./model/"
# COCO
coco_folder="$models_folder"coco/""
coco_model="$coco_folder"pose_iter_440000.caffemodel""
if [ ! -f $coco_model ]; then
wget http://posefs1.perception.cs.cmu.edu/Users/tsimon/Projects/coco/data/models/coco/pose_iter_440000.caffemodel -P $coco_folder
fi
exitIfError
# MPI
mpi_folder="$models_folder"mpi/""
mpi_model="$mpi_folder"pose_iter_160000.caffemodel""
if [ ! -f $mpi_model ]; then
wget http://posefs1.perception.cs.cmu.edu/Users/tsimon/Projects/coco/data/models/mpi/pose_iter_160000.caffemodel -P $mpi_folder
fi
exitIfError
echo "Models downloaded"
echo "------------------------- CPM Models Downloaded -------------------------"
echo ""
echo "------------------------- CAFFE AND CPM INSTALLED -------------------------"
echo ""
But I get this error:
examples/rtpose/rtpose.cpp:1088:22: error: variable length array of non-POD element type 'Frame'
Frame frame_batch[BATCH_SIZE];
I've tried swapping the array for a vector:
std::vector<Frame> frame_batch;
std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
frame_batch.reserve(BATCH_SIZE);
That seems to take care of that compile error, but now I get a linker error:
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've searched for lib lib gomp and found a few related posts on caffe and OpenMP mentioning issues with clang on OSX and OpenMP.
What I tried:
Following this post I've installed gcc 4.9 with homebrew (as the homebrew formula for gcc 5 installs 5.9 which might be too high?)
I've set -fopenmp=libomp based on Andrey Bokhanko's answer: this didn't work for me ++-4.9: error: unrecognized command line option '-fopenmp=libomp'
I could download and build Caffe separately using the official instructions, but I can't seem to figure out how to compile this awesome looking demo.
Unfortunately I'm not experienced with c++ and OpenMP so I could really use your suggestions here. Thank you
Update: I've tried Mark Setchell's helpful suggestion of installing llvm via clang. I've updated the Makefile config to use
CUSTOM_CXX := /usr/local/opt/llvm/bin/clang++
but CUDA doesn't like it:
nvcc fatal : The version ('30801') of the host compiler ('clang') is not supported
I've tried compiling with CPU_ONLY but I still get CUDA errors:
examples/rtpose/rtpose.cpp:235:5: error: use of undeclared identifier 'cudaMalloc'
cudaMalloc(&net_copies[device_id].canvas, DISPLAY_RESOLUTION_WIDTH * DISPLAY_RESOLUTION_HEIGHT * 3 * sizeof(float));
^
examples/rtpose/rtpose.cpp:236:5: error: use of undeclared identifier 'cudaMalloc'
cudaMalloc(&net_copies[device_id].joints, MAX_NUM_PARTS*3*MAX_PEOPLE * sizeof(float) );
^
examples/rtpose/rtpose.cpp:1130:146: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
cudaMemcpy(net_copies[tid].canvas, frame.data_for_mat, DISPLAY_RESOLUTION_WIDTH * DISPLAY_RESOLUTION_HEIGHT * 3 * sizeof(float), cudaMemcpyHostToDevice);
^
examples/rtpose/rtpose.cpp:1136:108: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
cudaMemcpy(pointer + 0 * offset, frame_batch[0].data, BATCH_SIZE * offset * sizeof(float), cudaMemcpyHostToDevice);
^
examples/rtpose/rtpose.cpp:1178:13: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
cudaMemcpyHostToDevice);
^
examples/rtpose/rtpose.cpp:1192:155: error: use of undeclared identifier 'cudaMemcpyDeviceToHost'
cudaMemcpy(frame_batch[n].data_for_mat, net_copies[tid].canvas, DISPLAY_RESOLUTION_HEIGHT * DISPLAY_RESOLUTION_WIDTH * 3 * sizeof(float), cudaMemcpyDeviceToHost);
^
examples/rtpose/rtpose.cpp:1202:155: error: use of undeclared identifier 'cudaMemcpyDeviceToHost'
cudaMemcpy(frame_batch[n].data_for_mat, net_copies[tid].canvas, DISPLAY_RESOLUTION_HEIGHT * DISPLAY_RESOLUTION_WIDTH * 3 * sizeof(float), cudaMemcpyDeviceToHost);
I'm no expert, but having a quick scan through the code, I don't see how the CPU_ONLY version will work with the cuda calls.
Having another look at the caffe OSX Installation guide, I may try the route >not for the faint of heart

I have finally managed to compile the rtpose example.
Here's what I did:
Swapped the Frame array for a vector in examples/rtpose/rtpose.cpp, as mentioned above:
std::vector<Frame> frame_batch;
std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
frame_batch.reserve(BATCH_SIZE);
Used the default clang++ compiler, after failed attempts at using gcc++-4.9 and Homebrew installed LLVM's clang++, but removed the -fopenmp flags and the -pthread linker flag, not the compiler flag, based on this answer
After the compile finished, I tried to run it, but got a libjpeg related error:
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5
The workaround was mdemirst's answer. I made a backup of the old symbolic links just in case though. I did symlink libjpeg/libpng/libtiff/libgif from ImageIO.framework.
I've commited the above config/setup script on github.
Now that the example is compiled, I still can't run it, possibly due to not enough GPU memory:
F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0) out of memory
*** Check failure stack trace: ***
# 0x10c7a89da google::LogMessage::Fail()
# 0x10c7a80d5 google::LogMessage::SendToLog()
# 0x10c7a863b google::LogMessage::Flush()
# 0x10c7aba17 google::LogMessageFatal::~LogMessageFatal()
# 0x10c7a8cc7 google::LogMessageFatal::~LogMessageFatal()
# 0x1079481db caffe::SyncedMemory::to_gpu()
# 0x107947c9e caffe::SyncedMemory::mutable_gpu_data()
# 0x1079affba caffe::CuDNNConvolutionLayer<>::Forward_gpu()
# 0x107861331 caffe::Layer<>::Forward()
# 0x107918016 caffe::Net<>::ForwardFromTo()
# 0x1077a86f1 warmup()
# 0x1077b211d processFrame()
# 0x7fff8b11899d _pthread_body
# 0x7fff8b11891a _pthread_start
# 0x7fff8b116351 thread_start
Abort trap: 6
I have tried dimming the settings down as much as possible:
./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"
But to no avail. Actually running the example may be another question in itself.

Related

How Can I Install libcrypto++6 (or libcrypto++8) and default-jre-headless

how can I install “libcrypto++6 (or libcrypto++8)” with yocto? Normally, I would add debian source.list after installation and install it with apt, but it causes many problems. Likewise, I want to install “default-jre-headless”. I use Kirkstone. I was adding those that do not have such recipes from the source code, but the source code of these is difficult to find and I did not know how to make the recipes. Below is a recipe I found for libcrypto++6, but it doesn’t work.
HOMEPAGE = "http://www.cryptopp.com/wiki/Main_Page"
BUGTRACKER = "http://sourceforge.net/apps/trac/cryptopp/"
SECTION = "libs"
LICENSE = "BSL-1.0"
LIC_FILES_CHKSUM = "file://License.txt;md5=deb6d182b0f7f8a866c42941b9f014c4"
BBCLASSEXTEND = "native nativesdk"
PR = "r1"
PVSHORT = "${#'${PV}'.replace('.','')}"
SRC_URI = " \
https://sourceforge.net/projects/cryptopp/files/cryptopp/5.6.4/cryptopp564.zip;subdir=libcryptopp-${PV} \
file://0001-Fix-cross-compilation.patch \
"
SRC_URI[md5sum] = "4ee7e5cdd4a45a14756c169eaf2a77fc"
SRC_URI[sha256sum] = "be430377b05c15971d5ccb6e44b4d95470f561024ed6d701fe3da3a188c84ad7"
inherit autotools-brokensep pkgconfig
EXTRA_OECONF = "--libdir=${base_libdir}"
#we want tegrarcm binary to run on a 32-bit architecture, on x86_64 this requires the 32-bit compatibility libs
EXTRA_OEMAKE_class-native = "CC='${CC} -m32' CXX='${CXX} -m32'"
do_compile() {
sed -i -e 's/^CXXFLAGS/#CXXFLAGS/' GNUmakefile
export CXXFLAGS="${CXXFLAGS} -DNDEBUG -fPIC"
oe_runmake -f GNUmakefile
oe_runmake libcryptopp.a
}
do_install:prepend() {
export PREFIX=${prefix}
}
do_install:append() {
if [ -f "${D}/usr/lib/libcryptopp.so" ] && [ ! -e "${D}/usr/lib/libcryptopp.so.${PV}" ]
then
mv ${D}/usr/lib/libcryptopp.so ${D}/usr/lib/libcryptopp.so.${PV}
ln -fs libcryptopp.so.${PV} ${D}/usr/lib/libcryptopp.so.5
ln -fs libcryptopp.so.${PV} ${D}/usr/lib/libcryptopp.so
fi
}

No rule to make target 'bootstrap', needed by 'distdir-am'. Stop

I'm having the following problem when using automake to 'make dist'. Below is a snap shot of the error being reported by the compiler. I'm using Debian 10.5, with the default compiler version 8.0.3; autoconf 2.69; automake 1.16.1, libtool 2.4.6
######## Problem ########
aperri#debian:~/XerlangCPL2$ make dist
make dist-gzip am__post_remove_distdir='#:'
make[1]: Entering directory '/home/aperri/XerlangCPL2'
make distdir-am
make[2]: Entering directory '/home/aperri/XerlangCPL2'
make[2]: *** No rule to make target 'bootstrap', needed by 'distdir-am'. Stop.
make[2]: Leaving directory '/home/aperri/XerlangCPL2'
make[1]: *** [Makefile:633: distdir] Error 2
make[1]: Leaving directory '/home/aperri/XerlangCPL2'
make: *** [Makefile:710: dist] Error 2
I'm including my configure.ac and makefile.am in this message with the hope that there is a solution to this problem
######## configure.ac ########
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([XerlangCPL], [1.0], [aperri1001#gmail.com])
AC_CONFIG_SRCDIR([src/xmlPROC.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
# Enable "automake" to simplify creating Makefiles
AM_INIT_AUTOMAKE([1.16.1 subdir-objects -Wall -Werror])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXXCPP
AC_PROG_CXX
# Used in conjuction with {TARGET}_CPPFLAGS = -DDEBUG in Makefile.am
AM_PROG_CC_C_O
# Checks for libraries.
AX_BOOST_BASE([1.67], [], AC_MSG_ERROR([Could not find a useful version of boost]))
AX_BOOST_FILESYSTEM
AX_BOOST_SYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_REGEX
# AX_BOOST_DATE_TIME
# AX_BOOST_THREAD
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions
PKG_CHECK_MODULES(libxml, libxml++-2.6 >= 2.10.0 )
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AC_CONFIG_FILES([Makefile doc/Doxyfile])
# AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
# AC_ARG_WITH(debug, [ --with-debug add the debugging module], [AC_DEFINE(WITH_DEBUG,1,0)
# AC_SUBST(WITH_DEBUG,1)
# CXXFLAGS="-O0 -ggdb"])
AC_OUTPUT
echo "
XErlang Compiler ($PACKAGE_NAME) version $PACKAGE_VERSION
Prefix.........: $prefix
Debug Build....: $debug
C++ Compiler...: $CXX $CXXFLAGS $CPPFLAGS
Linker.........: $LD $LDFLAGS $LIBS
"
######## makefile.am ########
ACLOCAL_AMFLAGS = -I m4 --install
bin_PROGRAMS = xerlangCPL
xerlangCPL_SOURCES = \
src/xmlPROC.cpp \
src/xml_structs.h \
src/debug.h \
src/conxsTracker.cpp \
src/conxs_tracker.h \
src/xmlConxsParser.cpp \
src/oven_control
xerlangCPL_LDFLAGS = -DDEBUG \
$(libxml_LIBS) \
$(BOOST_LDFLAGS) \
$(BOOST_SYSTEM_LDFLAGS) \
$(BOOST_FILESYSTEM_LDFLAGS) \
$(BOOST_PROGRAM_OPTIONS_LDFLAGS)
xerlangCPL_CPPFLAGS = $(libxml_CFLAGS) \
$(BOOST_CPPFLAGS)
xerlangCPL_LIBS = $(BOOST_SYSTEM_LIBS) \
$(BOOST_FILESYSTEM_LIBS) \
$(BOOST_PROGRAM_OPTIONS_LIBS)
xerlangCPL_CXXFLAGS = -lboost_filesystem -ldl -lboost_system
# start of Doxygen section
if HAVE_DOXYGEN
doxyfile.stamp:
$(DOXYGEN) $(top_srcdir)/doc/Doxyfile
echo Timestamp > $#
CLEANFILES = $(top_srcdir)/doxyfile.stamp
# all-local: doxyfile.stamp
all-local: doxyfile.stamp
# clean-local:
# rm -rf $(top_srcdir)/
endif
EXTRA_DIST = bootstrap m4/NOTES
The problem could be related to the inclusion of Boost Modules or the lack of them.
The problem is that EXTRA_DIST lists some mysterious file called bootstrap.
Makefile.am provides no instructions for building this file.
Therefore, this file is expected to already exist in the build directory, and it does not.
That's the reason for your make dist failure.
The reason for the missing file is something that you'll have to figure out on your own, the only thing that can be stated here is that its absence is the reason for your build failure.
You could, of course
touch bootstrap
and create an empty file in the build directory, which will be good enough. But you should investigate, in your project, what this file is, and where it should come from, and fix things accordingly.

failure to install ocaml-top on mac

I'm attempting to install ocaml-top on a mac but receiving the following failure message. Any idea? Thanks!
I tried:
opam install ocaml-top
And received the following
`∗ install ocaml-top 1.1.5
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ocaml-top.1.1.5] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of ocaml-top failed at
"/Users/danielfriedman/.opam/opam-init/hooks/sandbox.sh build jbuilder
build -p ocaml-top".
#=== ERROR while compiling ocaml-top.1.1.5 ====================================#
# context 2.0.2 | macos/x86_64 | ocaml-base-compiler.4.06.1 | https://opam.ocaml.org#866ea725
# path ~/.opam/4.06.1/.opam-switch/build/ocaml-top.1.1.5
# command ~/.opam/opam-init/hooks/sandbox.sh build jbuilder build -p ocaml-top
# exit-code 1
# env-file ~/.opam/log/ocaml-top-49246-ffb3fd.env
# output-file ~/.opam/log/ocaml-top-49246-ffb3fd.out
### output ###
# ocamlopt src/.main.eobjs/completion.{cmx,o} (exit 2)
# (cd _build/default && /Users/danielfriedman/.opam/4.06.1/bin/ocamlopt.opt -w -40 -g -I src/.main.eobjs -I /Users/danielfriedman/.opam/4.06.1/lib/bytes -I /Users/danielfriedman/.opam/4.06.1/lib/lablgtk2 -I /Users/danielfriedman/.opam/4.06.1/lib/ocaml/compiler-libs -I /Users/danielfriedman/.opam/4.06.1/lib/ocaml/threads -I /Users/danielfriedman/.opam/4.06.1/lib/ocp-indent/lexer -I /Users/daniel[...]
# File "src/completion.ml", line 39, characters 4-26:
# Error: Unbound value IndexScope.read_string
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build ocaml-top 1.1.5
└─
╶─ No changes have been performed`

problems I meet when installing deeplab:.build_release/lib/libcaffe.so: undefined reference to `Mat_CreateVer'

DeepLab is a state-of-art deep learning system for semantic image segmentation built on top of Caffe.I followed this website to install it:https://bitbucket.org/deeplab/deeplab-public/I clone the files to /deeplab/code and use the command:make all
and I came across the error
.build_release/lib/libcaffe.so: undefined reference toMat_CreateVer'`
Is there someone know how to solve this?I'll appreciate it a lot!Many thanks!
here is the Makefile.config .I've add the matio path to this install file:
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1
# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
# $(ANACONDA_HOME)/include/python2.7 \
# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
# /usr/lib/python3.5/dist-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /home/zhaimo/deeplab/matio-1.5.2/src
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /home/zhaimo/deeplab/matio-1.5.2/src/.libs
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib
# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
Q ?= #

Disable some feauture while building Gstreamer Lib which cause Error?

I'm build gstreamer, at the step of building gstpgood/ext/aalib
The error log is
make[3]: Entering directory `sigma-gstreamer_1-2-rc5/build/gstpgood/ext'
make -C aalib
make[4]: Entering directory `/sigma-gstreamer_1-2-rc5/build/gstpgood/ext/aalib'
CC libgstaasink_la-gstaasink.lo
cc1: error: include location "/usr/include" is unsafe for cross-compilation [-Werror=poison-system-directories]
cc1: all warnings being treated as errors
make[4]: *** [libgstaasink_la-gstaasink.lo] Error 1
My friend build the same source on the other build host did not get this error. I compared gstpgood makefiles and found that my makefile has:
AALIB_CFLAGS = -I/usr/include
AALIB_CONFIG = /usr/bin/aalib-config
AALIB_LIBS = -L/usr/lib/x86_64-linux-gnu -laa
while my friend's make file has
AALIB_CFLAGS =
AALIB_CONFIG = no
AALIB_LIBS =
This aalib is used by aasink, how can i disable aasink when compiling gstreamer???
Pass --disable-aalib to configure before running make. Check ./configure --help for many other things you could disable.
Thank Sebastian Dröge!
I also find a way to bypass aalib check by editing .m4 file in: gstreamer/ext/gstpgood/m4/aalib.m4 it worked for me
#force disable aalibtes by putting enable_aalibtest=no
AC_ARG_ENABLE(aalibtest,
AC_HELP_STRING([--disable-aalibtest],
[do not try to compile and run a test AALIB program]),
, enable_aalibtest=yes)
enable_aalibtest=no
#comment some code
# AC_PATH_PROG(AALIB_CONFIG, aalib-config, no)
# min_aalib_version=ifelse([$1], ,0.11.0,$1)
# AC_MSG_CHECKING(for AALIB - version >= $min_aalib_version)
no_aalib=""
# if test "$AALIB_CONFIG" = "no" ; then
if test x$aalib_prefix == x ; then#add this line
no_aalib=yes
else
AALIB_CFLAGS="-I$aalib_prefix/include"#add this line
AALIB_LIBS="-L$aalib_prefix/lib -laa"#add this line
# AALIB_CFLAGS=`$AALIB_CONFIG $aalibconf_args --cflags`
# AALIB_LIBS=`$AALIB_CONFIG $aalibconf_args --libs`
# aalib_major_version=`$AALIB_CONFIG $aalib_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
# aalib_minor_version=`$AALIB_CONFIG $aalib_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
# aalib_micro_version=`$AALIB_CONFIG $aalib_config_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`