LinuxQuestions.org
Help answer threads with 0 replies.
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 12-22-2012, 08:55 AM   #1
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.0 + 14.1
Posts: 4,828

Rep: Reputation: 431Reputation: 431Reputation: 431Reputation: 431Reputation: 431
/tmp goes to 100% on compile of opencv


As the title states.

Some info. Error messages on failure:

Code:
CMake Error at data/cmake_install.cmake:36 (FILE):
  file INSTALL cannot copy file
  "/tmp/SBo/OpenCV-2.4.3/data/haarcascades/haarcascade_fullbody.xml" to
  "/tmp/SBo/package-opencv/usr/share/OpenCV/haarcascades/haarcascade_fullbody.xml".
Call Stack (most recent call first):
  cmake_install.cmake:56 (INCLUDE)


make: *** [install] Error 1
root@duelie:/home/cliff/src/opencv#
Condition of /tmp

Quote:
root@duelie:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 12396968 10632036 1135188 91% /
/dev/sda6 137412520 44607528 92804992 33% /home
tmpfs 1517456 0 1517456 0% /dev/shm
none 1517456 0 1517456 0% /home/cliff/.thumbnails
none 1517456 0 1517456 0% /root/.thumbnails
none 1517456 0 1517456 0% /root/.mozilla
none 1517456 1517456 0 100% /tmp
As you can see, /tmp is full before the compile of opencv 2.4.3 completes. I have tried several times, using sbopkg and running the slackbuild in a su- terminal. Every try has failed, in different places, but it fails.

How do I increase the size of /tmp ?

I have enough disk space as far as I know.
 
Old 12-22-2012, 09:05 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,175

Rep: Reputation: Disabled
It looks like you have your /tmp in "tmpfs" i.e. in your RAM (possibly because you thought that would speed up compilations, which it will). However, when setting up a tmnpfs in memory, maximally half of your RAM is allocated to the tmpfs by default. That sounds like a lot but if other processes also require the use of RAM, you may end up with a tmpfs which is too small to be useable.
As you can see you have 1.5 GB of tmpfs and it has all been consumed by your /tmp mount.

If you make /tmp a directory in your root filesystem, then you will have 12 GB of free space for compilations.

Eric
 
Old 12-22-2012, 09:43 AM   #3
bosth
Member
 
Registered: Apr 2011
Posts: 219

Rep: Reputation: 62
There is an issue with the way that OpenCV is compiled by default in that it uses precompiled headers, which aren't of much use in SlackBuilds. If you add the following to the cmake options, the amount of disk space required will be reduced by about 2GB and your tmp partition will not fill up:
Code:
-DENABLE_PRECOMPILED_HEADERS=OFF
I spoke with the SlackBuild maintainer about this very topic a couple of weeks ago, and the change has been added for the next update.

Last edited by bosth; 12-22-2012 at 09:44 AM.
 
1 members found this post helpful.
Old 12-22-2012, 09:44 AM   #4
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.1 64 Multi-Lib
Posts: 419

Rep: Reputation: 123Reputation: 123
I think that putting /tmp in RAM for general use in laptops and desktops has to be classified under "seemed like a good idea at the time". As AlienBob says, you will achieve brilliant performance a few times, but then for the rest of the time that memory will be wasted. Simply leaving it for the O/S to decide what's best to use it for (ie caching reads/writes) is probably a better idea. But that's just my opinion. I wont deny that under certain server workloads, it may well be a good idea to use /tmp in RAM though !
 
1 members found this post helpful.
Old 12-22-2012, 10:44 AM   #5
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.0 + 14.1
Posts: 4,828

Original Poster
Rep: Reputation: 431Reputation: 431Reputation: 431Reputation: 431Reputation: 431
bosth,

I edited the slackbuild script, and added the line you suggested. Now I get an error saying the build dir is does not exist. It does, how ever there is nothing in the dir.

The error:
Quote:
CMake Error: The source directory "/tmp/SBo/OpenCV-2.4.3/build/ " does not exist
Now the cmake section.

Quote:
cd build
cmake \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DINSTALL_MAN_DIR=man \
-DINSTALL_DOC_DIR=doc/$PRGNAM-$VERSION \
-DBUILD_SHARED_LIBS=ON \
-DLIB_SUFFIX=$LIBDIRSUFFIX \
-DLIB_INSTALL_DIR=/usr/lib$LIBDIRSUFFIX \
-DENABLE_PRECOMPILED_HEADERS=OFF \
Is this correct?

I also understand the need to move /tmp onto the hard drive, so I don't run out of space. However, the how-to's I found talk about making a separate partition for /tmp. Is that necessary? Is there a way to edit /etc/fstab and stop /tmp from mounting to tmpfs, and simply mount to a directory?

tmpfs has always confused me.

My current fstab.

Quote:
cat /etc/fstab
/dev/sda5 swap swap defaults 0 0
/dev/sda1 / ext4 defaults 1 1
/dev/sda6 /home ext4 defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
none /home/cliff/.thumbnails tmpfs defaults 0 0
none /root/.thumbnails tmpfs defaults 0 0
none /root/.mozilla tmpfs defaults 0 0
none /tmp tmpfs defaults 0 0
Sorry if these sound like noob questions.
 
Old 12-22-2012, 12:00 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979
Quote:
Originally Posted by Mark Pettit View Post
As AlienBob says, you will achieve brilliant performance a few times, but then for the rest of the time that memory will be wasted. Simply leaving it for the O/S to decide what's best to use it for (ie caching reads/writes) is probably a better idea
A tmpfs is not a static RAM-disk, it will use exactly the amount of RAM that it needs, not more, not less. So you won't have much waste with the use of tmpfs, just clean up from time to time, like removing the temporary directories used by sbopkg, or just reboot the system.
 
Old 12-22-2012, 12:12 PM   #7
bosth
Member
 
Registered: Apr 2011
Posts: 219

Rep: Reputation: 62
Quote:
Originally Posted by camorri View Post
bosth,

I edited the slackbuild script, and added the line you suggested. Now I get an error saying the build dir is does not exist. It does, how ever there is nothing in the dir.
Make sure that you don't have a space after the \ at the end of the newly-added line. A backslash indicates that the command continues on the next line, but it has to be the last character on the line or the single command will be broken into two commands.

Last edited by bosth; 12-22-2012 at 12:17 PM.
 
Old 12-22-2012, 12:38 PM   #8
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.1 64 Multi-Lib
Posts: 419

Rep: Reputation: 123Reputation: 123
@TobiSGD - That's pretty much my point - you, the user, has to decide what should be left or deleted from /tmp if you want to keep real memory usage low. At my work, we run a mix of Solaris and Slackware servers. With Solaris, /tmp by default is in virtual memory. As a rule, we tend to code around that and use another directory as "tmp". On occasion we've hit memory issues, as a result of /tmp filling up - waiting to reboot is a bad idea as we tend to only reboot our servers when the diesel power generators need to be tested - ie every 6 months. For the Slackware servers, I setup /tmp to be on disk and I never ever have issues. So if you don't reboot frequently, then one has to write scripts to monitor usage of /tmp and delete (carefully) where files are old. My general feeling is that the odd performance issue you benefit from does not outweigh the downsides of /tmp in RAM. But again, that's an opinion. I strongly suspect that Pat's box that rebuilds Slackware from source would strongly benefit from that - possibly to the point where to not use it would be unfeasible.
 
Old 12-22-2012, 01:09 PM   #9
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.0 + 14.1
Posts: 4,828

Original Poster
Rep: Reputation: 431Reputation: 431Reputation: 431Reputation: 431Reputation: 431
Update, I refreshed the opencv.SlackBuild, and carefully added the line bosth suggested. I ran the the slackbuild, and oopencv built this time using only about 22% OF /tmp.

I will do some more investigating on having /tmp on disk, instead of ram. Original problem (opencv not building) solved.

Thank-you to every one who contributed.

Merry Christmas to everyone.

Last edited by camorri; 12-22-2012 at 01:11 PM.
 
  


Reply

Tags
/tmp 100% compile error


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bad exit status from /var/tmp/rpm-tmp.Cs9Mt5 (%build) imbrij Linux - Virtualization and Cloud 11 10-27-2012 10:55 AM
OpenCV - Pixel format of incoming image is unsupported by OpenCV golmschenk Programming 1 04-01-2011 12:32 PM
OpenCV 2.0 compile error in -current mlpa Slackware 17 01-06-2011 05:17 AM
/tmp maxing out 100% cz1179 Linux - General 1 01-13-2005 03:28 AM
compile 100% my own debian Abe_the_Man Debian 5 10-30-2004 05:46 PM


All times are GMT -5. The time now is 12:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration