LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-18-2018, 07:23 AM   #1
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Question 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.
 
Old 06-18-2018, 08:50 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,959

Rep: Reputation: 271Reputation: 271Reputation: 271
Code:
makepkg
? No?
 
Old 06-18-2018, 09:00 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
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.
 
Old 06-18-2018, 11:38 AM   #4
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
It's not that simple as there's no rule for "install".
 
Old 06-18-2018, 12:27 PM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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.
 
Old 06-19-2018, 05:37 AM   #6
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
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
 
Old 06-20-2018, 02:35 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
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.
 
Old 06-20-2018, 04:56 AM   #8
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
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
 
Old 06-20-2018, 05:16 AM   #9
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
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.
 
Old 06-22-2018, 02:05 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Have you libGL{version}.so, and the other libGL* libs - about 3 of them?
 
Old 06-23-2018, 04:13 AM   #11
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slpkg New Slackware packaging tool dslackw Slackware 228 11-23-2022 02:04 AM
Upgrading Slackware (packaging questions) jrdioko Slackware 5 08-17-2005 07:23 PM
Slackware packaging wombat53 Slackware - Installation 16 07-08-2005 11:44 AM
Packaging manager for Slackware 9.1 ??? Fernando534 Linux - Newbie 4 05-07-2004 02:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration