Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort + lapack/blas lib

Rafael
Beginner
3,938 Views
Hi, I hope this is the right place to post my question. I am trying to run a program which needs the LAPACK/BLAS library. I have been able to set up the library but when I try to run my program I get this error:

... SiBDRV.o -g -fast -L/home/rosolem/lib/netcdf-4.0.1+ifort-10.1/lib/ -lnetcdf -L/home/rosolem/lib/lapack-3.1.1+ifort-10.1/lib/ -llapack -lblas -lpgmp -lpthread -o SiBD3
IPO link: can not find -llapack
ifort: error #10014: problem during multi-file optimization compilation (code 1)
make: *** [SiBD3] Error 1

All the paths (netcdf and lapack) are correct, but somehow it doesn't find the 'lapack'. I am new with ifort/lapack and I'd appreciate if someone could assist me with that. These are the Makefile options/flags I am currently using:

# BLAS-(64-BIT)
LALIB = /home/rosolem/lib/lapack-3.1.1+ifort-10.1/lib/

# Netcdf
NETCDFINC = /home/rosolem/lib/netcdf-4.0.1+ifort-10.1/include/
NETCDFLIB = /home/rosolem/lib/netcdf-4.0.1+ifort-10.1/lib/

# Includes and Links
# -------------------------------------------------------------------------
INCLUDES = -I$(NETCDFINC)
LINKS = -L$(NETCDFLIB) -lnetcdf -L$(LALIB) -llapack -lblas -lpgmp -lpthread

# Fortran90 Compiler
# -------------------------------------------------------------------------
# Intel 8.0 compiler
F90 = ifort
F90FLAGS = -g -O3 -DPGF=1 -fast -fpe0 $(INCLUDES)

# F90Linker Arguments
# Intel 8.0 compiler
LNKFLAGS = -g -fast $(LINKS)

This is the make.inc when I first install lapack:

FORTRAN = ifort
OPTS = -O3
DRVOPTS = $(OPTS)
NOOPT = -O3 -fltconsistency -fp_port
LOADER = ifort
LOADOPTS = -O3

Finally, some additional information regarding machine, and compiler/libraries version:

Kernel: Linux
Mahcine: Intel Xeon CPU E5472 @ 3.00GHz
Processor: x86_64
OS: GNU/Linux
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080801 Package ID: l_fc_p_10.1.018
LAPACK version 3.1.1
NetCDF version 4.0.1

Thank you,

Rafael
0 Kudos
1 Solution
Kevin_D_Intel
Employee
3,938 Views

It appears the compiler options used + source code (init_sibdrv.F90) have aggravated an internal compiler error when compiling init_sibdrv.F90.

Our latest 11.1 release might contain a fix, so if you can upgrade beyond the 10.1.018 compiler you are using you might be able to continue using the high-level optimizations you have chosen. Otherwise you may have to compile only init_sibdrv.F90 at an lower optimization level, like -O2 or even -O1 or remove -fast or even -g, to avoid the error and successfully compile the entire application at the higher opt levels.

View solution in original post

0 Kudos
10 Replies
Kevin_D_Intel
Employee
3,938 Views

Have you verified a LAPACK library like this actually exists:

/home/rosolem/lib/lapack-3.1.1+ifort-10.1/lib/liblapack.a ?
0 Kudos
Rafael
Beginner
3,938 Views

Have you verified a LAPACK library like this actually exists:

/home/rosolem/lib/lapack-3.1.1+ifort-10.1/lib/liblapack.a ?

These are the files I have in /home/rosolem/lib/lapack-3.1.1+ifort-10.1/lib

blas_LINUX.a
lapack_LINUX.a
tmglib_LINUX.a
0 Kudos
Kevin_D_Intel
Employee
3,938 Views

The (ld) linker -l<library> option expects the library to be named with a "lib" prefix and suffix like ".a", but that one drop both the prefix and suffix when specifying the library in the option.

To use the syntax appearing in the LINKS variable in your makefile, your libraries need to be named like this:

libllapack.a libblas.a libtmglib.a

You could also rename them (add the lib prefix) so they become:

libllapack_LINUX.a libblas_LINUX.a libtmglib_LINUX.a

and then change LINKS (add the _LINUX suffix) in the makefile to be:

LINKS = -L$(NETCDFLIB) -lnetcdf -L$(LALIB) -llapack_LINUX -lblas_LINUX -lpgmp -lpthread

I do not see an explicit use of the tmglib in the makefile excerpts provided so its use is unclear.
0 Kudos
Rafael
Beginner
3,938 Views

The (ld) linker -l<library> option expects the library to be named with a "lib" prefix and suffix like ".a", but that one drop both the prefix and suffix when specifying the library in the option.

To use the syntax appearing in the LINKS variable in your makefile, your libraries need to be named like this:

libllapack.a libblas.a libtmglib.a

You could also rename them (add the lib prefix) so they become:

libllapack_LINUX.a libblas_LINUX.a libtmglib_LINUX.a

and then change LINKS (add the _LINUX suffix) in the makefile to be:

LINKS = -L$(NETCDFLIB) -lnetcdf -L$(LALIB) -llapack_LINUX -lblas_LINUX -lpgmp -lpthread

I do not see an explicit use of the tmglib in the makefile excerpts provided so its use is unclear.

Thank you! It seems that I am able to compile the code, but now I get a different message:

init_sibdrv.F90(554): (col. 8) remark: LOOP WAS VECTORIZED.
backend signals

fortcom: Severe: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

ifort: error #10014: problem during multi-file optimization compilation (code 3)
make: *** [SiBD3] Error 3

I have included tmglib in LINKS, as follows:
LINKS = -L$(NETCDFLIB) -lnetcdf -L$(LALIB) -llapack_LINUX -lblas_LINUX -ltmglib_LINUX -lpthread

0 Kudos
Kevin_D_Intel
Employee
3,939 Views

It appears the compiler options used + source code (init_sibdrv.F90) have aggravated an internal compiler error when compiling init_sibdrv.F90.

Our latest 11.1 release might contain a fix, so if you can upgrade beyond the 10.1.018 compiler you are using you might be able to continue using the high-level optimizations you have chosen. Otherwise you may have to compile only init_sibdrv.F90 at an lower optimization level, like -O2 or even -O1 or remove -fast or even -g, to avoid the error and successfully compile the entire application at the higher opt levels.
0 Kudos
Rafael
Beginner
3,938 Views

It appears the compiler options used + source code (init_sibdrv.F90) have aggravated an internal compiler error when compiling init_sibdrv.F90.

Our latest 11.1 release might contain a fix, so if you can upgrade beyond the 10.1.018 compiler you are using you might be able to continue using the high-level optimizations you have chosen. Otherwise you may have to compile only init_sibdrv.F90 at an lower optimization level, like -O2 or even -O1 or remove -fast or even -g, to avoid the error and successfully compile the entire application at the higher opt levels.

Dear Kevin Davis,

I have successfully compiled my code after removing the -fast flag.

Thank you for your help.

R
0 Kudos
Kevin_D_Intel
Employee
3,938 Views

Glad to hear that Rafael. The -fast option is a short-hand notation for several separate options. For 10.1 compiler you are using, -fast (for Linux) enables: -ipo, -O3, -no-prec-div, -static, -xT

Removing -fast compiles the program at the default optimization level, -O2, if no explicit optimization level is specified. You can, if interested, explore the performance benefit of any individual option -fast enables if you wish.

The two options I suspect might cause the internal compiler error are -O3 and -ipo.
0 Kudos
zhangquan09
Beginner
3,938 Views
Dear Rafael:

I'm also using the Sib3 model now, but I don't know what the library "pgmp" stand for, and whenever I complie the code, there's error indication like this" cannot find -lpgmp".

zhang
0 Kudos
mecej4
Honored Contributor III
3,938 Views
The -lpgmp flag indicates that the library libpgmp.a (or libpgmp.so) is to be linked with the other objects.

It can be either the GNU arbitrary precision library, or another library with the same name but different purpose. You will have to read the documentation of the software that you are trying to build.to find which of these possibilities is the correct one to use.
0 Kudos
TimP
Honored Contributor III
3,938 Views
Did you select a PGI compiler section of the makefile? libpgmp.so would be the OpenMP library for pgf90 and pgcc, analogous to libiomp5.so for ifort. One more indication why it's better to use the compiler's options rather than select specific processor-dependent libraries. In that connection, the pgf90 -mp (OpenMP option) won't be interpreted as -openmp by ifort, as it is an obsolete ifort option with different meaning.
0 Kudos
Reply