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 09-25-2009, 03:38 PM   #1
frabato
LQ Newbie
 
Registered: Sep 2009
Posts: 20

Rep: Reputation: 0
[Solved] where do I set machine architecture and flags?


Hi All,

I've been using slackware for about two days and I would like to compile some programs using sbopkg. Is there a global place that I can set machine architecture and flags that sbopkg will pick up? I've looked aroun but can't find anything.

Any help would be appreciated.

Last edited by frabato; 09-26-2009 at 11:44 AM.
 
Old 09-25-2009, 04:05 PM   #2
adriv
Member
 
Registered: Nov 2005
Location: Diessen, The Netherlands
Distribution: Slackware 15
Posts: 700

Rep: Reputation: 43
If you selected the package you want to build and install, you can select Custom --> Customize the .info or SlackBuild.
 
Old 09-25-2009, 05:09 PM   #3
frabato
LQ Newbie
 
Registered: Sep 2009
Posts: 20

Original Poster
Rep: Reputation: 0
thanks for the reply. Yes, I see where these can be set but do I have to set them for each build or is there a place where they can be set globally?
 
Old 09-25-2009, 05:35 PM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
The CFLAGS are plugged in from the SLKFLAGS and those are conditionally assigned due to the value of ARCH. ARCH can be exported from your ~/.bashrc or similar file or in the same command line as sbopkg (export ARCH=foo; sbopkg). However, this won't let you control specific CFLAGS - just which set of CFLAGS you get. For that, though I could be mistaken, I believe you'll have to edit the files individually (or sed them).

That said, your ARCH should be set correctly automatically and the compiler flags will either be the same as were used in compiling your base system or otherwise reasonably optimized. IOW, the defaults should be fine. I don't need to set my ARCH or mess with the flags.

So if you have an i686 and want to build packages that are optimized for i686 and won't run on anything else, export ARCH=i686 and otherwise, there shouldn't be much to do.

Is there anything specifically wrong with your ARCH or the CFLAGS that make you need to change things?
 
Old 09-25-2009, 06:56 PM   #5
frabato
LQ Newbie
 
Registered: Sep 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for that information. I'll be building several programs and I wanted them optimized for the intel 2.4 ghz quad core. This is a clean install and I don't have a ~/.bashrc at all.
 
Old 09-26-2009, 02:20 AM   #6
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, OpenSuSE
Posts: 1,839

Rep: Reputation: 242Reputation: 242Reputation: 242
sbopkg usually detects machine architecture automatically.

But if you want, you can either modify the SlackBuild script or pass parameters to it. The latter is called "customise build process" or so (I don't have it on the machine I am sitting in front of). It's both possible from within sbopkg. So you can, e. g., specify ARCH=x86_64 as a command line parameter.

Then there's also a menu entry for saving the build queue. With this, the above settings will be saved, too, as far as I know.

The other method, using .bashrc or similar, would work, and may be a good idea, if you don't have sbopkg, but it's not necessary.

gargamel

Last edited by gargamel; 09-26-2009 at 02:22 AM.
 
Old 09-26-2009, 04:26 AM   #7
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
There is a FAQ entry in slackbuilds.org http://slackbuilds.org/faq/#x86_64
That works also when you are not using sbopkg.
 
Old 09-26-2009, 05:51 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Add something like this to your ~/.bashrc, create the file if it does not exist.

Here's my ~/.bashrc for example:

Code:
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# CFLAGS
CHOST="x86_64"
export CFLAGS="-march=core2 -O2 -pipe -fPIC -msse4.1"
export CXXFLAGS="${CFLAGS}"

# PATH
export PATH="$PATH:/home/demonslayer/bin"
export MANPATH="$MANPATH:/home/demonslayer/lib/man"
 
Old 09-26-2009, 11:43 AM   #9
frabato
LQ Newbie
 
Registered: Sep 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks very much, that's just what I was looking for.
 
  


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
how is zero flags set telnet_ping Programming 5 09-14-2007 08:06 PM
How do you set compiler flags in SuSE? Thaidog SUSE / openSUSE 0 12-26-2006 10:04 PM
can I set these flags using a shell script nirav.jani Linux - Security 1 01-12-2005 06:01 PM
How do I find out what architecture a machine has? amp2000 Linux - General 11 12-05-2003 05:42 AM
Compiling KDE 3.0 w/ multiple architecture flags (quick and easy question)? MatMan5959 Linux - Software 4 05-31-2002 01:57 PM

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

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

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