-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Added SCons compilation instructions #885
Conversation
There we go, all targets (but one which can't be built) are operational if I'm not mistaken. I'll wait for confirmation that I did not miss anything before putting in to review, but it should be good to merge. There is also a slight implementation problem, but I'll try to correct it before making it ready for review |
So, basically, at this point, I'm waiting for @leios to make a main function for the quantum systems C file, otherwise the compilation system for C is complete. I could not fix the problem with my current structure, but it seems to be good enough for now. As of now, I'm making this PR ready for review, since it's mostly ready. To build everything, go to the root of the algorithm archive, and just run |
I'm checking the PR locally, running scons results in an error because I don't have |
Yeah, this is not something I want to delve into. We probably should install it (the |
contents/barnsley/code/c/SConscript
Outdated
@@ -0,0 +1,2 @@ | |||
Import('*') | |||
env.C('#/build/c/bransley/barnsley', 'barnsley.c') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in folder name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, it should not happen any more
I'm thinking that a lot of these files could be generated when |
There is an issue with the compilation, I have all the depedencies, but I'm getting an error:
The error is what you reported about the missing I think having a way to continue compilation instead of aborting would be preferable. |
SConscript files are now mostly universal for C programs. Additionally, the build hierarchy is now flattened (executables under the language folder)
In accordance with your review, this should now work as expected, without typos. Also not that you can build a single target by running I currently have this collection of executables: amaras@amaras:~/algorithm-archive$ exa -1 build/c/
barnsley
computus
cooley_tukey
euclidean_algorithm
flood_fill
forward_euler_method
gaussian_elimination
graham_scan
huffman_encoding
IFS
jarvis_march
monte_carlo_integration
split-operator_method
stable_marriage_problem
thomas_algorithm
tree_traversal
verlet_integration This list will change with the changing of folder names (if there are any), so it should be quite flexible. |
Removed the quantum_systems SConscript
Right, apparently this was closed because @leios decided to say that his PR solved an issue (as GH PRs are basically just issues) 😂 |
I can't modify the dockerfile in your branch (i think because it existed before I was added as a contributor) so you can swap the docker file to this # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/ubuntu/.devcontainer/base.Dockerfile
# [Choice] Ubuntu version: bionic, focal
ARG VARIANT="focal"
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 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
RUN curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null
# Setup Dart
RUN sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
RUN sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
# Setup Powershell
RUN sudo sh -c 'wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb'
RUN sudo sh -c 'dpkg -i packages-microsoft-prod.deb'
# Setup Clojure
RUN sudo sh -c 'curl -O https://download.clojure.org/install/linux-install-1.10.3.967.sh'
RUN sudo sh -c 'chmod +x linux-install-1.10.3.967.sh'
RUN sudo sh -c 'sudo ./linux-install-1.10.3.967.sh'
# Setup dotnet
RUN sudo sh -c 'wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb'
RUN sudo sh -c 'sudo dpkg -i packages-microsoft-prod.deb'
RUN sudo sh -c 'rm packages-microsoft-prod.deb'
# Setup D Lang
RUN sudo sh -c 'mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh'
RUN sudo sh -c 'bash ~/dlang/install.sh'
## From Docs not needed though
# RUN sudo sh -c 'source ~/dlang/dmd-2.097.2/activate'
ENV PATH=$PATH:/root/dlang/dmd-2.097.2/linux/bin64
# Setup Go
RUN sudo sh -c 'wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local'
ENV PATH=$PATH:/usr/local/go/bin
# Setup Kotlin (doesnt unzip right maybe?)
RUN sudo sh -c 'wget -c https://github.com/JetBrains/kotlin/releases/download/v1.5.30/kotlin-compiler-1.5.30.zip -O /usr/local/kotlinc.zip'
RUN unzip /usr/local/kotlinc.zip
ENV PATH=$PATH:/usr/local/kotlinc/bin
# Setup lolcode
## Use: https://github.com/justinmeza/lci
# Setup Piet
## Use: https://github.com/boothby/repiet
# Setup Matlab
# ?????? This is a licensed language???
# Setup Emojicode (in progress)
RUN sudo sh -c 'wget -c https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -O /usr/local/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz'
RUN sudo tar -xvzf /usr/local/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz
# && cd ~/emojicode/ && echo && ./install.sh'
ENV PATH=$PATH:/usr/local/Emojicode-1.0-beta.2-Linux-x86_64
# Setup Factor (in progress)
RUN mkdir -p ~/factor && wget https://downloads.factorcode.org/releases/0.98/factor-linux-x86-64-0.98.tar.gz -O ~/factor/factor.tar.gz
RUN tar -xzf /root/factor/factor.tar.gz
# && rm ~/factor/factor.tar.gz
ENV PATH=$PATH:/root/factor/factor
# Setup R
RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
# Setup Racket and Scheme
# To run scheme files, use `racket -f <file.ss>`
RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D9D33FCD84D82C17288BA03B3C9A6980F827E01E
RUN sudo add-apt-repository 'deb http://ppa.launchpad.net/plt/racket/ubuntu focal main'
# Setup Scratch
## using 1.x right now.... in future checkout snap or adobe air?
# Setup Swift
RUN mkdir -p ~/swift && wget https://swift.org/builds/swift-5.5-release/ubuntu2004/swift-5.5-RELEASE/swift-5.5-RELEASE-ubuntu20.04.tar.gz -O ~/swift/swift.tar.gz && \
tar -xzf ~/swift/swift.tar.gz -C ~/swift --strip-components=1
ENV PATH=$PATH:~/swift/usr/bin
# Setup viml
## ?
# Setup whitespace
## ?
# Setup Elm
## https://github.com/elm/compiler/blob/master/installers/linux/README.md
# Setup V
## https://github.com/vlang/v/blob/master/doc/docs.md
# Install the packages that needed extra help
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 scons
RUN sudo sh -c 'npm install -g typescript' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge this!
Hey all!
As per #691, we now have a first draft of what the build system could look like.
It's definitely not good yet, and a few algorithms don't work yet, and only C instructions have been provided.
The problem I have is that I don't really know why it doesn't use the linking flags, but I did that without documentation access, so hey! I'm glad it works at all! 😅
So the plan will be to work on the C instructions, then maybe open an issue to let contributors add compilation instructions for Hacktober.