Hi Chapel Developers --

size of patch = 2 out of 7
complexity of patch = 5 out of 7 (just because Makefiles are so spaghetti
                                  by nature)

The attached patch is morally Michael Ferguson's, but I'd be happy for a review from whomever if it can come sooner.

Just prior to the last release, I noticed the amount of redundancy in the flags we pass to 'cc' when compiling the generated code (e.g., passing identical -Werror or -I options multiple times). These were introduced in r19641; by the time I discovered them, I was too scared to make Makefile changes so close to the release, so I instead I added a TODO in r21987.

This patch makes good on that TODO by being more precise when accumulating macros into GEN_CFLAGS and removing third-party -I flags that are added in multiple places. I believe it maintains the original design goals that caused Michael to introduce this redundancy in the first place.

I've tested this by hand in a few of the major configurations (qthreads+gasnet, massivethreads, comm=none), but the proof will be in the nightly testing and living with it for awhile.

Thanks,
-Brad
Index: runtime/etc/Makefile.mem-dlmalloc
===================================================================
--- runtime/etc/Makefile.mem-dlmalloc	(revision 22885)
+++ runtime/etc/Makefile.mem-dlmalloc	(working copy)
@@ -1,2 +1 @@
-GEN_CFLAGS += -I$(DLMALLOC_INCLUDE_DIR)
 LIBS += -L$(DLMALLOC_LIB_DIR) -ldlmalloc
Index: runtime/etc/Makefile.tasks-massivethreads
===================================================================
--- runtime/etc/Makefile.tasks-massivethreads	(revision 22885)
+++ runtime/etc/Makefile.tasks-massivethreads	(working copy)
@@ -1,5 +1,3 @@
-
-GEN_CFLAGS += -I$(MASSIVETHREADS_INCLUDE_DIR)
 GEN_LFLAGS += -L$(MASSIVETHREADS_LIB_DIR) -Wl,-rpath -Wl,$(MASSIVETHREADS_LIB_DIR)
 
 LIBS += -lmyth-native -ldl
Index: runtime/etc/Makefile.hwloc-none
===================================================================
--- runtime/etc/Makefile.hwloc-none	(revision 22885)
+++ runtime/etc/Makefile.hwloc-none	(working copy)
@@ -1 +0,0 @@
-GEN_CFLAGS += -I$(RUNTIME_INCLUDE_ROOT)/hwloc/none
Index: runtime/etc/Makefile.include
===================================================================
--- runtime/etc/Makefile.include	(revision 22885)
+++ runtime/etc/Makefile.include	(working copy)
@@ -16,21 +16,10 @@
 # sets RUNTIME_INCLUDE_ROOT RUNTIME_CFLAGS RUNTIME_INCLS
 include $(CHPL_MAKE_HOME)/runtime/make/Makefile.runtime.include
 
-# RUNTIME_CFLAGS e.g. -DCHPL_TASKS_MODEL_H=... -DCHPL_THREADS_MODEL_H=...
+# add RUNTIME_DEFS e.g. -DCHPL_TASKS_MODEL_H=... -DCHPL_THREADS_MODEL_H=...
 #
-# TODO (bradc): Note that the following results in all of our
-# compiler-specific warning flags getting listed as part of GEN_FLAGS
-# for the second time.  Ideally, we could separate all the aspects of
-# the RUNTIME_CFLAGS that we need here (presumably, the -D's based on
-# the above comment) from the overall RUNTIME_CFLAGS -- call it
-# CHPL_DEFINE_FLAGS, say -- and only include those here.  I noticed
-# this just before the release and it felt like too big a change to
-# try and wedge in in the name of shorter compiler lines.
-#
-HEADER_CFLAGS = $(RUNTIME_CFLAGS)
+GEN_CFLAGS += $(RUNTIME_DEFS)
 
-GEN_CFLAGS += $(HEADER_CFLAGS)
-
 CHPL_RT_INC_DIR = $(RUNTIME_INCLS)
 
 CHPL_RT_LIB_DIR = $(CHPL_MAKE_HOME)/$(LIB_RT_DIR)
Index: runtime/etc/Makefile.hwloc-hwloc
===================================================================
--- runtime/etc/Makefile.hwloc-hwloc	(revision 22885)
+++ runtime/etc/Makefile.hwloc-hwloc	(working copy)
@@ -1,4 +1,3 @@
-GEN_CFLAGS += -I$(HWLOC_INCLUDE_DIR)
 GEN_LFLAGS += -L$(HWLOC_LIB_DIR) -Wl,-rpath -Wl,$(HWLOC_LIB_DIR)
 
 LIBS += -lhwloc
Index: runtime/etc/Makefile.tasks-qthreads
===================================================================
--- runtime/etc/Makefile.tasks-qthreads	(revision 22885)
+++ runtime/etc/Makefile.tasks-qthreads	(working copy)
@@ -1,4 +1,3 @@
-GEN_CFLAGS += -I$(QTHREAD_INCLUDE_DIR)
 GEN_LFLAGS += -L$(QTHREAD_LIB_DIR) -Wl,-rpath -Wl,$(QTHREAD_LIB_DIR)
 
 LIBS += -lqthread_chpl -lqthread -lpthread
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to