- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a code,I need Lapack libraries.What should I change in FCFLAGS line?Framework is supposed to be
/opt/intel/mkl/lib/ia32 or not?
#----------------------------------------------------
# Intel iFort Compiler, Mac OS X, using vector library with fast Lapack
#----------------------------------------------------
# FC90 = f90
# FCFLAGS= -fast -Wl,-framework,vecLib -warn uncalled
# use the line above for vector library with fast Lapack,
# make sure to first uncomment LAPACK sgesv call in Occam.f90
TARGETS= clean Occam2D
OBJSOC= OccamModules.f90 MT2DModules.f90 Occam.f90 MT2D.f90
all: $(TARGETS)
clean:
rm -f *.o *~ core *.mod
rm -f Occam2D
Occam2D:$(OBJSOC)
$(FC90) $(FCFLAGS) -o $@ $(OBJSOC) $(LIBS)
# General compile rules
.SUFFIXES: .f90 .o
.f90.o:
$(FC90) $(FCFLAGS) -c -o $@ $<
/opt/intel/mkl/lib/ia32 or not?
#----------------------------------------------------
# Intel iFort Compiler, Mac OS X, using vector library with fast Lapack
#----------------------------------------------------
# FC90 = f90
# FCFLAGS= -fast -Wl,-framework,vecLib -warn uncalled
# use the line above for vector library with fast Lapack,
# make sure to first uncomment LAPACK sgesv call in Occam.f90
TARGETS= clean Occam2D
OBJSOC= OccamModules.f90 MT2DModules.f90 Occam.f90 MT2D.f90
all: $(TARGETS)
clean:
rm -f *.o *~ core *.mod
rm -f Occam2D
Occam2D:$(OBJSOC)
$(FC90) $(FCFLAGS) -o $@ $(OBJSOC) $(LIBS)
# General compile rules
.SUFFIXES: .f90 .o
.f90.o:
$(FC90) $(FCFLAGS) -c -o $@ $<
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#----------------------------------------------------
# Intel iFort Compiler, Mac OS X, using vector library with fast Lapack
#----------------------------------------------------
FC90 = ifort
FCFLAGS= -O2 -xhost -warn uncalled
And do you want 32bit or 64bit binaries? For 32, add -m32 to FCFLAGS, else -m64
You'll need to set up a LIBS variable based on your MKL choices. Use their Link Line Advisor to set this correctly.
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
# Intel iFort Compiler, Mac OS X, using vector library with fast Lapack
#----------------------------------------------------
FC90 = ifort
FCFLAGS= -O2 -xhost -warn uncalled
And do you want 32bit or 64bit binaries? For 32, add -m32 to FCFLAGS, else -m64
You'll need to set up a LIBS variable based on your MKL choices. Use their Link Line Advisor to set this correctly.
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Ron.32bit so -m32.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still I have problems:
F95ROOT=/opt/intel/composerxe-2011.1.107
MKLROOT=/opt/intel/composerxe-2011.1.107/mkl
FC90 = $(F95ROOT)/bin/ia32/ifort
FCFLAGS= -O2 -xhost -m32 -warn uncalled
INCLUDE = $(MKLROOT)/include
LD_LIBRARY_PATH = $(MKLROOT)/lib/ia32
LIBRARY_PATH = $(MKLROOT)/lib/ia32
CPATH = $(MKLROOT)/include
FPATH = $(MKLROOT)/include
NLSPATH = $(MKLROOT)/lib/ia32/locale/en_US
LIBS=-L$(MKLROOT)/lib/ia32 -lmkl_lapack95 -Wl,--start-group \
$(MKLROOT)/lib/ia32/libmkl_lapack95.a \
$(MKLROOT)/lib/ia32/libmkl_blacs.a \ -Wl, --end group
rm -f *.o *~ core *.mod
rm -f Occam2D
/opt/intel/composerxe-2011.1.107/bin/ia32/ifort -O2 -xhost -m32 -warn uncalled -o Occam2D OccamModules.f90 MT2DModules.f90 Occam.f90 MT2D.f90 -L/opt/intel/composerxe-2011.1.107/mkl/lib/ia32 -lmkl_lapack95 -Wl,--start-group /opt/intel/composerxe-2011.1.107/mkl/lib/ia32/libmkl_lapack95.a /opt/intel/composerxe-2011.1.107/mkl/lib/ia32/libmkl_blacs.a \ -Wl, --end group
ifort: error #10236: File not found: ' -Wl,'
ifort: command line warning #10006: ignoring unknown option '-fend'
ifort: error #10236: File not found: 'group'
How to link libraries?
F95ROOT=/opt/intel/composerxe-2011.1.107
MKLROOT=/opt/intel/composerxe-2011.1.107/mkl
FC90 = $(F95ROOT)/bin/ia32/ifort
FCFLAGS= -O2 -xhost -m32 -warn uncalled
INCLUDE = $(MKLROOT)/include
LD_LIBRARY_PATH = $(MKLROOT)/lib/ia32
LIBRARY_PATH = $(MKLROOT)/lib/ia32
CPATH = $(MKLROOT)/include
FPATH = $(MKLROOT)/include
NLSPATH = $(MKLROOT)/lib/ia32/locale/en_US
LIBS=-L$(MKLROOT)/lib/ia32 -lmkl_lapack95 -Wl,--start-group \
$(MKLROOT)/lib/ia32/libmkl_lapack95.a \
$(MKLROOT)/lib/ia32/libmkl_blacs.a \ -Wl, --end group
rm -f *.o *~ core *.mod
rm -f Occam2D
/opt/intel/composerxe-2011.1.107/bin/ia32/ifort -O2 -xhost -m32 -warn uncalled -o Occam2D OccamModules.f90 MT2DModules.f90 Occam.f90 MT2D.f90 -L/opt/intel/composerxe-2011.1.107/mkl/lib/ia32 -lmkl_lapack95 -Wl,--start-group /opt/intel/composerxe-2011.1.107/mkl/lib/ia32/libmkl_lapack95.a /opt/intel/composerxe-2011.1.107/mkl/lib/ia32/libmkl_blacs.a \ -Wl, --end group
ifort: error #10236: File not found: ' -Wl,'
ifort: command line warning #10006: ignoring unknown option '-fend'
ifort: error #10236: File not found: 'group'
How to link libraries?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
change the last LIBS line in the makefile from
$(MKLROOT)/lib/ia32/libmkl_blacs.a \ -Wl, --end group
to
$(MKLROOT)/lib/ia32/libmkl_blacs.a -Wl,--end group
$(MKLROOT)/lib/ia32/libmkl_blacs.a \ -Wl, --end group
to
$(MKLROOT)/lib/ia32/libmkl_blacs.a -Wl,--end group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well,yes this works but:
/tmp/ifort1CkEJv.o: In function `tofmu_.':
Occam.f90:(.text+0x7270): undefined reference to `sgesv_'
make: *** [Occam2D] Error 1
Don,t know why.
/tmp/ifort1CkEJv.o: In function `tofmu_.':
Occam.f90:(.text+0x7270): undefined reference to `sgesv_'
make: *** [Occam2D] Error 1
Don,t know why.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not having seen the source code line(s) containing the call to sgesv(), I cannot be sure, but here are some guesses:
1. You asked twice for libmkl_lapack95.a to be used while linking.
2. You did not ask for the Lapack library (F77) to be included in the link.
Use the Link Line Advisor and transcribe the link line correctly.
The answers given here can become confusing to use since you keep changing the question from post to post within a single thread.
1. You asked twice for libmkl_lapack95.a to be used while linking.
2. You did not ask for the Lapack library (F77) to be included in the link.
Use the Link Line Advisor and transcribe the link line correctly.
The answers given here can become confusing to use since you keep changing the question from post to post within a single thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks mecej.I have used link adviser,-I$(F95ROOT)/include/ia32 -mkl=sequential .
It works now.
It works now.
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page