Installing openpose on Colab - jupyter-notebook

I have been trying to install openpose on google colab using the following script.
import os
from os.path import exists, join, basename, splitext
git_repo_url = 'https://github.com/CMU-Perceptual-Computing-Lab/openpose.git'
project_name = splitext(basename(git_repo_url))[0]
if not exists(project_name):
# see: https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/949
# install new CMake becaue of CUDA10
!wget -q https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.tar.gz
!tar xfz cmake-3.13.0-Linux-x86_64.tar.gz --strip-components=1 -C /usr/local
# clone openpose
!git clone -q --depth 1 $git_repo_url
!sed -i 's/execute_process(COMMAND git checkout master WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/execute_process(COMMAND git checkout f019d0dfe86f49d1140961f8c7dec22130c83154 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/g' openpose/CMakeLists.txt
# install system dependencies
!apt-get -qq install -y libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev opencl-headers ocl-icd-opencl-dev libviennacl-dev
# install python dependencies
!pip install -q youtube-dl
# build openpose
!cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j`nproc`
Here is a link to that colab notebook Link to colab notebook . Worked fine there. However, when I try the same script on my own colab notebook I get the following error.
[ 82%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
[ 82%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/math_functions.cpp.o
[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/signal_handler.cpp.o
[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/upgrade_proto.cpp.o
[ 84%] Linking CXX shared library ../../lib/libcaffe.so
CMake Error: failed to create symbolic link '../../lib/libcaffe.so': operation not supported on socket
CMake Error: cmake_symlink_library: System Error: Operation not supported
src/caffe/CMakeFiles/caffe.dir/build.make:2215: recipe for target 'lib/libcaffe.so.1.0.0' failed
make[5]: *** [lib/libcaffe.so.1.0.0] Error 1
make[5]: *** Deleting file 'lib/libcaffe.so.1.0.0'
CMakeFiles/Makefile2:240: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/openpose_lib.dir/build.make:110: recipe for target 'caffe/src/openpose_lib-stamp/openpose_lib-build' failed
make[2]: *** [caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/openpose_lib.dir/all' failed
make[1]: *** [CMakeFiles/openpose_lib.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Don't know why I get this error.
CMake Error: failed to create symbolic link '../../lib/libcaffe.so': operation not supported on socket
Any help would be appreciated. Thanks in advance.

There is probably some version issue of cmake, CUDA and cuDNN. Check for compatibility.

Related

Installing R 3.5.0 with --enable-R-shlib

I am trying to install R 3.5.0 from source with the flag --enable-R-shlib under Linux Mint. Configuring and installing it without the flag works fine, but RStudio requires the flag to be set. However, when running
./configure --enable-R-shlib
make
I get the error
/usr/bin/ld: CommandLineArgs.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
CommandLineArgs.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:177: recipe for target 'libR.so' failed
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:135: recipe for target 'R' failed
make[2]: *** [R] Error 2
make[2]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:28: recipe for target 'R' failed
make[1]: *** [R] Error 1
make[1]: Leaving directory '/home/hps/Downloads/R-3.5.0/src'
Makefile:60: recipe for target 'R' failed
make: *** [R] Error 1
I tried setting the -fPIC flag as mentioned in the error message following the advice from [1]
CC="gcc -fPIC" ./configure --enable-R-shlib
to no avail, I still get the same error message.
[1] Passing a gcc flag through makefile
After adding these PPAs for Ubuntu, I was able to update R to 3.5.0 for my Linux Mint 17.3 Rosa.
sudo add-apt-repository ppa:marutter/rrutter3.5
sudo add-apt-repository ppa:marutter/c2d4u
sudo apt-get update
Ref: https://cran.r-project.org/bin/linux/ubuntu/
Edit: To compile from source, follow the suggestion here
sudo apt-get update
sudo apt-get build-dep r-base
wget https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz
tar -xvf R-3.5.0.tar.gz
cd R-3.5.0
./configure --enable-R-shlib
make
Just in case someone else runs into this problem.
The issue is the object files ".o" are already compiled without the -fpic option.
The proper solution is to remove the object files from the first build and recomplile:
make clean
./configure --enable-R-shlib
make -j 4
sudo make install
The -j 4 tells make to spawn four compile processes at a time. Adjust the number to match the number of processor cores.

fblualib installation with luarocks

I am trying to install fblualib and facing this issue that I have not been able to find a work around it.
I issued following commands:
git clone https://github.com/facebook/fblualib.git
cd fblualib/fblualib/python
luarocks make rockspec/*
and having the following output: Any help is greatly appreciated as I am really stuck in this error.
cmake -E make_directory build &&
cd build &&
cmake -DROCKS_PREFIX=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1 \
-DROCKS_LUADIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lua \
-DROCKS_LIBDIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lib \
.. &&
make
-- Found Torch7 in /home/ubuntu/usr/local/torch/install
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- thread
-- chrono
-- system
-- date_time
-- atomic
-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.14", minimum required is "2.7")
-- Found PythonInterp: /usr/local/bin/python2.7 (found version "2.7.14")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/usr/src/fblualib/fblualib/python/build
[ 11%] Linking CXX shared module lib.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/lua_module.dir/build.make:283: recipe for target 'lib.so' failed
make[2]: *** [lib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lua_module.dir/all' failed
make[1]: *** [CMakeFiles/lua_module.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
So basically I found the issue, it was all fixed by adding --enable-shared during python compilation. So I recompiled the python again and it worked. Hope it helps others and prevents them from spending the same time.

src/teamcity/teamcity_boost.cpp:22:47: fatal error: boost/test/unit_test_suite_impl.hpp: No such file or directory

I am trying to install ignite odbc driver, I have installed ignite following these steps
https://apacheignite.readme.io/docs/getting-started#installation
# Unpack the source package
$ unzip -q apache-ignite-{version}-src.zip
$ cd apache-ignite-{version}-src
# Build In-Memory Data Fabric release (without LGPL dependencies)
$ mvn clean package -DskipTests
# Build In-Memory Data Fabric release (with LGPL dependencies)
$ mvn clean package -DskipTests -Prelease,lgpl
# Build In-Memory Hadoop Accelerator release
# (optionally specify version of hadoop to use)
$ mvn clean package -DskipTests -Dignite.edition=hadoop [-Dhadoop.version=X.X.X]
After that, added IGNITE_HOME path pointing to ignite directory. Also installed ODBC driver manager http://www.unixodbc.org/
After that, followed these steps,
http://apacheignite.gridgain.org/docs/odbc-driver#section-building-on-linux
But I get this error at "make"
In file included from src/statement.cpp:29:0:
./include/ignite/odbc/statement.h:614:18: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<query::Query> currentQuery;
^
In file included from /usr/include/c++/5/bits/locale_conv.h:41:0,
from /usr/include/c++/5/locale:43,
from /usr/include/c++/5/iomanip:43,
from ../common/include/ignite/guid.h:27,
from ./include/ignite/odbc/app/application_data_buffer.h:25,
from ./include/ignite/odbc/diagnostic/diagnostic_record_storage.h:27,
from ./include/ignite/odbc/diagnostic/diagnosable.h:21,
from ./include/ignite/odbc/query/query.h:25,
from ./include/ignite/odbc/query/data_query.h:21,
from src/statement.cpp:19:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
template<typename> class auto_ptr;
^
CXX src/type_traits.lo
CXX src/utility.lo
CXXLD libignite-odbc.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc'
make[2]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc'
Making all in odbc-test
make[2]: Entering directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
Making all in include
make[3]: Entering directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test/include'
make[3]: Entering directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
CXX src/teamcity/teamcity_boost.o
src/teamcity/teamcity_boost.cpp:22:47: fatal error: boost/test/unit_test_suite_impl.hpp: No such file or directory
compilation terminated.
Makefile:625: recipe for target 'src/teamcity/teamcity_boost.o' failed
make[3]: *** [src/teamcity/teamcity_boost.o] Error 1
make[3]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
Makefile:661: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
Makefile:426: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp'
Makefile:358: recipe for target 'all' failed
make: *** [all] Error 2
I am using Ubuntu 16.04 and apache ignite 1.8.0 latest version with Java 8.
Update:
sudo apt-get install libboost-all-dev
libtoolize && aclocal && autoheader && automake --add-missing && autoreconf
./configure --enable-odbc --disable-node --disable-core
make
src/row_test.cpp:192:18: warning: unused variable ‘rowNum’ [-Wunused-variable]
const size_t rowNum = 2;
^
CXX src/utility_test.o
CXX src/queries_test.o
In file included from ../core/include/ignite/cache/cache.h:40:0,
from ../core/include/ignite/ignite.h:26,
from src/queries_test.cpp:35:
../core/include/ignite/impl/cache/cache_impl.h:27:48: fatal error: ignite/impl/interop/interop_target.h: No such file or directory
compilation terminated.
Makefile:625: recipe for target 'src/queries_test.o' failed
make[3]: *** [src/queries_test.o] Error 1
make[3]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
Makefile:661: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp/odbc-test'
Makefile:426: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/install/apache-ignite/modules/platforms/cpp'
Makefile:358: recipe for target 'all' failed
make: *** [all] Error 2
Update 2: Running with disabling tets worked
libtoolize && aclocal && autoheader && automake --add-missing && autoreconf
./configure --enable-odbc --disable-node --disable-core --disable-tests
make
make install
Though the installation is complete, still pdo connection throws exception
odbcinst -j
unixODBC 2.3.4
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /home/me/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
cat cat /usr/local/etc/odbcinst.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
Setup=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1
cat /usr/local/etc/odbc.ini - empty file - Do i need to add anything to it ? - Tried adding above config but same exception.
cat /home/me/.odbc.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1
$ignite = $dbh = new \PDO('odbc:Apache Ignite');
$ignite->prepare('select * from Person');
[PDOException]
SQLSTATE[08001] SQLConnect: 0 [unixODBC]Failed to establish connection with the host.
As you are building ODBC from sources distribution, you should either install boost libraries or disable tests, as they use boost.
To install boost run:
sudo apt-get install libboost-all-dev
To disable tests do the following in the modules/platforms/cpp:
libtoolize && aclocal && autoheader && automake --add-missing && autoreconf
./configure --enable-odbc --disable-node --disable-core --disable-tests
make

R: Compiling issue

I want to compile the R source code on my own.
In order to this, I have installed all the required packages and two more with these commands
sudo apt-get build-dep r-recommended
sudo apt install libicu-dev gobjc-5
Then, I run the usual commands to configure with two additional options
./configure --enable-R-shlib --with-ICU
Until now everything ok, but when I tried to compile with the make command and at a certain point I got these error messages
make[2]: Entering directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
begin installing recommended package MASS
Error in untar2(tarfile, files, list, exdir, restore_times) :
incomplete block on file
Makefile:51: recipe for target 'MASS.ts' failed
make[2]: *** [MASS.ts] Error 1
make[2]: Leaving directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
Makefile:39: recipe for target 'recommended-packages' failed
make[1]: *** [recommended-packages] Error 2
make[1]: Leaving directory '/home/myuser/Downloads/R-3.2.3/src/library/Recommended'
Makefile:77: recipe for target 'stamp-recommended' failed
make: *** [stamp-recommended] Error 2
I have searched online but I haven't been able to figure it out what causes that error.
Thanks in advance.
OS: Ubuntu 15.10 64bit
Briefly:
You probably need apt-get build-dep r-base to get build-dependencies, not apt-get build-dep r-recommended
Your error is from also trying to build recommended packages for which you need an additional download step as explained in the documention
So add --without-recommended-packages to the configure call.

Error in installing SimpleDB::Class

I try to install SimpleDB::Class from cpan as sudo cpan SimpleDB::Class. it needs a dependency Memcached::libmemcached. so i try to install it, but it have the following errors.
CCLD clients/memstat
CC tests/atomsmasher.o
CCLD tests/atomsmasher
CXX tests/tests_hashplus-hash_plus.o
./config/depcomp: line 611: exec: g++: not found
make[2]: *** [tests/tests_hashplus-hash_plus.o] Error 127
make[2]: Leaving directory `/home/vanitha/.cpan/build/Memcached-libmemcached-0.4406- Oq4Z_m/src/libmemcached'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/vanitha/.cpan/build/Memcached-libmemcached-0.4406- Oq4Z_m/src/libmemcached'
make: *** [install] Error 2
Unable to build libmemcached: Error running cd src/libmemcached && make install
Aborted.
No 'Makefile' created TIMB/Memcached-libmemcached-0.4406.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
could not read metadata file. Falling back to other methods to determine prerequisites
exec: g++: not found - this is the error
Try this first of all: sudo apt-get install g++

Resources