CallForSanity / Gaalop

Gaalop (Geometic Algebra Algorithms Optimizer) is a software to compile and optimize geometric algebra (GA) expressions into high-level programming language code. Geometric algebra expressions can be developed using the freely available CLUCalc software by Christian Perwass. Gaalop optimizes CLUCalc expressions and produces C++ (AMP), OpenCL, CUDA, CLUCalc or LaTeX output. The optimized code is free of geometric algebra operations and runs very efficiently on various platforms.
http://www.gaalop.de
GNU Lesser General Public License v3.0
101 stars 27 forks source link

antlr 3.5.2 and some pom.xml files needed upgrade and editing #1

Closed rbeaster closed 5 years ago

rbeaster commented 9 years ago

I have been trying to learn about this software. I'm not really a programmer, but I have sometimes written some code. I started by cloning the master and gaalop_precompiler branches. Then, I followed instructions on building the gaalop_precompiler branch (a copy of it) it using cmake-gui. I found that I had to hack on a few files and upgrade "antlr" files to version 3.5.2. My system is Slackware64 linux.

First, I downloaded ~/bin/antlr-3.5.2-complete.jar and made a file ~/bin/antlr with:

#!/bin/bash
java -jar ~/bin/antlr-3.5.2-complete.jar $@
chmod +x ~/bin/antlr

Then I symlinked ~/bin/antlr3 -> ~/bin/antlr just in case it is called as antlr3.

Then, following build instructions I managed to finish the cmake-gui part and generate a good Makefile. I ran "make" and the build process starts, but I ran into errors in the build of several of the modules. The errors are all about antlr.

Each module subdirectory has a "pom.xml" file that I had to modify with:

        <plugins>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <version>3.5.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>antlr</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!--
                      This configuration is required to use the tokenVocab directive in ANTLR.
                      Otherwise the .token files will not be found.
                      See http://mojo.codehaus.org/antlr3-maven-plugin/examples/tokenVocab.html
                    -->
            <sourceDirectory>src/main/antlr</sourceDirectory>
            <outputDirectory>src/main/antlr</outputDirectory>
                </configuration>
            </plugin>
        </plugins>

and

        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr-runtime</artifactId>
            <version>3.5.2</version>
            <type>jar</type>
        </dependency>

I also put: antlr-runtime-3.5.2.jar -> antlr-3.5.2-runtime.jar into the "dependencies" directory.

Since I use java 8, I also modified the main pom.xml with:

<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>

The build system is kind of complicated, and I could only hack at it to make it work. I do not fully understand all about how it works. At this point, with the changes given above, the build is all SUCCESS for all modules, including at the end I get:

Linking CXX static library libgpc-vis-opengl.a
[100%] Built target gpc-vis-opengl

Okay, I can try now to see if this build actually works, and how to package and install it on my system. Maybe the developers can consider updating all of the dependencies of this project to current versions of software etc, so that it can maybe work without changes I had to make. I think that most would be using Java 8 at this time, but maybe I do not know since I do not develop Java except for once a long time ago for a small project.

CallForSanity commented 9 years ago

Hi, first of all, thank you very much for your interest in Gaalop and GPC and for bringing up the issue. We are aware, that the build system is not up to date at this point. Also we have never tried Java 8 yet.

Of course we have great interest in keeping up to date, we currently just do not have the time to maintain it properly. (It seems that I am the only developer right now.) This is one of the reasons we made it Open Source so that people like you can keep the project alive and help maintaining, which is what you basically just did ;) Thank you!

So now to the technical stuff: The build is currently tested with travis (Linux) and appveyor (Windows) Continuos Integration platforms. There are two .yml files that define how to build and they are more up to date than the CMake PDFs. They can be found in the root directory. These define our current "official" build steps.

The travis builds for Gaalop are doing: mvn clean package assembly:directory The build for the Precompiler is more complicated, but from your writing it seems you have figured it out correctly.

So what we could do now is the following:

  1. You fork Gaalop and commit your changes.
  2. You send me a pull request.
  3. I will see if the builds and tests still run with your changes.
  4. I will integrate your changes.

Pull request are the best way to handle this situation and also make sure your contribution to Open Source projects is properly credited to you, see: https://yangsu.github.io/pull-request-tutorial/

  1. If you are interested in further supporting Gaalop, I can give you full commit access to the repo.

Hope to receive your pull request soon! Best, Patrick

rbeaster commented 9 years ago

I had some trouble figuring out how to run gpc on the command line, but I did eventually figure it out...

./run_gpc.sh -i $PWD/Test6_OpenCL_Horizon.clg -o $PWD/Test6_OpenCL_Horizon.clg.cl -algebraName 5d -optimizer de.gaalop.tba.Plugin

The cmake/make seems to have failed to run this automatically. There must be some configuration mistake that I made, but I'm not sure yet.

So, I can at least run the test programs for CPU and OpenCL. It's a start. :)

CSteinmetz15 commented 7 years ago

Building with JDK 8 is now possible because ANTLR v4 is now used for parsing inputs.

CSteinmetz15 commented 5 years ago

I had closed this ticket, because we implemted ANTLR v4 in 2017, but did not close this ticket.