Commits

Hans-Nikolai Viessmann committed 916c5c1

Change Makefile

I decided to add some more stuff to the Makefile

I also had to change the linking mechanism in sac-mt because I moved
the base sac directory...

Comments (0)

Files changed (2)

-hs: TotientRange.hs
-	ghc -O2 -rtsopts -threaded -eventlog -o tot_thr_hs TotientRange.hs
+NUMT=4
+HASKBIN=TotientRange.hs.out
+SACBIN=TotientRange.sac.mt.out
 
-hs_run: tot_thr_hs
-	time -p ./tot_thr_hs 1 10000 +RTS -N8 -ls
+all: $(HASKBIN) $(SACBIN)
 
-hs_full_run: tot_thr_hs
-	time -p ./tot_thr_hs 1 100000 +RTS -N8 -ls
+$(HASKBIN): TotientRange.hs
+	ghc -O2 -rtsopts -threaded -eventlog -o $@ $<
 
-hs_vis: tot_thr_hs.eventlog
-	/home/pt114/.cabal/bin/threadscope tot_thr_hs.eventlog
+hs_run: $(HASKBIN)
+	./$< 1 10000 +RTS -N$(NUMT) -ls
+
+hs_full_run: $(HASKBIN)
+	./$< 1 100000 +RTS -N$(NUMT) -ls
+
+hs_vis: $(HASKBIN).eventlog
+	/home/pt114/.cabal/bin/threadscope $<
+
+$(SACBIN): TotientRange.sac
+	sac2c -doAWLF -mt -o $@ $<
+
+sac_run: $(SACBIN)
+	./$< 1 10000 -mt $(NUMT)
 
 clean:
-	$(RM) tot_thr_hs
+	$(RM) $(HASKBIN) TotientRange.hi
+	$(RM) $(SACBIN)
 
 clean-all: clean
-	$(RM) *.eventlog 
+	$(RM) $(HASKBIN).eventlog 

cw2/TotientRange.sac

 // A bit of a nasty hack, so that we actually get the result value and not the
 // complete data structure pretty-printed
 external double benchRes( Interval& interval);
-#pragma linkobj "/root/.sac/stdlib/modules/auxiliary/src/C99Benchmarking/bench.o"
+#pragma linkobj "/etc/sac/stdlib/modules/auxiliary/src/C99Benchmarking/bench.o"
 #pragma linksign [0,1]
 
 // Function exists already in form of `fmod', but seems slower...