Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org compiler flags in Makefile..!!!??
 Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

 05-26-2011, 10:45 AM #1 jaiChara LQ Newbie   Registered: May 2011 Posts: 2 Rep: 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.
 05-26-2011, 11:33 AM #2 AlucardZero Senior Member   Registered: May 2006 Location: USA Distribution: Debian Posts: 4,652 Rep: You should install the make command (by installing the make package).
 05-26-2011, 11:57 AM #3 theNbomr LQ 5k Club   Registered: Aug 2005 Distribution: OpenSuse, Fedora, Redhat, Debian Posts: 5,396 Blog Entries: 2 Rep: 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.
 05-26-2011, 12:45 PM #4 knudfl LQ 5k Club   Registered: Jan 2008 Location: Copenhagen, DK Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only. Posts: 14,272 Rep: .... And : You have no "lfftw3" = libfftw3.so : The fftw3 development files are missing. # 'zypper in fftw3-devel' : will install the files.
 05-26-2011, 01:15 PM #5 jaiChara LQ Newbie   Registered: May 2011 Posts: 2 Original Poster Rep: 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.