From 9772c6b20671235a148a22b141af31bc3afd0844 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 17 May 2024 16:34:52 -0500 Subject: [PATCH 1/9] Add draft for build systems --- .../modules/compilation-model/buildsystems.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/modules/compilation-model/buildsystems.md diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md new file mode 100644 index 0000000..7fa4159 --- /dev/null +++ b/sources/modules/compilation-model/buildsystems.md @@ -0,0 +1,110 @@ +## Module name: Build systems + +_Skeleton descriptions are typeset in italic text,_ +_so please don't remove these descriptions when editing the topic._ + +### Overview + +_Provides a short natural language abstract of the module’s contents._ +_Specifies the different levels of teaching._ + +------------------------------------------------------------------------ +Level Objective +----------------- ------------------------------------------------------ +Foundational --- Knowledge about build systems + +Main --- Usage of build system to compile a executable + +Advanced --- Usage of build system to compile a library or + add external libraries as a dependencies + +------------------------------------------------------------------------ + +### Motivation + +_Why is this important?_ +_Why do we want to learn/teach this topic?_ + +* Building complex C++ projects by hand or writing Make files is tricky +* Build systems can help to resolve dependencies +* Build systems can help do distribute C++ code and help other to compile the code +* Build systems can help to find and include libraries as dependencies +* All major C++ projects are distributed with build systems + +### Topic introduction + +_Very brief introduction to the topic._ + +Build systems are used to configure, build, and install complex C++ projects. + + +### Foundational: Knowledge about build systems + +#### Background/Required Knowledge + +A student: +* Should know about build systems + + +#### Student outcomes + +_A list of things "a student should be able to" after the curriculum._ +_The next word should be an action word and testable in an exam._ +_Max 5 items._ + +A student should be able to: + +1. To explain what a build system is +2. Know that a build systems resolves dependencies +3. Know that a build system support cross-platform compilation + +#### Caveats + +_This section mentions subtle points to understand, like anything resulting in +implementation-defined, unspecified, or undefined behavior._ + +None + +#### Points to cover + +_This section lists important details for each point._ + +* Mention that many build systems are available for C++. +* Mention benefits and challenges + +### Main: Usage of build system to compile a executable + +#### Background/Required Knowledge + +* All of the above. + +#### Student outcomes + +A student should be able to: + +1. Write a configuration file to compile a C++ program with a main method +2. Use the build system to generate the executable + +#### Caveats + +The instructions are restricted to the chosen build system and +not easily transferable. + + +#### Points to cover + +* Adding include paths to header files +* Adding compiler flags +* How to build Release and Debug builds + + +### Advanced + +_These are important topics that are not expected to be covered but provide +guidance where one can continue to investigate this topic in more depth._ + +* How to build libraries +* How to include libraries to the executable +* How to find external libraries and include them +* How to add support for different compilers +* How to add support for different operating systems From ac383ec48c5a4b208f60ebd6123821084529c909 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Fri, 26 Jul 2024 09:46:54 -0600 Subject: [PATCH 2/9] Update buildsystems.md Discussion with the US group --- .../modules/compilation-model/buildsystems.md | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 7fa4159..55e43a3 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -25,11 +25,12 @@ Advanced --- Usage of build system to compile a library or _Why is this important?_ _Why do we want to learn/teach this topic?_ -* Building complex C++ projects by hand or writing Make files is tricky +* Building complex C++ projects by hand is tricky * Build systems can help to resolve dependencies * Build systems can help do distribute C++ code and help other to compile the code * Build systems can help to find and include libraries as dependencies -* All major C++ projects are distributed with build systems +* Build systems faciliate project management +* All major C++ projects are distributed with build systems ### Topic introduction @@ -43,7 +44,7 @@ Build systems are used to configure, build, and install complex C++ projects. #### Background/Required Knowledge A student: -* Should know about build systems +* Should know how to compile and link C++ programs #### Student outcomes @@ -55,8 +56,8 @@ _Max 5 items._ A student should be able to: 1. To explain what a build system is -2. Know that a build systems resolves dependencies -3. Know that a build system support cross-platform compilation +2. To explain a build systems resolves dependencies +3. To explain a build system supports compilation for different operating systems and architectures #### Caveats @@ -69,8 +70,9 @@ None _This section lists important details for each point._ -* Mention that many build systems are available for C++. +* Mention that many build systems are available for C++ * Mention benefits and challenges +* Build system help to only compile the C++ files with code changes and not the complete project ### Main: Usage of build system to compile a executable @@ -82,8 +84,10 @@ _This section lists important details for each point._ A student should be able to: -1. Write a configuration file to compile a C++ program with a main method -2. Use the build system to generate the executable +1. Download a C++ package and build the package +2. Write a configuration file to compile a C++ executable +3. Pass compiler options via the build system +4. Use the build system to generate the executable #### Caveats @@ -96,6 +100,8 @@ not easily transferable. * Adding include paths to header files * Adding compiler flags * How to build Release and Debug builds +* Linking external libraries to the C++ project +* Support different operating systems, compilers, and architectures ### Advanced @@ -103,8 +109,7 @@ not easily transferable. _These are important topics that are not expected to be covered but provide guidance where one can continue to investigate this topic in more depth._ -* How to build libraries -* How to include libraries to the executable -* How to find external libraries and include them -* How to add support for different compilers -* How to add support for different operating systems +* How to build libraries +* Write a configuration file for your own library +* How to have external libraries be downloaded during the build process + From ecbec3b702563e64f9249d9f9dfc15bc99d5822f Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 26 Sep 2024 09:28:18 -0600 Subject: [PATCH 3/9] Typos --- sources/modules/compilation-model/buildsystems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 55e43a3..fd6a97d 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -56,8 +56,8 @@ _Max 5 items._ A student should be able to: 1. To explain what a build system is -2. To explain a build systems resolves dependencies -3. To explain a build system supports compilation for different operating systems and architectures +2. To explain that a build systems resolves dependencies +3. To explain that a build system supports compilation for different operating systems and architectures #### Caveats From 646500521c217714e8b29b15961b58c6b37cb2b1 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Thu, 26 Sep 2024 09:29:22 -0600 Subject: [PATCH 4/9] More typos --- sources/modules/compilation-model/buildsystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index fd6a97d..85e11d4 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -97,7 +97,7 @@ not easily transferable. #### Points to cover -* Adding include paths to header files +* Include paths to header files to the configuration * Adding compiler flags * How to build Release and Debug builds * Linking external libraries to the C++ project From f50e498b4aabf030e44ae061d310ed79a02f6d44 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:00:59 -0600 Subject: [PATCH 5/9] Update buildsystems.md Mention unit testing --- sources/modules/compilation-model/buildsystems.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 85e11d4..5bd0fc0 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -112,4 +112,5 @@ guidance where one can continue to investigate this topic in more depth._ * How to build libraries * Write a configuration file for your own library * How to have external libraries be downloaded during the build process +* Mention that build systems provide support for unit testing From 430c317b53ce1a2950ff8859c554b5365fcf7c4b Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:06:50 -0600 Subject: [PATCH 6/9] Update buildsystems.md Move building a lib and link it to a C++ executable to the main level --- sources/modules/compilation-model/buildsystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 5bd0fc0..7666771 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -88,6 +88,7 @@ A student should be able to: 2. Write a configuration file to compile a C++ executable 3. Pass compiler options via the build system 4. Use the build system to generate the executable +5. Write a configuration file to compile a library and link the library to a C++ executable #### Caveats @@ -110,7 +111,6 @@ _These are important topics that are not expected to be covered but provide guidance where one can continue to investigate this topic in more depth._ * How to build libraries -* Write a configuration file for your own library * How to have external libraries be downloaded during the build process * Mention that build systems provide support for unit testing From ee55d0e2b732f281e0ce70687d48e10e65e87d55 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:08:42 -0600 Subject: [PATCH 7/9] Update buildsystems.md --- sources/modules/compilation-model/buildsystems.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md index 7666771..5b5e4ac 100644 --- a/sources/modules/compilation-model/buildsystems.md +++ b/sources/modules/compilation-model/buildsystems.md @@ -15,8 +15,7 @@ Foundational --- Knowledge about build systems Main --- Usage of build system to compile a executable -Advanced --- Usage of build system to compile a library or - add external libraries as a dependencies +Advanced --- Add external libraries as a dependencies ------------------------------------------------------------------------ @@ -88,7 +87,7 @@ A student should be able to: 2. Write a configuration file to compile a C++ executable 3. Pass compiler options via the build system 4. Use the build system to generate the executable -5. Write a configuration file to compile a library and link the library to a C++ executable +5. Write a configuration file to compile a library and link the library to a C++ executable #### Caveats From da55d5d63faaeb8f54416edb558fc28b8cdea4e3 Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:20:18 -0600 Subject: [PATCH 8/9] Update build Remove PR_ from the published version. --- tools/build/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/build b/tools/build/build index c3c1330..39f4abe 100755 --- a/tools/build/build +++ b/tools/build/build @@ -77,7 +77,7 @@ if [ -z "$version" ]; then usage "no document version specified" fi -version=PR_${version%/*} +version=${version%/*} ################################################################################ # Build the document. From 75732c55367946291d719a720403ccaece37756a Mon Sep 17 00:00:00 2001 From: Patrick Diehl Date: Sun, 20 Oct 2024 21:28:15 -0600 Subject: [PATCH 9/9] Remove file --- .../modules/compilation-model/buildsystems.md | 115 ------------------ 1 file changed, 115 deletions(-) delete mode 100644 sources/modules/compilation-model/buildsystems.md diff --git a/sources/modules/compilation-model/buildsystems.md b/sources/modules/compilation-model/buildsystems.md deleted file mode 100644 index 5b5e4ac..0000000 --- a/sources/modules/compilation-model/buildsystems.md +++ /dev/null @@ -1,115 +0,0 @@ -## Module name: Build systems - -_Skeleton descriptions are typeset in italic text,_ -_so please don't remove these descriptions when editing the topic._ - -### Overview - -_Provides a short natural language abstract of the module’s contents._ -_Specifies the different levels of teaching._ - ------------------------------------------------------------------------- -Level Objective ------------------ ------------------------------------------------------ -Foundational --- Knowledge about build systems - -Main --- Usage of build system to compile a executable - -Advanced --- Add external libraries as a dependencies - ------------------------------------------------------------------------- - -### Motivation - -_Why is this important?_ -_Why do we want to learn/teach this topic?_ - -* Building complex C++ projects by hand is tricky -* Build systems can help to resolve dependencies -* Build systems can help do distribute C++ code and help other to compile the code -* Build systems can help to find and include libraries as dependencies -* Build systems faciliate project management -* All major C++ projects are distributed with build systems - -### Topic introduction - -_Very brief introduction to the topic._ - -Build systems are used to configure, build, and install complex C++ projects. - - -### Foundational: Knowledge about build systems - -#### Background/Required Knowledge - -A student: -* Should know how to compile and link C++ programs - - -#### Student outcomes - -_A list of things "a student should be able to" after the curriculum._ -_The next word should be an action word and testable in an exam._ -_Max 5 items._ - -A student should be able to: - -1. To explain what a build system is -2. To explain that a build systems resolves dependencies -3. To explain that a build system supports compilation for different operating systems and architectures - -#### Caveats - -_This section mentions subtle points to understand, like anything resulting in -implementation-defined, unspecified, or undefined behavior._ - -None - -#### Points to cover - -_This section lists important details for each point._ - -* Mention that many build systems are available for C++ -* Mention benefits and challenges -* Build system help to only compile the C++ files with code changes and not the complete project - -### Main: Usage of build system to compile a executable - -#### Background/Required Knowledge - -* All of the above. - -#### Student outcomes - -A student should be able to: - -1. Download a C++ package and build the package -2. Write a configuration file to compile a C++ executable -3. Pass compiler options via the build system -4. Use the build system to generate the executable -5. Write a configuration file to compile a library and link the library to a C++ executable - -#### Caveats - -The instructions are restricted to the chosen build system and -not easily transferable. - - -#### Points to cover - -* Include paths to header files to the configuration -* Adding compiler flags -* How to build Release and Debug builds -* Linking external libraries to the C++ project -* Support different operating systems, compilers, and architectures - - -### Advanced - -_These are important topics that are not expected to be covered but provide -guidance where one can continue to investigate this topic in more depth._ - -* How to build libraries -* How to have external libraries be downloaded during the build process -* Mention that build systems provide support for unit testing -