PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Creating libraries need help!!

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Mario E



Joined: 08 Aug 2007
Posts: 1

PostPosted: Wed Aug 08, 2007 8:01 am    Post subject: Creating libraries need help!! Reply with quote

I do scientific computing (ecological modeling) but I am not a “computer of system” person so this may look like a silly question but I need help. I have been creating my own libraries for my research projects using the Make file that I show at the end. It has always worked OK. Our computer center, however, is always updating compilers, libraries, etc. When I tried to update my libraries yesterday however (after running Make spotless) I got these 2 messages (one a warning and another fatal):

pgCC-Warning-Unknown switch: --one_instantiation_per_object

/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3//crtbegin.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /hurd/pgi/linux86/6.1/lib/pgi.ld -L/opt/mpi/lammpi/lib binomial.o frct1d.o frct2d.o icovar.o integrt.o isfrct1d.o isfrct2d.o istd.o matrix.o mmemory.o mpi_handlers.o mrpp.o parallel_plants_N_P_v4_viz.o parallel_plants_N_P_v5_viz.o parallel_plants_N_P_v6_viz.o parallel_plants_v5_viz.o parallel_plants_v6_viz.o parallel_plants_v7_viz.o parallel_plants_v8_viz.o posbin.o sfrct1d.o sfrct2d.o sfrct3d.o soilOM_N_v1.o soilOM_N_v2.o soilOM_P_v2.o soilOM_v1.o soilOM_v2.o soilevap.o soilnutr.o soilnutr_v2.o soilnutr_v3.o soilnutr_v4.o soilnutr_v5.o soilnutr_v6.o soiltemp.o soiltemp_v2.o soiltemp_v3.o soplarco.o soplarco_v2.o soplarco_v3.o soplarco_v4.o soplarco_v5.o unormal.o -llammpi++ -llammpio -lpmpi -llamf77mpi -lmpi -llam -lutil -L/hurd/pgi/linux86/6.1/lib -L/usr/lib -L/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/ -rpath /hurd/pgi/linux86/6.1/lib -lstd -lC -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3//crtend.o /usr/lib/crtn.o
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
pgCC-Fatal-linker completed with exit code 1

I would appreciate any help I can get.

Makefile:

export TMP = /var/tmp/
export TMPDIR = /var/tmp/

SRCS := $(wildcard *.cpp)

INCL := $(SRCS:.cpp=.h)

OBJS := $(SRCS:.cpp=.o)

CC = hcp
CFLAGS = -v -O2 -tp p6 --one_instantiation_per_object


.SUFFIXES: .cpp .h


all : libmario.a install

.cpp.o :
${CC} ${CFLAGS} --prelink_objects -c $<

#objs : $(SRCS) $(INCL)
# ${CC} ${CFLAGS} -c ${SRCS}

libmario.a : ${OBJS}
${CC} ${CFLAGS} --prelink_objects ${SRCS}
ar -crvs libmario.a ${OBJS} Template.dir/*.o


install : libmario.a
cp -f ${INCL} ${HOME}/include
cp -f libmario.a ${HOME}/lib

clean :
rm -f *.o
rm -f *.ii
rm -f *.ti
rm -f Template.dir/*.o


spotless : clean
rm -f *.a
rm -f *.out
rm -f *.bin
rm -f *.txt
rm -f *~
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Wed Aug 08, 2007 10:53 am    Post subject: Reply with quote

Hi Mario,

As of the 6.0 compilers, made several enhancements to C++ templates which made it no longer necessary for users to use " --one_instantiation_per_object" during compilation nor perform the pre-link step on objects before adding them to a library.

For your makefile, remove "--one_instantiation_per_object"" from CFLAGS and remove the pre-link step and change where the archiver finds the object.
Code:
libmario.a : ${OBJS}
ar -crvs libmario.a ${OBJS} *.o

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group