LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Installing and packaging Caffe on Slackware (https://www.linuxquestions.org/questions/slackware-14/installing-and-packaging-caffe-on-slackware-4175632155/)

Linux.tar.gz 06-18-2018 07:23 AM

Installing and packaging Caffe on Slackware
 
Hi,

I use Slackware64-current.
I have a working nvidia/cudatoolkit/cudnn setup.

I have this in my .bashrc:
Code:

CUDA_HOME=/usr/share/cuda
I installed those deps from sbopkg (may have a few others previously installed not listed here):
openblas
protobuf
hdf5
gflags
glog
lmdb
leveldb
snappy

I did:
Code:


git clone https://github.com/BVLC/caffe.git

sed -e "s/# USE_CUDNN := 1/USE_CUDNN := 1/" caffe/Makefile.config.example > caffe/Makefile.config
sed -i -e "s/CUDA_DIR := \/usr\/local\/cuda/CUDA_DIR := \/usr\/share\/cuda/" caffe/Makefile.config
sed -i -e "s/BLAS := atlas/BLAS := open/" caffe/Makefile.config
sed -i -e "s/\/usr\/lib/\/usr\/lib64/" caffe/Makefile.config
sed -i -e "s/\/usr\/local\/include/\/usr\/include/" caffe/Makefile.config

sed -i -e "s/# OPENCV_VERSION := 3/OPENCV_VERSION := 3/" caffe/Makefile.config
# to get rid of => nvcc fatal  : Unsupported gpu architecture 'compute_20'
sed -i -e "s/-gencode arch=compute_20,code=sm_20//" caffe/Makefile.config
sed -i -e "s/-gencode arch=compute_20,code=sm_21//" caffe/Makefile.config


make all -j8
make test
make runtest

Everything is ok, but now I have no idea how to make a package from this.

Any help is appreciated.

RandomTroll 06-18-2018 08:50 AM

Code:

makepkg
? No?

business_kid 06-18-2018 09:00 AM

Neither do I, frankly, because the information is a bit garbled and the make procedure a bit odd. Some of those appear to have non standard make systems.

The usual thing I do is grep the Makefile for DESTDIR
Code:

grep DESTDIR Makefile*
If the DESTDIR is there, simply use an install directory. I use /tmp/pack. Run
Code:

make DESTDIR=/tmp/pack install
at the install stage

If there's a non standard make system, you may have to copy files into /tmp/pack. /tmp/pack is the / for your package, so you would use /tmp/pack/usr/lib64 or whatever.

Finally, chdir to /tmp/pack and run
Code:

makepkg ../packagename.txz
to make up the package.

Linux.tar.gz 06-18-2018 11:38 AM

It's not that simple as there's no rule for "install".

Alien Bob 06-18-2018 12:27 PM

It's simple. Create the package directories manually, copy the built binaries and other stuff you need into those directories, add a slack-desc file and some documentation, then call makepkg.
If you think that that's not simple then simply search slackbuilds.org for a SlackBuild script that does roughly the same and use that for your own package.

Linux.tar.gz 06-19-2018 05:37 AM

Unfortunately, the folder seems to contain only includes, build is empty.
$ ls
CMakeLists.txt CONTRIBUTORS.md LICENSE Makefile.config README.md caffe.cloc data docker examples matlab python src
CONTRIBUTING.md INSTALL.md Makefile Makefile.config.example build cmake distribute docs include models scripts tools

business_kid 06-20-2018 02:35 AM

I would expect replacements for libGL.so and other libraries, and a few executable binaries. Nvidia is a reasonably orderly in their packages. Is there a Makefile? It will have an install section. Otherwise, it's in the bash script.Includes are usually given, not made. Check subdirectories.

Linux.tar.gz 06-20-2018 04:56 AM

I have this in the Makefile:
LIB_BUILD_DIR := $(BUILD_DIR)/lib

I searched the folders, there's only empty bin and lib folders in ./distribute
Something also annoying is that the CMake build doesn't seem to use the Makefile.config

Linux.tar.gz 06-20-2018 05:16 AM

I made a little progress:
Because of the error with make distribute:
/usr/bin/ld: cannot find -lboost_python

I did:

ln -s /usr/lib64/libboost_python27.so /usr/lib64/libboost_python.so

and

sed -i -e "s/dist-packages/site-packages/g" caffe/Makefile.config

permitted to use the

make distribute

command.
The ./distribute folder is now populated.

business_kid 06-22-2018 02:05 PM

Have you libGL{version}.so, and the other libGL* libs - about 3 of them?

Linux.tar.gz 06-23-2018 04:13 AM

Nope, there's nothing GL-related in the whole source/build folder.

I was able to use caffe with linking here, not packaging and installing, I guess that's ok for me now.


All times are GMT -5. The time now is 01:34 PM.