LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   compiler flags in Makefile..!!!?? (https://www.linuxquestions.org/questions/suse-opensuse-60/compiler-flags-in-makefile-882845/)

jaiChara 05-26-2011 09:45 AM

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.

AlucardZero 05-26-2011 10:33 AM

You should install the make command (by installing the make package).

theNbomr 05-26-2011 10:57 AM

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.

knudfl 05-26-2011 11:45 AM

.... And : You have no "lfftw3" = libfftw3.so :

The fftw3 development files are missing.

# 'zypper in fftw3-devel' : will install the files.

jaiChara 05-26-2011 12:15 PM

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.


All times are GMT -5. The time now is 09:33 PM.