Misc updates
cover Misc updates
From c545a33aea39aeae40bcff478285f814c32a4456 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 1 Oct 2018 22:05:58 +0900
Subject: [PATCH 0/5] Misc updates
Hi Paul,
This is a miscellaneous collection of updates.
Patch #1 fixes build error you'd encounter when you do "make" after doing "make" under CodeSamples/ directory.
Patches #2 and #3 fix trivial typos in FAQ-BUILD.txt and tooldoftrade, respectively.
Patch #4 removes obsolete workaround code in perfbook.tex.
Patch #5 removes rules in Makefile used to support a hi-res figure in QC section.
Once Patch #5 is applied, you can remove orphaned files listed below:
future/Bloch_Sphere.svg
future/QC-FormConstant.eps
future/QS1_1.svg
future/T2h1lc19xmqrdlsor.eps
future/ibmqx2-labeled.svgAs a matter of fact, I have prepared a patch to remove them, but it would be too large to submit.
Thanks, Akira
--
Akira Yokosawa (5):
CodeSamples: Exclude meta command lines in building api.h FAQ-BUILD.txt: Fix typo
toolsoftrade: Fix typo DEFINE_PER_THREAD() -> DEFINE_PER_CPU() Remove workaround for Fedora 23 Tex Live bug
Makefile: Remove rules for QC section
.gitignore | 1 - CodeSamples/Makefile | 4 +++- FAQ-BUILD.txt | 2 +- Makefile | 25 +++++-------------------- perfbook.tex | 14 -------------- toolsoftrade/toolsoftrade.tex | 2 +- utilities/gen_snippet_d.pl | 16 ++++++++-------- 7 files changed, 18 insertions(+), 46 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/5 CodeSamples: Exclude meta command lines in building api.h
From 242c3993ecce7faf3e4f9bdc586e9553f16c77ac Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 29 Sep 2018 20:01:46 +0900
Subject: [PATCH 1/5] CodeSamples: Exclude meta command lines in building api.h
api.h is built by concatenating several header files including api-pthreads.h, which has meta commands for the new code snippet scheme.
This commit adds "sed" scripts to prevent those meta commands to appear in api.h.
The added pattern "begin{snippet}" in CodeSamples/Makefile revealed a few issues in gen_snippet_d.pl and top level Makefile.
Regex handling in gen_snippet_d.pl didn't work as I intended. The pattern matched "begin{snippet}" (without leading "\"). Fix it by tweaking the patterns and properly using single quotes around them.
In Makefile, $(shell ...) function uses /bin/sh by default. By setting a variable "SHELL" in the Makefile, we can override the default. On Ubuntu, "bash" and "dash" behaves slightly different in the way the argument '\begin{snippet}' is passed to grep. For compatibility, we set /bin/bash to SHELL.
Also fix typo in the assignment to SOURCES_OF_LTMS. The typo caused redundant runs of commands after a build is complete.
--- CodeSamples/Makefile | 4 +++- Makefile | 4 +++- utilities/gen_snippet_d.pl | 16 ++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-)
CodeSamples/Makefile +3 -1
@@ -33,7 +33,9 @@ ifneq ($(strip $(target)),) cat arch-$(target)/arch-$(target).h >> api.h echo "" >> api.h endif - cat api-pthreads/api-pthreads.h >> api.h + cat api-pthreads/api-pthreads.h | \ + sed '/begin{snippet}/d' | \ + sed '/end{snippet}/d' >> api.h echo "" >> api.h cat api-pthreads/api-gcc.h >> api.h echo "" >> api.h
Makefile +3 -1
@@ -1,3 +1,5 @@ +SHELL = /bin/bash + LATEXSOURCES = \ perfbook.tex \ legal.tex \
@@ -83,7 +85,7 @@ endif SOURCES_OF_SNIPPET_ALL := $(shell grep -r -l -F '\begin{snippet}' CodeSamples) SOURCES_OF_LITMUS := $(shell grep -r -l -F '\begin[snippet]' CodeSamples) -SOURCES_OF_LTMS := $(patsubst %.litmus,&.ltms,$(SOURCES_OF_LITMUS)) +SOURCES_OF_LTMS := $(patsubst %.litmus,%.ltms,$(SOURCES_OF_LITMUS)) SOURCES_OF_SNIPPET := $(filter-out $(SOURCES_OF_LTMS),$(SOURCES_OF_SNIPPET_ALL)) $(SOURCES_OF_LITMUS) GEN_SNIPPET_D = utilities/gen_snippet_d.pl utilities/gen_snippet_d.sh
utilities/gen_snippet_d.pl +8 -8
@@ -18,10 +18,10 @@ my $snippet_key; my $snippet_key_ltms; my $source; -$snippet_key = '\\begin\{snippet\}' ; -$snippet_key_ltms = '\\begin\[snippet\]' ; -@fcvsources = `grep -l -r -F $snippet_key CodeSamples` ; -@fcvsources_ltms = `grep -l -r -F $snippet_key_ltms CodeSamples` ; +$snippet_key = '\begin{snippet}' ; +$snippet_key_ltms = '\begin[snippet]' ; +@fcvsources = `grep -l -r -F '$snippet_key' CodeSamples` ; +@fcvsources_ltms = `grep -l -r -F '$snippet_key_ltms' CodeSamples` ; chomp @fcvsources ; chomp @fcvsources_ltms ;
@@ -35,7 +35,7 @@ foreach $source (@fcvsources) { if ($source =~ /\.ltms$/) { next; } - @snippet_commands1 = `grep -F $snippet_key $source` ; + @snippet_commands1 = `grep -F '$snippet_key' $source` ; chomp @snippet_commands1 ; $source =~ m!(.*/[^/]+)/[^/]+! ; $subdir = $1 ;
@@ -51,7 +51,7 @@ foreach $source (@fcvsources_ltms) { my @snippet_commands1 ; my $subdir ; my $snippet ; - @snippet_commands1 = `grep -F $snippet_key_ltms $source` ; + @snippet_commands1 = `grep -F '$snippet_key_ltms' $source` ; chomp @snippet_commands1 ; $source =~ m!(.*/[^/]+)/[^/]+! ; $subdir = $1 ;
@@ -80,7 +80,7 @@ foreach $source (@fcvsources) { if ($source =~ /\.ltms$/) { next; } - @snippet_commands2 = `grep -F $snippet_key $source` ; + @snippet_commands2 = `grep -F '$snippet_key' $source` ; chomp @snippet_commands2 ; $src_under_sub = $source ; $source =~ m!(.*/[^/]+)/[^/]+! ;
@@ -101,7 +101,7 @@ foreach $source (@fcvsources_ltms) { my $src_under_sub ; my $subdir ; my $snippet ; - @snippet_commands2 = `grep -F $snippet_key_ltms $source` ; + @snippet_commands2 = `grep -F '$snippet_key_ltms' $source` ; chomp @snippet_commands2 ; $src_under_sub = $source ; $source =~ m!(.*/[^/]+)/[^/]+! ;
Signature · 1 line
2.7.4
PATCH 2/5 FAQ-BUILD.txt: Fix typo
In reply to Akira YokosawaFrom dcfafce655608d035b5ebee05d0c0d52ea9cfd75 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 29 Sep 2018 23:41:41 +0900
Subject: [PATCH 2/5] FAQ-BUILD.txt: Fix typo
--- FAQ-BUILD.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
FAQ-BUILD.txt +1 -1
@@ -87,7 +87,7 @@ A. Please see #5 above. -7. Building perfbook aborts with error "Your need to update a2ping". +7. Building perfbook aborts with error "You need to update a2ping". What can I do? A. a2ping 2.77p has become incompatible with up-to-date
Signature · 1 line
2.7.4
PATCH 3/5 toolsoftrade: Fix typo DEFINE_PER_THREAD() -> DEFINE_PER_CPU()
In reply to Akira YokosawaFrom 8dc682c333e435df762d204722b79c439048bfd5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 29 Sep 2018 23:44:07 +0900
Subject: [PATCH 3/5] toolsoftrade: Fix typo DEFINE_PER_THREAD() -> DEFINE_PER_CPU()
The kernel's primitive which provides an initializer should be DEFINE_PER_CPU().
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -1740,7 +1740,7 @@ init_per_thread(name, v) The \co{DEFINE_PER_THREAD()} primitive defines a per-thread variable. Unfortunately, it is not possible to provide an initializer in the way -permitted by the Linux kernel's \co{DEFINE_PER_THREAD()} primitive, +permitted by the Linux kernel's \co{DEFINE_PER_CPU()} primitive, but there is an \co{init_per_thread()} primitive that permits easy runtime initialization.
Signature · 1 line
2.7.4
PATCH 4/5 Remove workaround for Fedora 23 Tex Live bug
In reply to Akira YokosawaFrom a3df2ce37517ab16ff1ea16a1439d9895f58e761 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 29 Sep 2018 23:52:05 +0900
Subject: [PATCH 4/5] Remove workaround for Fedora 23 Tex Live bug
Fedora 23 was EOLed quite a while ago. It should be safe to remove the workaround.
--- perfbook.tex | 14 -------------- 1 file changed, 14 deletions(-)
perfbook.tex +0 -14
@@ -152,20 +152,6 @@ {->}{}{0\discretionary{->}{}{->}}% } %%HTMLNOSKIP -% --- Workaround for Fedora 23 Texlive bug -\makeatletter -\renewcommand\lstinline[1][]{% -\leavevmode\bgroup % \hbox\bgroup --> \bgroup -\def\lst@boxpos{b}% -\lsthk@PreSet\lstset{flexiblecolumns,#1}% -\lsthk@TextStyle -\ifnum\iffalse{\fi`}=\z@\fi -\@ifnextchar\bgroup{% -\ifnum`{=\z@}\fi% -\afterassignment\lst@InlineG \let\@let@token}{% -\ifnum`{=\z@}\fi\lstinline@}} -\makeatother -% --- End of workaround for Fedora 23 Texlive bug \newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}} \newcommand{\nbco}[1]{\hbox{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}} % no break lines for short snippet \newcommand{\qco}[1]{``\nbco{#1}''} % \nbco with quotation marks
Signature · 1 line
2.7.4
PATCH 5/5 Makefile: Remove rules for QC section
In reply to Akira YokosawaFrom c545a33aea39aeae40bcff478285f814c32a4456 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 30 Sep 2018 18:36:32 +0900
Subject: [PATCH 5/5] Makefile: Remove rules for QC section
This patch effectively reverts commit 11bd603a8aae ("Makefile:
Reduce file size of figure generated from ibmqx2-labeled.svg"). The figure belonged to the QC section removed by commit 972946a5298a ("future/QC: Remove quantum-computing section").
--- .gitignore | 1 - Makefile | 21 ++------------------- 2 files changed, 2 insertions(+), 20 deletions(-)
.gitignore +0 -1
@@ -4,7 +4,6 @@ *.dvi *.log *.pdf -*.png *.qqz *.toc *.sav
Makefile +2 -19
@@ -51,10 +51,7 @@ PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_ BIBSOURCES := bib/*.bib alphapf.bst SVGSOURCES := $(wildcard */*.svg) -SVG_LARGE_BITMAP := future/ibmqx2-labeled.svg -PDFTARGETS_OF_SVG := $(filter-out $(SVG_LARGE_BITMAP:%.svg=%.pdf),$(SVGSOURCES:%.svg=%.pdf)) -PNGTARGETS_OF_SVG := $(SVG_LARGE_BITMAP:%.svg=%.png) -TARGETS_OF_SVG := $(PDFTARGETS_OF_SVG) $(PNGTARGETS_OF_SVG) +PDFTARGETS_OF_SVG := $(SVGSOURCES:%.svg=%.pdf) DOT := $(shell which dot 2>/dev/null) FIG2EPS := $(shell which fig2eps 2>/dev/null)
@@ -129,7 +126,7 @@ $(PDFTARGETS:.pdf=.aux): $(LATEXGENERATED) $(LATEXSOURCES) autodate.tex: perfbook.tex $(LATEXSOURCES) $(BIBSOURCES) $(SVGSOURCES) $(FIGSOURCES) $(DOTSOURCES) $(EPSORIGIN) $(SOURCES_OF_SNIPPET) utilities/fcvextract.pl sh utilities/autodate.sh >autodate.tex -perfbook_flat.tex: autodate.tex $(PDFTARGETS_OF_EPS) $(TARGETS_OF_SVG) $(FCVSNIPPETS) $(FCVSNIPPETS_VIA_LTMS) +perfbook_flat.tex: autodate.tex $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG) $(FCVSNIPPETS) $(FCVSNIPPETS_VIA_LTMS) ifndef LATEXPAND $(error --> $@: latexpand not found. Please install it) endif
@@ -249,19 +246,6 @@ endif @inkscape --export-pdf=$@ $<i > /dev/null 2>&1 @rm -f $<i -$(PNGTARGETS_OF_SVG): %.png: %.svg - @echo "$< --> $@" -ifndef INKSCAPE - $(error $< --> $@: inkscape not found. Please install it) -endif -ifeq ($(STEELFONTID),0) - @sh $(FIXSVGFONTS) < $< | sed -e 's/Steel City Comic/Test/g' > $<i -else - @sh $(FIXSVGFONTS) < $< > $<i -endif - @inkscape --export-dpi=200 --export-png=$@ $<i > /dev/null 2>&1 - @rm -f $<i - CodeSamples/snippets.d: $(SOURCES_OF_SNIPPET) $(GEN_SNIPPET_D) sh ./utilities/gen_snippet_d.sh
@@ -310,7 +294,6 @@ clean: -o -name '*.fcv' -o -name '*.ltms' | xargs rm -f rm -f perfbook_flat.tex perfbook*.out perfbook-*.tex rm -f $(LATEXGENERATED) - rm -f $(SVG_LARGE_BITMAP:%.svg=%.pdf) $(PNGTARGETS_OF_SVG) rm -f extraction rm -f CodeSamples/snippets.mk CodeSamples/snippets.d
Signature · 1 line
2.7.4
Quoted 23 lines · Akira Yokosawa
Quoted 1 line
From
c545a33aea39aeae40bcff478285f814c32a4456Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Mon, 1 Oct 2018 22:05:58 +0900
Subject: [PATCH 0/5] Misc updatesHi Paul,
This is a miscellaneous collection of updates.
Patch #1 fixes build error you'd encounter when you do "make" after doing "make" under CodeSamples/ directory.
Patches #2 and #3 fix trivial typos in FAQ-BUILD.txt and tooldoftrade, respectively.
Patch #4 removes obsolete workaround code in perfbook.tex.
Patch #5 removes rules in
Makefileused to support a hi-res figure in QC section.Once Patch #5 is applied, you can remove orphaned files listed below:
Quoted 8 lines
future/Bloch_Sphere.svg future/QC-FormConstant.eps future/QS1_1.svg future/T2h1lc19xmqrdlsor.eps future/ibmqx2-labeled.svgAs a matter of fact, I have prepared a patch to remove them, but it would be too large to submit.
Applied and queued them, along with a sixth patch to remove the above files with your Suggested-by, thank you!!!
I never have tried it myself, but they say that the -D argument to "git diff", "git show", and "git format-patch" will create a summarized patch that can then be pulled in by "git am" and friends. If either of us remembers next time, we can try the experiment. ;-)
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (5):
CodeSamples: Exclude meta command lines in buildingapi.hFAQ-BUILD.txt: Fix typo
toolsoftrade: Fix typoDEFINE_PER_THREAD()->DEFINE_PER_CPU()Remove workaround for Fedora 23 Tex Live bug
Makefile: Remove rules for QC section.gitignore | 1 - CodeSamples/Makefile | 4 +++- FAQ-BUILD.txt | 2 +- Makefile | 25 +++++-------------------- perfbook.tex | 14 -------------- toolsoftrade/toolsoftrade.tex | 2 +- utilities/gen_snippet_d.pl | 16 ++++++++-------- 7 files changed, 18 insertions(+), 46 deletions(-)Signature · 1 line
2.7.4
Quoted 33 lines · Paul E. McKenney
Quoted 23 lines · Akira Yokosawa
Quoted 1 line
From
c545a33aea39aeae40bcff478285f814c32a4456Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Mon, 1 Oct 2018 22:05:58 +0900
Subject: [PATCH 0/5] Misc updatesHi Paul,
This is a miscellaneous collection of updates.
Patch #1 fixes build error you'd encounter when you do "make" after doing "make" under CodeSamples/ directory.
Patches #2 and #3 fix trivial typos in FAQ-BUILD.txt and tooldoftrade, respectively.
Patch #4 removes obsolete workaround code in perfbook.tex.
Patch #5 removes rules in
Makefileused to support a hi-res figure in QC section.Once Patch #5 is applied, you can remove orphaned files listed below:
Quoted 8 lines
future/Bloch_Sphere.svg future/QC-FormConstant.eps future/QS1_1.svg future/T2h1lc19xmqrdlsor.eps future/ibmqx2-labeled.svgAs a matter of fact, I have prepared a patch to remove them, but it would be too large to submit.
Quoted 7 lines
Applied and queued them, along with a sixth patch to remove the above files with your Suggested-by, thank you!!!
I never have tried it myself, but they say that the -D argument to "git diff", "git show", and "git format-patch" will create a summarized patch that can then be pulled in by "git am" and friends. If either of us remembers next time, we can try the experiment. ;-)
man page of git-format-patch says the following on the -D option:
-D, --irreversible-delete
Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and /dev/null. The resulting patch is not meant to be applied with patch or git apply; this is solely for people who want to just concentrate on reviewing the text after the change. In addition, the output obviously lack enough information to apply such a patch in reverse, even manually, hence the name of the option.
So, I'm not sure if the resulting patch can be applied by "git am". Or can a recent version of git handle such patches?
Thanks, Akira
Quoted 25 lines
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (5):
CodeSamples: Exclude meta command lines in buildingapi.hFAQ-BUILD.txt: Fix typo
toolsoftrade: Fix typoDEFINE_PER_THREAD()->DEFINE_PER_CPU()Remove workaround for Fedora 23 Tex Live bug
Makefile: Remove rules for QC section.gitignore | 1 - CodeSamples/Makefile | 4 +++- FAQ-BUILD.txt | 2 +- Makefile | 25 +++++-------------------- perfbook.tex | 14 -------------- toolsoftrade/toolsoftrade.tex | 2 +- utilities/gen_snippet_d.pl | 16 ++++++++-------- 7 files changed, 18 insertions(+), 46 deletions(-)Signature · 1 line
2.7.4
Quoted 53 lines · Akira Yokosawa
Quoted 33 lines · Paul E. McKenney
Quoted 23 lines · Akira Yokosawa
Quoted 1 line
From
c545a33aea39aeae40bcff478285f814c32a4456Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Mon, 1 Oct 2018 22:05:58 +0900
Subject: [PATCH 0/5] Misc updatesHi Paul,
This is a miscellaneous collection of updates.
Patch #1 fixes build error you'd encounter when you do "make" after doing "make" under CodeSamples/ directory.
Patches #2 and #3 fix trivial typos in FAQ-BUILD.txt and tooldoftrade, respectively.
Patch #4 removes obsolete workaround code in perfbook.tex.
Patch #5 removes rules in
Makefileused to support a hi-res figure in QC section.Once Patch #5 is applied, you can remove orphaned files listed below:
Quoted 8 lines
future/Bloch_Sphere.svg future/QC-FormConstant.eps future/QS1_1.svg future/T2h1lc19xmqrdlsor.eps future/ibmqx2-labeled.svgAs a matter of fact, I have prepared a patch to remove them, but it would be too large to submit.
Quoted 7 lines
Applied and queued them, along with a sixth patch to remove the above files with your Suggested-by, thank you!!!
I never have tried it myself, but they say that the -D argument to "git diff", "git show", and "git format-patch" will create a summarized patch that can then be pulled in by "git am" and friends. If either of us remembers next time, we can try the experiment. ;-)
man page of git-format-patch says the following on the -D option:
-D, --irreversible-delete
Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and/dev/null. The resulting patch is not meant to be applied with patch or git apply; this is solely for people who want to just concentrate on reviewing the text after the change. In addition, the output obviously lack enough information to apply such a patch in reverse, even manually, hence the name of the option.
Quoted 2 lines
So, I'm not sure if the resulting patch can be applied by "git am". Or can a recent version of git handle such patches?
$ git show HEAD > /tmp/diffs $ git checkout 985015444691d4443263b3002ea4c87b7d8e6aae Note: checking out '985015444691d4443263b3002ea4c87b7d8e6aae'. [ . . . ] HEAD is now at 985015444691 Makefile: Remove rules for QC section $ git am /tmp/diffs Patch format detection failed.
So you are absolutely right!
Thanx, Paul
Quoted 28 lines
Thanks, Akira
Quoted 25 lines
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (5):
CodeSamples: Exclude meta command lines in buildingapi.hFAQ-BUILD.txt: Fix typo
toolsoftrade: Fix typoDEFINE_PER_THREAD()->DEFINE_PER_CPU()Remove workaround for Fedora 23 Tex Live bug
Makefile: Remove rules for QC section.gitignore | 1 - CodeSamples/Makefile | 4 +++- FAQ-BUILD.txt | 2 +- Makefile | 25 +++++-------------------- perfbook.tex | 14 -------------- toolsoftrade/toolsoftrade.tex | 2 +- utilities/gen_snippet_d.pl | 16 ++++++++-------- 7 files changed, 18 insertions(+), 46 deletions(-)Signature · 1 line
2.7.4