Commit 6614f16f authored by Sebastian Kuckuk's avatar Sebastian Kuckuk
Browse files

set up global README.md and merge/ update other documentation

parent b9fa61b3
#Scalariform formatter preferences
#Wed Nov 13 13:18:02 CET 2013
alignParameters=false
formatXml=true
preserveDanglingCloseParenthesis=false
spaceInsideBrackets=false
indentWithTabs=false
spaceInsideParentheses=false
multilineScaladocCommentsStartOnFirstLine=false
alignSingleLineCaseStatements=true
compactStringConcatenation=false
placeScaladocAsterisksBeneathSecondAsterisk=true
indentPackageBlocks=true
compactControlReadability=false
spacesWithinPatternBinders=true
alignSingleLineCaseStatements.maxArrowIndent=40
doubleIndentClassDeclaration=true
preserveSpaceBeforeArguments=false
spaceBeforeColon=true
rewriteArrowSymbols=false
indentLocalDefs=false
indentSpaces=2
eclipse.preferences.version=1
organizeimports.expandcollapse=expand
organizeimports.groups=java$scala$org$com$exastencils$isl
organizeimports.useProjectSpecificSettings=true
organizeimports.wildcards=exastencils.datastructures.l3$exastencils.logger$exastencils.constraints$exastencils.languageprocessing.l4$exastencils.spl$exastencils.domain$exastencils.parsers.l4$exastencils.parsers.l3$exastencils.parsers.settings$exastencils.data$exastencils.multiGrid$exastencils.globals$exastencils.communication$exastencils.primitives$exastencils.parsers$exastencils.datastructures.l4$exastencils.prettyprinting$exastencils.core.Logger$exastencils.optimization$exastencils.util$exastencils.strategies$exastencils.mpi$exastencils.omp$exastencils.datastructures.Transformation$exastencils.datastructures.ir.ImplicitConversions$exastencils.datastructures.ir$exastencils.polyhedron$exastencils.knowledge$exastencils.datastructures$exastencils.core$exastencils.grid$exastencils.performance$exastencils.cuda$scalaz$scalaz.Scalaz
scala.compiler.installation=2.11
IDE setup:
download and install IntelliJ IDEA (community edition is fine) https://www.jetbrains.com/idea/download/
Project setup:
open IntelliJ
import project from eclipse
import ExaStencils.xml as code style: settings -> editor -> code style -> scala -> import scheme (click small gear)
troubleshoot if necessary:
check that scala sdk is part of both modules (file -> project structure -> modules -> { Compiler; CompilerMacros } -> dependencies) - otherwise scala files will not be compiled!
if missing: add ( green plus ) -> 2 library -> scala sdk
check that the CompilerMacros module is a dependency of Compiler
check that src folders are marked as source folders (file -> project structure -> modules -> { Compiler; CompilerMacros } -> sources)
rebuild
Alternative project setup:
copy both Compiler.iml and CompilerMacros.iml to correspronding directories and import them in IntelliJ (starting with CompilerMacros)
import ExaStencils.xml as code style: settings -> editor -> code style -> scala -> import scheme (click small gear)
useful:
Keymap -> Eclipse
1.) install sbt https://www.scala-sbt.org/1.0/docs/Installing-sbt-on-Linux.html
2.) in ScalaExaStencil (or the folder you checked out to)
sbt compile
sbt assembly
Requires a valid Compiler.jar located in /Compiler/Compiler.jar
Depending on your architecture and preference you can build it using ant (call ant in the Compiler folder) or using IntelliJ.
For the latter:
File -> Project Structure -> Project Settings -> Artifacts -> Click green plus sign -> Jar -> From modules with dependencies -> Module: Compiler; Main Class: Main
Output Directory -> $path_to_your_git$\Compiler
Save
Build -> Build Artifacts -> Compiler.jar -> build
(optional) adapt platform file used in Examples/generateExamples.sh
(optional) deactivate unrequired configurations in Examples/examples.sh
afterwards simply run
cd Examples
./generateExamples.sh
./compileExamples.sh
./runExamples.sh
cf https://hackmd.io/s/SJof5RTnG#Examples
<!---
A nicely formatted online version of this README should be available here: https://hackmd.io/s/SJof5RTnG
--->
# The ExaStencils Code Generator
## IDE Support
We recommend using IntelliJ IDEA (the community edition is fine).
Downloads can be found [here](https://www.jetbrains.com/idea/download/).
*Using an IDE is not required.* Instructions on how to do things without it can be found [here](#sbt).
### Setting up the IDE for Coding
If you plan to commit code please use our code style. It is located in /Documentation/IntelliJ/ExaStencils.xml and can be imported like this:
* File -> Settings -> Editor -> Code Style -> Scala -> Import Scheme (click small gear) -> IntelliJ IDEA code style XML
* locate /Documentation/IntelliJ/ExaStencils.xml
* ok
You should also have a look at the coding guidelines found in /Documentation/CodingGuidelines.scala
If you are used to Eclipse, setting the keymap to Eclipse style may be helpful:
* File -> Settings -> Keymap -> Eclipse
### Compiling the Generator
* If IntelliJ is opened the first time:
* Open
* select path in which you checked out the git repository -> ok
* ok
* If already in the IDE:
* File -> New -> project from existing sources
* select path in which you checked out the git repository -> ok
* import project from external model -> sbt -> next
* Finish
* if 'Add Files to Git' dialogue opens -> don't add anything (press cancel)
* check that everything works: Build -> Build Project
*Alternatively*, provided project files can be used directly (not recommended):
* copy Documentation/IntelliJ/Compiler.iml to /Compiler
* copy Documentation/IntelliJ/CompilerMacros.iml to /CompilerMacros
* Import both in IntelliJ starting with CompilerMacros
### Creating a JAR
Inside the IDE do the following to create a task to assemble the jar:
* Run -> Edit configurations
* green plus (upper left corner) -> sbt Task
* fill name : assembly
* fill tasks : assembly
* Ok
The first step has to be done only once. Afterwards running the task is sufficient to assemble the jar(s).
* Run -> Run 'assembly' (if this is not available use Run -> Run... and select assembly manually)
**alternatively**, adding artifacts in IntelliJ is possible as well:
* File -> Project Structure -> Project Settings -> Artifacts -> Click green plus sign -> Jar -> From modules with dependencies
* Module: Compiler
* Main Class: Main
* ok
* Output Directory -> \$path_to_your_git\$\Compiler
* ok
The jar can then be created using
* Build -> Build Artifacts -> Compiler.jar -> build
Artifacts can be added for the other sub-projects in a similar fashion.
## sbt
For users that don't want to use an IDE or want to compile on the command line, sbt is required.
*If you are using Windows we recommend using Ubuntu Shell which is part of the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10).*
The first step is installing sbt -- a guide can be found [here](https://www.scala-sbt.org/1.0/docs/Installing-sbt-on-Linux.html)
Next, open a shell and locate the folder the git repository has been checked out to.
Compilation is done via typing
* sbt compile
To assemble a jar the following command is available
* sbt assembly
## First Steps
### Examples
We recommend having a look at the examples located in /Examples.
To generate the examples, a valid compiler.jar has to be located in /Compiler/compiler.jar. You can create one using any of the guides above.
(optional) It might be necessary to adapt the platform file used in /Examples/generateExamples.sh
(optional) By default, all examples are generated. Unrequired configurations can be deactivated in /Examples/examples.sh
If Linux is used (or the Ubuntu Shell for Windows), generating, compiling and executing the examples is scripted. The following commands can simply be executed in the folder the git repository has been checked out to:
* cd Examples
* ./generateExamples.sh
* ./compileExamples.sh
* ./runExamples.sh
### Generating User Applications
Generating single configurations is possible by executing the generator (compiler project). The following command line arguments have to be provided in this exact order:
* Settings
* Knowledge
* Platform
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment