-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SCons compilation instructions (#885)
* Added C compilation to SCons (not all work, though) * First fully functional version of the build system for C code * Simplified SConstruct file * Simplified SConscript files SConscript files are now mostly universal for C programs. Additionally, the build hierarchy is now flattened (executables under the language folder) * fixing chapter to use split-op code (#888) Removed the quantum_systems SConscript * modified Dockerfile for ntindle * Changed my name in CONTRIBUTORS.md * apparently forgot an algorithm Co-authored-by: James Schloss <jrs.schloss@gmail.com>
- Loading branch information
Showing
23 changed files
with
149 additions
and
3 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
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 |
---|---|---|
|
@@ -517,3 +517,10 @@ vscode/ | |
|
||
# aspell | ||
*.bak | ||
|
||
# SCons intermidiate files | ||
.sconsign.dblite | ||
*.o | ||
|
||
# SCons build directory | ||
build/ |
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
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 @@ | ||
from pathlib import Path | ||
|
||
Import('*') | ||
|
||
for p in Path('contents').iterdir(): | ||
if (q := (p / 'code')).exists(): | ||
for path in q.iterdir(): | ||
if path.stem in languages: | ||
env.SConscript(path / 'SConscript', exports='env', | ||
must_exist=0) |
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,20 @@ | ||
""" | ||
SCons top-level build description (SConstruct) for the Arcane Algorithm Achive | ||
This provides Builder objects for each of the language implementations in the AAA; however, this work cannot be considered exhaustive until every language has been covered. | ||
Currently, the aim is to provide a way to compile or copy the implementation files to the build directory, as well as to provide ways to run them and capture their output. | ||
To run the compilation for all implmeentations in one language, e.g. Rust, run the command `scons build/c`, and the resulting executables will be available in the `cuild/c` directory, each in their respective algorithm directory, containing the executable.""" | ||
|
||
from pathlib import Path | ||
|
||
env = Environment() | ||
|
||
# Add other languages here when you want to add language targets | ||
languages = ['c'] | ||
|
||
env.C = env.Program | ||
|
||
SConscript('SConscript', exports='env languages') | ||
|
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS='m') |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS=['m', 'fftw3']) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS='m') |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS='m') |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS=['m', 'fftw3']) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |
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,6 @@ | ||
Import('*') | ||
from pathlib import Path | ||
|
||
dirname = Path.cwd().parents[1].stem | ||
|
||
env.C(f'#/build/c/{dirname}', Glob('*.c')) |