Skip to content

Added SCons compilation instructions #885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 26, 2021
5 changes: 3 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends build-essential software-properties-common xz-utils g++ sbcl julia python3 python3-pip python3-dev ghc openjdk-11-jdk rustc libssl-dev gfortran libxml2-dev libyaml-dev libgmp-dev libz-dev libncurses5 gnuplot nodejs npm lua5.3 ocaml php ruby-full gnu-smalltalk scratch
&& apt-get -y install --no-install-recommends build-essential software-properties-common xz-utils g++ sbcl julia python3 python3-pip python3-dev ghc openjdk-11-jdk rustc libssl-dev gfortran libxml2-dev libyaml-dev libgmp-dev libz-dev libncurses5 gnuplot nodejs npm lua5.3 ocaml php ruby-full gnu-smalltalk scratch libfftw3-dev

# Setup Crystal
RUN echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
Expand Down Expand Up @@ -98,6 +98,7 @@ ENV PATH=$PATH:~/swift/usr/bin
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends crystal dart nim powershell scala dotnet-sdk-5.0 r-base racket

RUN pip install wheel matplotlib numpy coconut
RUN pip install wheel matplotlib numpy coconut scons

RUN sudo sh -c 'npm install -g typescript'

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,10 @@ vscode/

# aspell
*.bak

# SCons intermidiate files
.sconsign.dblite
*.o

# SCons build directory
build/
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This file lists everyone, who contributed to this repo and wanted to show up her
- Vincent Zalzal
- Jonathan D B Van Schenck
- James Goytia
- Amaras
- Sammy Plat
- Jonathan Dönszelmann
- Ishaan Verma
- Delphi1024
Expand Down
10 changes: 10 additions & 0 deletions SConscript
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)
20 changes: 20 additions & 0 deletions SConstruct
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')

6 changes: 6 additions & 0 deletions contents/IFS/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/approximate_counting/code/c/SConscript
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')
6 changes: 6 additions & 0 deletions contents/barnsley/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/computus/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/cooley_tukey/code/c/SConscript
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'])
6 changes: 6 additions & 0 deletions contents/euclidean_algorithm/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/flood_fill/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/forward_euler_method/code/c/SConscript
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')
6 changes: 6 additions & 0 deletions contents/gaussian_elimination/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/graham_scan/code/c/SConscript
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')
6 changes: 6 additions & 0 deletions contents/huffman_encoding/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/jarvis_march/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/monte_carlo_integration/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/split-operator_method/code/c/SConscript
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'])
6 changes: 6 additions & 0 deletions contents/stable_marriage_problem/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/thomas_algorithm/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/tree_traversal/code/c/SConscript
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'))
6 changes: 6 additions & 0 deletions contents/verlet_integration/code/c/SConscript
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'))