Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Parameters for Compilations

quemado
Beginner
267 Views
The following block is passed to makefiles to set the parameters for compilations--
.SUFFIXES: .f90 .c .o

.f90.o :
	-@echo `head -n 10 $< | grep -i module | grep -v '!' | tr 'A-Z' 'a-z' | sed 's/module//' | tr -d ' '`.${MEXT} | xargs rm -f
	-@rm -f $*.o
	${F90} ${FDEBUGFLAGS} -c $<

.c.o :
	-@rm -f $*.o
	${CC} ${CDEBUGFLAGS} ${INCLUDEDIRS} -c $<

%.o : %.mod

% :: RCS/%,v

.PRECIOUS: %.o

# the following line suppresses excess print when using gmake
MAKEFLAGS += --no-print-directory

MAKDEP = makedepf90

#
# Intel compiler
# Edit SCALE to the path of the parent directory that this file is in

 SCALE   = %Scale_Dir%
 SOURCE  = ${SCALE}/src
 OBJECT  = ${SCALE}/%Sys%

LIBL      = ${LIBDIR}/libscale.a
EXTRA_OBJS = 
EXTRA_LIBS =
CC        = cc
CFLAGS    = -O -m32
CDEBUGFLAGS = ${CFLAGS}
AR        = ar
ARFLAGS   = rv
AWK       = awk
FC        = ifort
F90       = ifort
DFLAGS    = -std95 -us -lowercase -traceback
FFLAGS    = $(DFLAGS) -fixed
F90FLAGS  = $(DFLAGS) -free
FOPT      = -O3 
FHP       = -g
FALP      = ${FOPT}
FNOPT     = -g  
FAJAX     = $(F90FLAGS) $(FOPT) 
FSAVE     = -save
UFLAG     = 
LDFLAGS   = -i-static
CLDFLAGS  = -m32
RANLIB    = ranlib
DFLT      = fort.
MODL      = -I 
MEXT      = mod
DATA      = $(SCALE)/data
CMDS      = $(SCALE)/cmds
LIBDIR    = $(OBJECT)/lib
BINDIR    = $(OBJECT)/bin
DATADIR   = $(OBJECT)/data
SCALELIB  = $(LIBDIR)/libscale.a
MIPLIB    = $(LIBDIR)/libmip.a
MARSLIB   = $(LIBDIR)/libmars.a
K5LIB     = $(LIBDIR)/libkenova.a
K6LIB     = $(LIBDIR)/libkenovi.a
ENDIAN15  = "FORT_CONVERT15=BIG_ENDIAN"
# end Intel
Two programs that are only c code do not get linked statically. At runtime they look for the Intel library libimf.so. What parameter needs modificaiton so that the c executables will be statically linked? The compile, install and error messages are as follows--
making all in legend...
Date and Time Tue Aug 14 11:36:17 EDT 2007
icc -O -m32 -I/scale/scale5.1/src/include -c /scale/scale5.1/src/legend/legend.c
icc -o legend legend.o -m32 -L/scale/scale5.1/Linux_2/lib -lgd -lpng -lz -lm
icc -O -m32 -I/scale/scale5.1/src/include -c /scale/scale5.1/src/legend/wpng.c
icc -O -m32 -I/scale/scale5.1/src/include -c /scale/scale5.1/src/legend/writepng.c
icc -o wpng wpng.o writepng.o -m32 -L/scale/scale5.1/Linux_2/lib -lpng -lz -lm
making all in origen...


making install in legend...
Date and Time Tue Aug 14 11:49:45 EDT 2007
cp legend /scale/scale5.1/Linux_2/bin/legend
/scale/scale5.1/cmds/upd_qatable /scale/scale5.1/Linux_2/data awk legend p /scale/scale5.1/Linux_2/bin /scale/scale5.1/cmds Linux_2
cp wpng /scale/scale5.1/Linux_2/bin/wpng
/scale/scale5.1/cmds/upd_qatable /scale/scale5.1/Linux_2/data awk wpng p /scale/scale5.1/Linux_2/bin /scale/scale5.1/cmds Linux_2


wpng: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory
legend: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory
Robert McBroom
0 Kudos
1 Reply
Dale_S_Intel
Employee
267 Views
Have you tried adding either "-static" or "-static-intel" to your link line?

Dale
0 Kudos
Reply