Re: [openib-general] respect CFLAGS in OSM
On Thu, 2006-01-19 at 16:50, Pete Wyckoff wrote: I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Thanks. Applied. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
RE: [openib-general] respect CFLAGS in OSM
Hi Pete, I have looked again at this patch and what it is changing. My understanding is that you found the -g -O2 CLFAGS (provided through the specific target CFLAGS) unneeded. You also think they will interfere with settings you might want to provide from the command line. I have just double checked what I new to be the rule for autoconf: If the user provides CFLAGS or LDFLAGS from the command like - they are appended to the compile or link flags. The impact on gcc is that the later settings - i.e. those provided by the user take precedence over the flags provided at the beginning of the command line. So the patch below is actually not needed. Just to convince you I attach some gcc traces showing that -O0 -O2 acts like -O2 and -O2 -O0 acts like -O0. Bottom line I would like to keep the code as it is without any change such that default installation will use the -O2 mode. Eitan Zahavi Design Technology Director Mellanox Technologies LTD Tel:+972-4-9097208 Fax:+972-4-9593245 P.O. Box 586 Yokneam 20692 ISRAEL swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 -Original Message- From: [EMAIL PROTECTED] [mailto:openib-general- [EMAIL PROTECTED] On Behalf Of Pete Wyckoff Sent: Thursday, January 19, 2006 11:50 PM To: openib-general@openib.org Subject: [openib-general] respect CFLAGS in OSM I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] Index: management/osm/libvendor/Makefile.am === --- management/osm/libvendor/Makefile.am (revision 5098) +++ management/osm/libvendor/Makefile.am (working copy) @@ -3,8 +3,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif INCLUDES = $(OSMV_INCLUDES) Index: management/osm/complib/Makefile.am === --- management/osm/complib/Makefile.am(revision 5098) +++ management/osm/complib/Makefile.am(working copy) @@ -5,8 +5,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif libosmcomp_la_CFLAGS = -Wall $(DBGFLAGS
RE: [openib-general] respect CFLAGS in OSM
On Mon, 2006-01-23 at 08:27, Eitan Zahavi wrote: Hi Pete, I have looked again at this patch and what it is changing. My understanding is that you found the -g -O2 CLFAGS (provided through the specific target CFLAGS) unneeded. You also think they will interfere with settings you might want to provide from the command line. I have just double checked what I new to be the rule for autoconf: If the user provides CFLAGS or LDFLAGS from the command like - they are appended to the compile or link flags. The impact on gcc is that the later settings - i.e. those provided by the user take precedence over the flags provided at the beginning of the command line. So the patch below is actually not needed. Just to convince you I attach some gcc traces showing that -O0 -O2 acts like -O2 and -O2 -O0 acts like -O0. Yes, it does override. What about the -g setting ? Should that stay or go ? -- Hal Bottom line I would like to keep the code as it is without any change such that default installation will use the -O2 mode. Eitan Zahavi Design Technology Director Mellanox Technologies LTD Tel:+972-4-9097208 Fax:+972-4-9593245 P.O. Box 586 Yokneam 20692 ISRAEL swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 -Original Message- From: [EMAIL PROTECTED] [mailto:openib-general- [EMAIL PROTECTED] On Behalf Of Pete Wyckoff Sent: Thursday, January 19, 2006 11:50 PM To: openib-general@openib.org Subject: [openib-general] respect CFLAGS in OSM I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] Index: management/osm/libvendor/Makefile.am === --- management/osm/libvendor/Makefile.am(revision 5098) +++ management/osm/libvendor/Makefile.am(working copy) @@ -3,8 +3,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif INCLUDES = $(OSMV_INCLUDES) Index: management/osm/complib/Makefile.am === --- management/osm/complib
RE: [openib-general] respect CFLAGS in OSM
Just to convince you I attach some gcc traces showing that -O0 -O2 acts like -O2 and -O2 -O0 acts like -O0. Yes, it does override. What about the -g setting ? Should that stay or go ? [EZ] If -g is the problem we could easily remove the -g . However I would recommend having OpenSM compile -O2 by default and not rely on the user to provide that. -- Hal Bottom line I would like to keep the code as it is without any change such that default installation will use the -O2 mode. Eitan Zahavi Design Technology Director Mellanox Technologies LTD Tel:+972-4-9097208 Fax:+972-4-9593245 P.O. Box 586 Yokneam 20692 ISRAEL swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 -Original Message- From: [EMAIL PROTECTED] [mailto:openib-general- [EMAIL PROTECTED] On Behalf Of Pete Wyckoff Sent: Thursday, January 19, 2006 11:50 PM To: openib-general@openib.org Subject: [openib-general] respect CFLAGS in OSM I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] Index: management/osm/libvendor/Makefile.am === --- management/osm/libvendor/Makefile.am (revision 5098) +++ management/osm/libvendor/Makefile.am (working copy) @@ -3,8 +3,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif INCLUDES = $(OSMV_INCLUDES) Index: management/osm/complib/Makefile.am === --- management/osm/complib/Makefile.am(revision 5098) +++ management/osm/complib/Makefile.am(working copy) @@ -5,8 +5,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif libosmcomp_la_CFLAGS = -Wall $(DBGFLAGS) -D_XOPEN_SOURCE=600 - D_BSD_SOURCE=1 Index: management/osm/opensm/Makefile.am === --- management/osm/opensm/Makefile.am (revision 5098
RE: [openib-general] respect CFLAGS in OSM
On Mon, 2006-01-23 at 08:39, Hal Rosenstock wrote: On Mon, 2006-01-23 at 08:27, Eitan Zahavi wrote: Hi Pete, I have looked again at this patch and what it is changing. My understanding is that you found the -g -O2 CLFAGS (provided through the specific target CFLAGS) unneeded. You also think they will interfere with settings you might want to provide from the command line. I have just double checked what I new to be the rule for autoconf: If the user provides CFLAGS or LDFLAGS from the command like - they are appended to the compile or link flags. The impact on gcc is that the later settings - i.e. those provided by the user take precedence over the flags provided at the beginning of the command line. So the patch below is actually not needed. Just to convince you I attach some gcc traces showing that -O0 -O2 acts like -O2 and -O2 -O0 acts like -O0. Yes, it does override. Actually I'm not sure about this. I too see both but can't tell which was honored and didn't see the specific text in gcc to indicate the precedence here. Is it first option or last option of the same or something else ? -- Hal What about the -g setting ? Should that stay or go ? -- Hal Bottom line I would like to keep the code as it is without any change such that default installation will use the -O2 mode. Eitan Zahavi Design Technology Director Mellanox Technologies LTD Tel:+972-4-9097208 Fax:+972-4-9593245 P.O. Box 586 Yokneam 20692 ISRAEL swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 -Original Message- From: [EMAIL PROTECTED] [mailto:openib-general- [EMAIL PROTECTED] On Behalf Of Pete Wyckoff Sent: Thursday, January 19, 2006 11:50 PM To: openib-general@openib.org Subject: [openib-general] respect CFLAGS in OSM I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] Index: management/osm/libvendor/Makefile.am
RE: [openib-general] respect CFLAGS in OSM
Actually I'm not sure about this. I too see both but can't tell which was honored and didn't see the specific text in gcc to indicate the precedence here. Is it first option or last option of the same or something else ? [EZ] This is exactly why I have added the traces from running gcc with the two options. If you look just below you will see the verbose report from cc1 showing that the last option wins by showing the exact list of optimization options used by the compiler. I have tested that on multiple gcc versions. (The command line itself is reported when you run gcc -v. Then you need to remove the -quite flag to get the correct level of verbosity. ) swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
RE: [openib-general] respect CFLAGS in OSM
On Mon, 2006-01-23 at 09:10, Eitan Zahavi wrote: Actually I'm not sure about this. I too see both but can't tell which was honored and didn't see the specific text in gcc to indicate the precedence here. Is it first option or last option of the same or something else ? [EZ] This is exactly why I have added the traces from running gcc with the two options. If you look just below you will see the verbose report from cc1 showing that the last option wins by showing the exact list of optimization options used by the compiler. I have tested that on multiple gcc versions. (The command line itself is reported when you run gcc -v. Then you need to remove the -quite flag to get the correct level of verbosity. ) Got it. It's all the extra -f options that are enabled by -O2. I will revert the patch to the OSM makefiles. -- Hal swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
RE: [openib-general] respect CFLAGS in OSM
On Mon, 2006-01-23 at 09:10, Eitan Zahavi wrote: Actually I'm not sure about this. I too see both but can't tell which was honored and didn't see the specific text in gcc to indicate the precedence here. Is it first option or last option of the same or something else ? [EZ] This is exactly why I have added the traces from running gcc with the two options. If you look just below you will see the verbose report from cc1 showing that the last option wins by showing the exact list of optimization options used by the compiler. I have tested that on multiple gcc versions. (The command line itself is reported when you run gcc -v. Then you need to remove the -quite flag to get the correct level of verbosity. ) Got it. It's all the extra -f options that are enabled by -O2. I will revert the patch to the OSM makefiles. [EZ] Let's wait for Pete's response. -- Hal swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O0 -O2 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O0 -O2 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks -feliminate-unused-debug-types -fexpensive-optimizations -fforce-mem -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move -foptimize-sibling-calls -fpcc-struct-return -fpeephole -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapping-math -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-sra -ftree-ter -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 swlab25:/home/eitan/SW/work/examples/usr/libexec/gcc/i386-redhat-linux/ 4.0.0/cc1 getHostName.c getHostName.c -auxbase getHostName -O2 -O0 -version -o /tmp/ccet3OkS.s GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8) (i386-redhat-linux) compiled by GNU C version 4.0.0 20050519 (Red Hat 4.0.0-8). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317 options passed: -auxbase -O2 -O0 options enabled: -falign-loops -fargument-alias -fbranch-count-reg -fcommon -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident -fivopts -fkeep-static-consts -fleading-underscore -floop-optimize2 -fmath-errno -fpcc-struct-return -fpeephole -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fsplit-ivs-in-unroller -ftrapping-math -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 -mno-red-zone -mtls-direct-seg-refs -mtune=i386 -march=i386 ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
Re: [openib-general] respect CFLAGS in OSM
[EMAIL PROTECTED] wrote on Mon, 23 Jan 2006 15:27 +0200: I have looked again at this patch and what it is changing. My understanding is that you found the -g -O2 CLFAGS (provided through the specific target CFLAGS) unneeded. You also think they will interfere with settings you might want to provide from the command line. I have just double checked what I new to be the rule for autoconf: If the user provides CFLAGS or LDFLAGS from the command like - they are appended to the compile or link flags. The impact on gcc is that the later settings - i.e. those provided by the user take precedence over the flags provided at the beginning of the command line. So the patch below is actually not needed. Just to convince you I attach some gcc traces showing that -O0 -O2 acts like -O2 and -O2 -O0 acts like -O0. Bottom line I would like to keep the code as it is without any change such that default installation will use the -O2 mode. Yes, later -O options do override previous ones. I didn't think of explicitly disabling optimization with -O0 in my build script. The implication is that you want me to do the following to compile a debugging version of osm: CFLAGS=-g -O0 ./configure ... rather than what I expected to work: CFLAGS=-g ./configure ... I can deal with that, and it's not a big enough concern to me now that you've pointed out this work-around. Feel free to ignore my suggestion, then: it's your code. My surprise comes from having become accustomed to autoconf-based programs that always use the user-specified CFLAGS exactly if given. AC_PROG_CC sets it to -g -O2 by default for gcc only if no CFLAGS was set by the user. If I don't want -g or don't want -O2, usually it is easy to make that happen without editing files. -- Pete ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
[openib-general] respect CFLAGS in OSM
I do something like: CFLAGS=-g ./configure ... to build a debug tree from openib svn. Some places override this CFLAGS setting, though, applying optimization even though I explicitly do not want it. This patch fixes that. These apply to OSM below gen2/trunk/src/userspace/. Signed-off-by: Pete Wyckoff [EMAIL PROTECTED] Index: management/osm/libvendor/Makefile.am === --- management/osm/libvendor/Makefile.am(revision 5098) +++ management/osm/libvendor/Makefile.am(working copy) @@ -3,8 +3,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif INCLUDES = $(OSMV_INCLUDES) Index: management/osm/complib/Makefile.am === --- management/osm/complib/Makefile.am (revision 5098) +++ management/osm/complib/Makefile.am (working copy) @@ -5,8 +5,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif libosmcomp_la_CFLAGS = -Wall $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 Index: management/osm/opensm/Makefile.am === --- management/osm/opensm/Makefile.am (revision 5098) +++ management/osm/opensm/Makefile.am (working copy) @@ -5,8 +5,6 @@ if DEBUG DBGFLAGS = -ggdb -D_DEBUG_ -else -DBGFLAGS = -g -O2 endif libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 ___ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general