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

Compile a static library from IPO: error adding symbols: archive has no index; run ranlib to add one

Jsfaraway
Beginner
1,651 Views

Hi, I am on linux os. I want to compile a library and link it to the main procedure by Makefile. The object files are compiled as the link https://www.cita.utoronto.ca/~merz/intel_c10b/main_cls/mergedProjects/optaps_cls/common/optaps_ipo_lib.htm . But when I link the library, it compiles :"error adding symbols: archive has no index; run ranlib to add one " .  The error will be removed after remove the IPO. Why this happens? Thank you! 

 

Makefile likes follows:

 

 

 

$(LIB_scalapack): $(SOLVESH_LIB)
  xiar cr -o $(LIB_scalapack) $(SOLVESH_LIB)
  ranlib libscalapack_base.a
endif

$(SOLVESH_LIB): xx.f90
  mpiifx -O3 -r8 -fpp -ipo -fpe0 -ftz -align -qopenmp -fpp -auto -c xx.f90 

main: $(LIB_scalapack) main.o
  mpiifx -r8 -fpp -ipo -fpe0 -ftz -align -qopenmp -fpp -auto -O3 -l$(LIB_scalapack) -o main main.o

 

 

0 Kudos
1 Reply
Ron_Green
Moderator
1,580 Views

IPO object formats are not the same between our older compilers icc icpc and ifort and the newer compilers icx icpx and ifx.  the libscalack is therefore not usable with IPO with ifx.  

 

Instead of xiar you have to use the LLVM replacements we have in

<root path>/compiler/<version>/bin/compiler

llmv-ar instead of xiar

And compile scalapack with icx -ipo before using this.  

In that dir <root path>/compiler/<version>/bin/compiler you will find our replacement utils.  Use these if you have IPO compiled objects/libs.  It is NOT added to PATH so you will need to do that or fully path the utils.

0 Kudos
Reply