LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 05-26-2011, 09:45 AM   #1
jaiChara
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: Disabled
compiler flags in Makefile..!!!??


Hi
I use Open Suse 11.3 ver /i586/32bit architecture.
I am new to editing compiler flags in make file and hence to 'make' to compile a program.
I have fftw3 libraries in the path
/usr/lib/fftw3.so.3
/usr/lib/libfftw3.so.3.2.4
/usr/lib/libfftwf.so.3
/usr/lib/libfftw3f.so.3.2.4
---------
I have gcc compiler installed.
====
from the code that i downloaded from the internet, a variable,
FFTWDIR is defined. I guess, this asks for the location of FFTW directory and the c routine version folder etc ( exact path).
What should i give here when i don't have any FFTWDIR in my system at all??
After giving just /usr i get error saying
bash: make: command not found
=================
Here is the code.
-----------------
Code:
   #Compiler
CC = gcc

SRC = tfreq.c
PSRC = pos2vel.c

OBJ=$(SRC:.c=.o)
POBJ=$(PSRC:.c=.o)

#compiler flags
#MPIDIR1=/opt/hpmpi
#MPIDIR=/opt/hpmpi/lib/linux_amd64
FFTWDIR=/usr
#ACMLDIR=/opt/sharcnet/acml/acml-pathscale-64bit-current/pathscale64

IDIRS  =  -I $(FFTWDIR)/include
#IDIRS2  = -I $(MPIDIR1)/include
FLAGS  =  $(IDIRS)
#LAPACK  = -L $(ACMLDIR)/lib -lacml -lpathfortran
#MPI    = -L $(MPIDIR) -lmpi
LIBS   = -L $(FFTWDIR)/lib -lfftw3 -lm

#compilation 
tfreq: $(OBJ)
        $(CC) -O3 $(IDIRS) $(OBJ) $(LIBS) -o $@

pos2vel: $(POBJ)
        $(CC) -O3 $(IDIRS) $(OBJ) $(LIBS) -o $@

%.o: %.c
        $(CC) $(FLAGS) -c $<

clean : 
        \rm -f *.o *~ *.mod
====
Need to know what should i specify that i is in blue text.?
What modification should i make in order for this to work?

Thanks in advance for any advices.
Jai.
 
Old 05-26-2011, 10:33 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,610

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
You should install the make command (by installing the make package).
 
Old 05-26-2011, 10:57 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The direct answer to your question is '/usr/lib', since that seems to be where the respective library would be found.
As AlucardZero has already pointed out, you will need to install gnu make to use the Makefile. Another point is that the Makefile is frequently generated or customized by a configure script. You should carefully read any INSTALL or README files that came with your source code package, and see if this is the case in your situation. In many cases, there are three simple steps used to build a package from sources:
Code:
./configure
make
# as root...
make install
--- rod.
 
Old 05-26-2011, 11:45 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
.... And : You have no "lfftw3" = libfftw3.so :

The fftw3 development files are missing.

# 'zypper in fftw3-devel' : will install the files.
 
Old 05-26-2011, 12:15 PM   #5
jaiChara
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Smile Solved i guess :)

Hi,
Thanks a lot for the replies.
I found out that fftwdlevel was missing and installed that, the same suggestion was given to me by Mr/ Ms. knudfl ( thanks a lot ). Then instead of adding the directory for that FFTW3, i added the line for that variable
FFTWDIR = /usr/bin/ffw-wisdom-to-conf

Also, from YAST installed the 'make' package ( as suggested by our senior members in this group).

and edited the line usr/local/lib to /usr/lib ( that has the required lib files ) of ld.so.conf file located at /etc and run ldconfig there by updating the location of the library files. and then typed make and that gave me the required exe file for further processing.

Once again thanks a lot for all the quick replies.
 
  


Reply


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
C++ - Where to place library flags in a makefile? golmschenk Programming 8 04-11-2011 03:45 PM
[SOLVED] makefile: change compilation flags by changing target name mosca Programming 2 11-13-2010 06:05 PM
Compiler Flags mkrems Programming 1 06-13-2008 06:55 PM
compiler flags mkrems Linux - Software 1 04-22-2008 12:53 AM
Makefile question - multiple compilation flags benobi Programming 7 08-11-2005 01:42 PM


All times are GMT -5. The time now is 07:21 PM.

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