HewlettPackard / cacti

An integrated cache and memory access time, cycle time, area, leakage, and dynamic power model
http://www.hpl.hp.com/research/cacti/
397 stars 136 forks source link

Compilation Error #1

Closed agyaglikci closed 8 years ago

agyaglikci commented 8 years ago

I'm trying to compile CACTI 6.5 (a clone of this repo) on a Ubuntu 14.04 64-bit system and gcc 4.8.4. make command gives me the following error:

g++ -m32 -Wno-unknown-pragmas  -O3 -msse2 -mfpmath=sse -DNTHREADS=4 -Icacti  -c cacti/Ucache.cc -o obj_opt/Ucache.o
In file included from /usr/include/c++/4.8/bits/stl_algo.h:59:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from cacti/Ucache.cc:50:
/usr/include/c++/4.8/cstdlib:178:10: error: expected unqualified-id before ‘__int128’
   inline __int128

As far as I understand from other occurrences of this error, it's some how related with 32-bit 64-bit difference. The CACTI in McPAT also gives the same error. How can I walk around this problem? Which platform do you prefer for these simulators?

nicmcd commented 8 years ago

Any Linux platform should work fine. I've also had issues with this. For me, I removed the two "-m32" instances in cacti.mk and it worked fine (although my error was different than yours).

I believe the next cacti release will have a cleaned up makefile.

agyaglikci commented 8 years ago

That worked perfect! The only necessary change was removing -m32 as you said.

diff --git a/cacti.mk b/cacti.mk
index b76f38f..238fdee 100644
--- a/cacti.mk
+++ b/cacti.mk
@@ -21,8 +21,8 @@ endif

 #CXXFLAGS = -Wall -Wno-unknown-pragmas -Winline $(DBG) $(OPT) 
 CXXFLAGS = -Wno-unknown-pragmas $(DBG) $(OPT) 
-CXX = g++ -m32
-CC  = gcc -m32
+CXX = g++ 
+CC  = gcc 

 SRCS  = area.cc bank.cc mat.cc main.cc Ucache.cc io.cc technology.cc basic_circuit.cc parameter.cc \
                decoder.cc component.cc uca.cc subarray.cc wire.cc htree2.cc \

Just in case anybody has trouble like some file is not found, I also needed to add 3 directories to C++ Include Path for my system as follows:

CPLUS_INCLUDE_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8:/usr/include/x86_64-linux-gnu/c++/4.8:/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH