fblualib installation with luarocks - torch

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.

Related

Installing openpose on Colab

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.

Kallisto build keeps failing when attempting to link CXX executable

I'm super new to coding in general so apologies for any lack of clarity or conciseness. I'm attempting to make a build for Kallisto to use in RNA sequence alignment and I'm getting stuck at the "make" stage. The cmake was successful after a little fiddling and downloading a CXX compiler, but the make keep exiting with an error status:
[ 27%] Built target htslib
[ 93%] Built target kallisto_core
[ 96%] Linking CXX executable kallisto
/home/wahanson/miniconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/kallisto.dir/build.make:88: src/kallisto] Error 1
make[1]: *** [CMakeFiles/Makefile2:130: src/CMakeFiles/kallisto.dir/all] Error 2
the main error appears to be "cannot find -lz" causing the subsequent errors. From what I understand, this is referencing zlib1g-dev and/or an inability to find it within the path. I have installed zlib1g-dev through conda and made sure to update to no avail. If anyone could let me know what I'm missing or a next place to look it'd be much appreciated. Thanks!
The error looks like the zlib package was not installed in the env. Fortunately, I've recently built kallisto and can share the Conda environment I have been using, which I've tested on both osx-64 and linux-64 platforms:
kallisto-build.yaml
name: kallisto-build
channels:
- bioconda
- r
- conda-forge
- defaults
dependencies:
- autoconf
- automake
- hdf5
- cmake
- cxx-compiler
- zlib
Create and then activate this environment:
conda env create -f kallisto-build.yaml
conda activate kallisto-build
then follow the kallisto instructions for building from source.

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.

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++

Installing package failed when trying to run to application to Meego

I'm trying to run a Hamattan Application on a Meego Device, but everytime I try to run it into the Meego device:
:-1: error: Installing package failed.
always appears. But sometimes when I check my phone the application is there and it's running.
In Settings->Applications->Manage Applications it says there:
Test2
Installation Failed
Please Help me. Thank you very much!
Compile Output:
Running build steps for project test2...
Configuration unchanged, skipping qmake step.
Starting: "C:\qtsdk\madde\bin\make.exe" -w
make: Entering directory `/c/Users/bcue/Qt/test2'
make: Nothing to be done for `first'.
make: Leaving directory `/c/Users/bcue/Qt/test2'
The process "C:\qtsdk\madde\bin\make.exe" exited normally.
Creating package file ...
Package Creation: Running command 'c:/qtsdk/madde/bin/mad dpkg-buildpackage -nc -uc -us'.
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package test2
dpkg-buildpackage: source version 0.0.1
dpkg-buildpackage: source changed by unknown <>
dpkg-buildpackage: host architecture armel
which: pgp: unknown command
debian/rules build
make: Nothing to be done for `build'.
debian/rules binary
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/test2.
/usr/bin/make INSTALL_ROOT="/c/Users/bcue/Qt/test2"/debian/test2 install
make[1]: Entering directory `/c/Users/bcue/Qt/test2'
install -m 644 -p c:/Users/bcue/Qt/test2/test2.desktop /c/Users/bcue/Qt/test2/debian/test2/usr/share/applications/
install -m 644 -p c:/Users/bcue/Qt/test2/test2.png /c/Users/bcue/Qt/test2/debian/test2/usr/share/icons/hicolor/64x64/apps/
install -m 755 -p "test2" "/c/Users/bcue/Qt/test2/debian/test2/opt/test2/bin/test2"
make[1]: Leaving directory `/c/Users/bcue/Qt/test2'
sed 's:^Icon=.*:Icon=/usr/share/icons/hicolor/64x64/apps/test2.png:' /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop > /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop.sed || echo -n
mv /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop.sed /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop || echo -n
sed 's:Exec=.*:Exec=/opt/test2/bin/test2:' /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop > /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop.sed || echo -n
mv /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop.sed /C/Users/bcue/Qt/test2/debian/test2/usr/share/applications/test2.desktop || echo -n
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dpkg-shlibdeps: warning: dependency on libgcc_s.so.1 could be avoided if "debian/test2/opt/test2/bin/test2" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libmdeclarativecache.so.0 could be avoided if "debian/test2/opt/test2/bin/test2" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libpthread.so.0 could be avoided if "debian/test2/opt/test2/bin/test2" were not uselessly linked against it (they use none of its symbols).
dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends}
dh_md5sums
dh_builddeb
a - debian-binary
a - control.tar.gz
a - data.tar.gz
dpkg-buildpackage: binary only upload (no source included)
Use of uninitialized value in undef operator at /madbin/dpkg-buildpackage line 369.
dpkg-genchanges -b -u.. >../test2_0.0.1_armel.changes
dpkg-genchanges: binary-only upload - not including any source code
Package created.
Installing package to sysroot ...
c:\Users\bcue\Qt\qt-components-qt-components\C;c:\qtsdk\madde\Users\bcue\Qt\test2\test2_0_0_1_armel.deb: No such file or directory
c:\qtsdk\madde\targets\harmattan-nokia-meego-api\bin\ar.exe:
Cannot find package name (in debian control file).
Connecting to device...
Started uploading file 'C:\Users\bcue\Qt\test2\test2_0_0_1_armel.deb'.
Successfully uploaded file 'C:\Users\bcue\Qt\test2\test2_0_0_1_armel.deb'.
Installing package to device...
warning, in file '/var/lib/dpkg/status' near line 663 package 'mp-harmattan-rm680-pr':
missing description
(Reading database ...
29097 files and directories currently installed.)
Preparing to replace test2 0.0.1 (using .../test2_0_0_1_armel.deb) ...
Unpacking replacement test2 ...
aegis-installing test2 (from 'com.nokia.maemo')
dpkg: dependency problems prevent configuration of test2:
test2 depends on libqt4-declarative (>= 4.7.4~git20110516); however:
Version of libqt4-declarative on system is 4.7.3~git20110329-0maemo1+0m6.
test2 depends on libqtcore4 (>= 4.7.4~git20110516); however:
Version of libqtcore4 on system is 4.7.3~git20110329-0maemo1+0m6.
test2 depends on libqtgui4 (>= 4.7.4~git20110516); however:
Version of libqtgui4 on system is 4.7.3~git20110329-0maemo1+0m6.
dpkg: error processing test2 (--install):
dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils ...
Errors were encountered while processing:
test2
Deployment failed.
Error while building project test2 (target: Harmattan)
When executing build step 'Deploy to Harmattan device'
did you updated your Qt Creator? (2.3.1 if I'm not wrong)
the update bring along the updated SDK for the meego harmattan,.
in that case you should also update your meego phone too because there's some dependency for the newest library. (read the error, dependency-problem)
check here for the update package
http://www.developer.nokia.com/search/search.xhtml?view=ebs&hv=fn:type%3DfnType:Terminal&s=ft&tl=0&ob=best&me=false&l=20&expandDoc=false&k=N950+device+update&oldK=N950+device+update
this one problem makes me revert my QtCreator to the old one , I'm not allowed to upgrade the phone. duh

Resources