generated from learning-process/programming_course_reports
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 63f9669
Showing
15 changed files
with
371 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build application | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ubuntu-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Setup environment | ||
run: | | ||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | ||
sudo apt-get update | ||
sudo apt-get install ninja-build | ||
sudo apt-get install texlive* | ||
- name: Build | ||
run: | | ||
mkdir build | ||
cmake -G Ninja -S . -B build -D USE_LATEX=ON | ||
cmake --build build | ||
shell: bash | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ubuntu-artifacts | ||
path: build/bin/ | ||
windows-build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Setup environment | ||
run: | | ||
choco install miktex.install | ||
shell: pwsh | ||
- name: Build | ||
run: | | ||
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | ||
refreshenv | ||
mkdir build | ||
cmake -S . -B build -D USE_LATEX=ON | ||
cmake --build build | ||
shell: pwsh | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows-artifacts | ||
path: build/bin/ | ||
macos-build: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Setup environment | ||
run: | | ||
brew install --cask mactex | ||
brew install ninja | ||
- name: Build | ||
run: | | ||
eval "$(/usr/libexec/path_helper)" | ||
mkdir build | ||
cmake -G Ninja -S . -B build -D USE_LATEX=ON | ||
cmake --build build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: macos-artifacts | ||
path: build/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
build | ||
mpich | ||
cmake-build-release | ||
cmake-build-debug | ||
.idea/ | ||
.vscode/ | ||
scripts/variants.csv | ||
scripts/variants.xlsx | ||
venv* | ||
sln/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
cmake_minimum_required( VERSION 3.27 ) | ||
|
||
message( STATUS "Programming Course Reports" ) | ||
project(programming_course_reports) | ||
|
||
include(${CMAKE_SOURCE_DIR}/cmake/configure.cmake) | ||
|
||
############################### LATEX ############################### | ||
option(USE_LATEX OFF) | ||
if( USE_LATEX ) | ||
find_package(LATEX REQUIRED) | ||
if(NOT (LATEX_FOUND AND LATEX_PDFLATEX_FOUND)) | ||
set(USE_LATEX OFF) | ||
endif() | ||
endif( USE_LATEX ) | ||
|
||
add_subdirectory(modules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2020, Nesterov Alexander | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
[![Build application](https://github.com/learning-process/programming_course_reports/actions/workflows/main.yml/badge.svg)](https://github.com/learning-process/programming_course_reports/actions/workflows/main.yml) | ||
|
||
# Programming Course Reports | ||
|
||
The following reporting technologies are considered in practice: | ||
* `LaTeX` | ||
|
||
## Rules for submissions | ||
1. You are not supposed to trigger CI jobs by frequent updates of your pull request. First you should test you work locally with all the scripts (code style) | ||
* Respect others time and don't slow down the job queue | ||
2. Carefully check if the program can hang | ||
|
||
## 1. Set up your environment | ||
### Fetch submodules before building the project | ||
``` | ||
git submodule update --init --recursive | ||
``` | ||
|
||
### Reporting technologies | ||
### `LaTeX` | ||
* **Windows**: | ||
|
||
1. Install [Chocolatey](https://chocolatey.org/install) | ||
2. Install TeX distribution: | ||
|
||
Choose one of two (any) TeX distribution to install | ||
|
||
- miktex | ||
```bash | ||
choco install miktex | ||
``` | ||
Add miktex installation path to your system PATH environment variable. Default installation location: "C:\Program Files\MiKTeX\miktex\bin\x64" | ||
- texlive (takes more disk space and time to setup) | ||
```bash | ||
choco install texive --params="'/scheme:full'" --execution-timeout=10000 | ||
``` | ||
3. Refresh your environment (reopen the console or type `refreshenv`) and check if TeX distribution is set up. E.g. use this command (it should be available and display the current version of pdflatex tool): | ||
```bash | ||
pdflatex --version | ||
``` | ||
|
||
* **Linux**: | ||
``` | ||
sudo apt install ninja-build texlive* | ||
``` | ||
* **MacOS (apple clang)**: | ||
|
||
``` | ||
brew install ninja | ||
brew install --cask mactex | ||
``` | ||
|
||
## 2. Build the project with `CMake` | ||
Navigate to a source code folder. | ||
|
||
1) Configure the build: | ||
|
||
``` | ||
mkdir build && cd build | ||
cmake -D USE_LATEX=ON .. | ||
``` | ||
*Help on CMake keys:* | ||
- `-D USE_LATEX=ON` enable `LaTeX` reports. | ||
|
||
*A corresponding flag can be omitted if it's not needed.* | ||
2) Build the project: | ||
``` | ||
cmake --build . | ||
``` | ||
3) Check the task | ||
* View report `<project's folder>/build/bin` | ||
## 3. How to submit you work | ||
* There are `task_1`, `task_2`, `task_3`, `task_4` folders in `modules` directory. There are 4 task's reports for the semester. Move to a folder of your task. Make a directory named `<last name>_<first letter of name>_<short task name>`. Example: `task1/nesterov_a_vector_sum`. | ||
* Go into the newly created folder and begin you work on the report. There must be only 2 files and 1 of them must be written by you: | ||
- `nesterov_a_vector_sum.tex` - a LaTeX report file which consider information about your program, name it in the same way as `<last name>_<first letter of name>_<short task name>` same as directory. | ||
- `CMakeLists.txt` - a file to configure your project. Examples for each configuration can be found in `test_tasks/test_latex`. | ||
* The number of directories will increase with time. To build only your project, you need to do the following: | ||
``` | ||
cmake --build . --target <name task's directory> | ||
``` | ||
Example: | ||
``` | ||
cmake --build . --target nesterov_a_vector_sum | ||
``` | ||
* Name your pull request in the following way: | ||
* for report: | ||
``` | ||
<Фамилия Имя>. Отчет. <Полное название задачи>. | ||
Нестеров Александр. Отчет. Сумма элементов вектора. | ||
``` | ||
* Provide the full task definition in pull request's description. | ||
Example pull request is located in repo's pull requests. | ||
|
||
* Work on your fork-repository. Keep your work on a separate branch and **NOT on `master`!!!**. Name you branch in the same way as your task's folder. To create a branch run: | ||
``` | ||
git checkout -b nesterov_a_vector_sum | ||
``` | ||
*Failing to follow the rules makes the project build red.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
MACRO(SUBDIRLIST result curdir) | ||
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) | ||
SET(dirlist "") | ||
FOREACH(child ${children}) | ||
IF(IS_DIRECTORY ${curdir}/${child}) | ||
LIST(APPEND dirlist ${child}) | ||
ENDIF() | ||
ENDFOREACH() | ||
SET(${result} ${dirlist}) | ||
ENDMACRO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "Example tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME) | ||
|
||
set(LATEX_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") | ||
if (NOT EXISTS ${LATEX_OUTPUT_PATH}) | ||
file(MAKE_DIRECTORY ${LATEX_OUTPUT_PATH}) | ||
endif () | ||
|
||
if (USE_LATEX) | ||
message( STATUS "-- " ${ProjectId} ) | ||
file(GLOB_RECURSE report_files "*.tex") | ||
|
||
foreach (report ${report_files}) | ||
get_filename_component(report_name ${report} NAME_WE) | ||
list(APPEND list_report_names ${report_name}) | ||
endforeach () | ||
|
||
add_custom_target( ${ProjectId}_prebuild | ||
COMMAND ${PDFLATEX_COMPILER} -draftmode -interaction=nonstopmode ${report_files} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
DEPENDS ${report_files}) | ||
|
||
add_custom_target( ${ProjectId}_pdf | ||
COMMAND ${PDFLATEX_COMPILER} ${report_files} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
DEPENDS ${report_files}) | ||
|
||
add_custom_target(${ProjectId}_all_formats ALL) | ||
add_dependencies(${ProjectId}_all_formats ${ProjectId}_pdf) | ||
|
||
foreach (report_name ${list_report_names}) | ||
add_custom_command( | ||
TARGET ${ProjectId}_all_formats | ||
POST_BUILD | ||
COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.aux" "${LATEX_OUTPUT_PATH}/${report_name}.aux" | ||
COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.log" "${LATEX_OUTPUT_PATH}/${report_name}.log" | ||
COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.pdf" "${LATEX_OUTPUT_PATH}/${report_name}.pdf" | ||
) | ||
endforeach () | ||
else() | ||
message( STATUS "-- ${ProjectId} - NOT BUILD!" ) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
\documentclass[12pt]{article} | ||
\usepackage{lingmacros} | ||
\usepackage{tree-dvips} | ||
\begin{document} | ||
|
||
\section*{Notes for My Paper} | ||
|
||
Don't forget to include examples of topicalization. | ||
They look like this: | ||
|
||
{\small | ||
\enumsentence{Topicalization from sentential subject:\\ | ||
\shortex{7}{a John$_i$ [a & kltukl & [el & | ||
{\bf l-}oltoir & er & ngii$_i$ & a Mary]]} | ||
{ & {\bf R-}clear & {\sc comp} & | ||
{\bf IR}.{\sc 3s}-love & P & him & } | ||
{John, (it's) clear that Mary loves (him).}} | ||
} | ||
|
||
\subsection*{How to handle topicalization} | ||
|
||
I'll just assume a tree structure like (\ex{1}). | ||
|
||
{\small | ||
\enumsentence{Structure of A$'$ Projections:\\ [2ex] | ||
\begin{tabular}[t]{cccc} | ||
& \node{i}{CP}\\ [2ex] | ||
\node{ii}{Spec} & &\node{iii}{C$'$}\\ [2ex] | ||
&\node{iv}{C} & & \node{v}{SAgrP} | ||
\end{tabular} | ||
\nodeconnect{i}{ii} | ||
\nodeconnect{i}{iii} | ||
\nodeconnect{iii}{iv} | ||
\nodeconnect{iii}{v} | ||
} | ||
} | ||
|
||
\subsection*{Mood} | ||
|
||
Mood changes when there is a topic, as well as when | ||
there is WH-movement. \emph{Irrealis} is the mood when | ||
there is a non-subject topic or WH-phrase in Comp. | ||
\emph{Realis} is the mood when there is a subject topic | ||
or WH-phrase. | ||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "MPI tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "OpenMP tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "Sequential tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "STL tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
message(STATUS "TBB tasks") | ||
|
||
SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
foreach(subd ${subdirs}) | ||
add_subdirectory(${subd}) | ||
endforeach() |