Facebook
From Denim Finch, 4 Years ago, written in Plain Text.
This paste is a reply to Untitled from Little Duck - view diff
Embed
Download Paste or View Raw
Hits: 210
  1. #
  2. # This is a simple makefile to assist with quickly building the Exercises of MP2.
  3. #
  4. # To build and execute a particular exercise:
  5. #    - For a single exercise, type 'make runA' to run exercise A.
  6. #    - For all exercises, 'make'.
  7. #
  8. #
  9. HADOOP_CLASSPATH := ${JAVA_HOME}/lib/tools.jar
  10. export HADOOP_CLASSPATH
  11.  
  12. HDFS=user/lada38/lab3
  13.  
  14. OBJDIR=build
  15.  
  16. JAR := MapReducePSO.jar
  17.  
  18. TARGETS := $(addprefix run, 1 2)
  19.  
  20. .PHONY: final $(TARGETS) clean
  21.  
  22. final: $(TARGETS)
  23.  
  24. run1: $(OBJDIR)/WHV1.class
  25.         jar -cvf $(JAR) -C $(OBJDIR)/ ./
  26.         hdfs dfs -rm -r -skipTrash -f /$(HDFS)/Aout/
  27.         hadoop jar $(JAR) WHV1 -D percentage=.2 /user/adampap/WHVsmall /$(HDFS)/Aout
  28.         @echo "Run the following command to read the output file:"
  29.         @echo "hdfs dfs -cat /$(HDFS)/Aout/part*"
  30.  
  31. run2: $(OBJDIR)/WHV2.class
  32.         jar -cvf $(JAR) -C $(OBJDIR)/ ./
  33.         hdfs dfs -rm -r -skipTrash -f /$(HDFS)/Bout/
  34.         hadoop jar $(JAR) WHV2 -D N=10 /user/adampap/WHVsmall /$(HDFS)/Bout
  35.         @echo "Run the following command to read the output file:"
  36.         @echo "hdfs dfs -cat /$(HDFS)/Bout/part*"
  37.  
  38. $(OBJDIR)/%.class: %.java | $(OBJDIR)
  39.         hadoop com.sun.tools.javac.Main $< -d $(OBJDIR)
  40.  
  41. $(OBJDIR):
  42.         mkdir $@
  43.  
  44. .PHONY: clean
  45. clean:
  46.         rm -f $(OBJDIR)/* $(JAR)
  47.         hdfs dfs -rm -r -skipTrash -f /$(HDFS)/*-output/