memory problem?

From: Chiara Zampolli <Chiara.Zampolli_at_bo.infn.it>
Date: Thu, 23 Nov 2006 17:09:04 +0100


Dear rooters,

     sorry to bother you with my large number of mails....

     I have been able to solve the problem of my previous mail using malloc, but now I have some more doubts... Since I have to write a very big array (the one causing me troubles) in a tree (16000 entries, with an array of 1500 elements each, corresponding to a 2D array of 16000x1500 elements), but using the executable generated compiling the main chiara.cxx you find attached, I have used malloc (solution of my previos problem). In this way, I am able to fill the tree in the correct way, but i still don't understand why lines 33 and 37 in the main don't work (so, instead, I use lines 34 and 38). And, moreover, I don't know whether the way I am now following is the smartest one or not (especially in terms of CPU, memory...).

      Do you have any suggestions?
      Thank you again.
      Best Regards,

                Chiara





#---------------------------------------------------------------------

#
#
TARGET		:= chiara
SOURCES		:= chiara.cxx

#BINS := chiara chiara.sh

#---------------------------------------------------------------------
# you shouldn't need to change anything below this line.
#
OBJECTS		:= $(TARGET).o $(filter-out $(TARGET).o, 	\
				$(filter %.o, $(SOURCES:%.cxx=%.o))	\
				$(filter %.o, $(SOURCES:%.c=%.o)))


#---------------------------------------------------------------------
# Third party libraries
#
ROOT_CFLAGS	:= $(filter-out -I% -D%, $(shell root-config --cflags))
ROOT_CPPFLAGS	:= $(filter-out $(ROOT_CFLAGS), $(shell root-config --cflags))
ROOT_LDFLAGS	:= $(filter-out -l%, $(shell root-config --libs))
ROOT_LIBS	:= $(filter -l%, $(shell root-config --libs)) -lNew -lVMC -lGeom -lEG -lMinuit


#---------------------------------------------------------------------
# Compilers and such
#
CPP		:= g++ -E
CPPFLAGS	:= $(ROOT_CPPFLAGS)
CC		:= gcc -c 
CFLAGS		:= $(ROOT_CFLAGS)
CXX		:= g++ -c 
CXXFLAGS	:= $(CFLAGS)
LD		:= g++ 
LDFLAGS		:= $(ROOT_LDFLAGS)
LIBS		:= $(ROOT_LIBS)


#---------------------------------------------------------------------
# Pattern rules
#

%.o:%.cxx

        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $<

%.o:%.c

        $(CC) $(CPPFLAGS) $(CFLAGS) $<
%:%.o

        $(LD) $^ $(LDFLAGS) $(LIBS) -o $@

#---------------------------------------------------------------------
# Targets

all: $(TARGET)

clean:

        rm -rf $(TARGET) $(OBJECTS)

show:

	@echo "TARGET           : $(TARGET)"
	@echo "SOURCES          : $(SOURCES)"
	@echo "OBJECTS          : $(OBJECTS)"
	@echo "-----------------"
	@echo "ROOT_CPPFLAGS    : $(ROOT_CPPFLAGS)"
	@echo "ROOT_CFLAGS      : $(ROOT_CFLAGS)"
	@echo "ROOT_LDFLAGS     : $(ROOT_LDFLAGS)"
	@echo "ROOT_LIBS        : $(ROOT_LIBS)"
	@echo "-----------------"
	@echo "CPP              : $(CPP)"
	@echo 'CPPFLAGS         : $(CPPFLAGS)'
	@echo "CXX              : $(CXX)"
	@echo 'CXXFLAGS         : $(CXXFLAGS)'
	@echo "LD               : $(LD)"
	@echo "LDFLAGS          : $(LDFLAGS)"
	@echo "LIBS             : $(LIBS)"

$(TARGET):$(OBJECTS)
#---------------------------------------------------------------------
#
# EOF
#

Received on Thu Nov 23 2006 - 17:00:16 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET