Skip to content

Commit

Permalink
Add Makefile.config to configure SQL/SQL++/ODM and SPARK ; Reorg for …
Browse files Browse the repository at this point in the history
…Makefiles ; Remove all jars from repository (now all pulled through ant scripts) ; Refresh README
  • Loading branch information
Jerome Simeon committed Sep 3, 2017
1 parent 7ce11d9 commit dd491f5
Show file tree
Hide file tree
Showing 28 changed files with 517 additions and 266 deletions.
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
*~
.#*
*.vo
*.v.d
*.glob
*.aux
Makefile.coq
Makefile.config
bin/qdata
bin/qcert
bin/qcertJS.js
bin/*.jar
bin/services/*.jar
/.project
.DS_Store
*~
.#*
*.vo
*.v.d
*.glob
*.aux
.DS_Store
206 changes: 132 additions & 74 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# limitations under the License.
#

include Makefile.config

#
CP=cp
TSC?=tsc

DIST_DIR=

export MODULES = \
Basic/Util/Digits \
Basic/Util/Lattice \
Expand Down Expand Up @@ -343,130 +344,187 @@ export MODULES = \
Tests/CompilerTest

FILES = $(addprefix coq/,$(MODULES:%=%.v))
SQL=
SQLPP=
ODM=

## Compiler
all:
@$(MAKE) qcert

qcert: Makefile.coq
@$(MAKE) qcert-coq
@$(MAKE) qcert-ocaml
@$(MAKE) qcert-javascript
@$(MAKE) qcert-java
@echo "[Q*cert] "
@echo "[Q*cert] To compile the runtimes, do:"
@echo "[Q*cert] make qcert-runtimes"
@echo "[Q*cert] "

qcert-runtimes:
@$(MAKE) javascript-runtime
@$(MAKE) java-runtime
@$(MAKE) spark2-runtime

clean-runtimes:
@$(MAKE) -C runtime/javascript clean
@$(MAKE) -C runtime/java clean
@$(MAKE) -C runtime/spark2 clean

javascript-runtime:
qcert-coq: Makefile.coq
@echo "[Q*cert] "
@echo "[Q*cert] Building JavaScript runtime"
@echo "[Q*cert] Compiling Coq source"
@echo "[Q*cert] "
@$(MAKE) -C runtime/javascript
@$(MAKE) -f Makefile.coq

java-runtime:
qcert-ocaml:
@echo "[Q*cert] "
@echo "[Q*cert] Building Java runtime"
@echo "[Q*cert] Extracting compiler to OCaml"
@echo "[Q*cert] "
@$(MAKE) -C runtime/java
@$(MAKE) -C ocaml cleanall all

spark2-runtime:
qcert-javascript:
@echo "[Q*cert] "
@echo "[Q*cert] Building Spark2 runtime"
@echo "[Q*cert] Extracting compiler to JavaScript"
@echo "[Q*cert] "
@$(MAKE) -C runtime/spark2
@$(MAKE) -C ocaml js

javacode:
@$(MAKE) java-runtime
@$(MAKE) -C samples
ifneq ($(SQL)$(SQLPP)$(ODM),)
qcert-java:
ifneq ($(SQL)$(SQLPP)$(JRULES),)
@echo "[Q*cert] "
@echo "[Q*cert] Compiling Java service"
@echo "[Q*cert] "
@$(MAKE) -C javaService
endif
ifneq ($(SQL),)
@echo "[Q*cert] "
@echo "[Q*cert] Compiling SQL support"
@echo "[Q*cert] "
@$(MAKE) -C sqlParser
endif
ifneq ($(SQLPP),)
@echo "[Q*cert] "
@echo "[Q*cert] Compiling SQL++ support"
@echo "[Q*cert] "
@$(MAKE) -C sqlppParser
endif
ifneq ($(ODM),)
ifneq ($(JRULES),)
@echo "[Q*cert] "
@echo "[Q*cert] Compiling ODM rules support"
@echo "[Q*cert] "
@$(MAKE) -C camp-java
@$(MAKE) -C jrules2CAMP
endif
ifneq ($(SQL)$(SQLPP)$(ODM),)
ifneq ($(SQL)$(SQLPP)$(JRULES),)
@echo "[Q*cert] "
@echo "[Q*cert] Deploying Java service"
@echo "[Q*cert] "
@$(MAKE) -C javaService install
endif

demo: qcert qcert-javascript
clean-coq:
@$(MAKE) -f Makefile.coq clean

cleanall-coq: clean-coq

clean-ocaml:
@$(MAKE) -C ocaml clean

cleanall-ocaml:
@$(MAKE) -C ocaml cleanall

clean-java:
@$(MAKE) -C javaService clean
@$(MAKE) -C sqlParser clean
@$(MAKE) -C sqlppParser clean
@$(MAKE) -C camp-java clean
@$(MAKE) -C jrules2CAMP clean
@rm -rf bin/services
@rm -f bin/javaService.jar

cleanall-java:
@$(MAKE) -C javaService cleanall
@$(MAKE) -C sqlParser cleanall
@$(MAKE) -C sqlppParser cleanall
@$(MAKE) -C camp-java cleanall
@$(MAKE) -C jrules2CAMP cleanall
@rm -rf bin/services
@rm -f bin/javaService.jar


## Runtime
qcert-runtimes:
@$(MAKE) javascript-runtime
ifneq ($(JAVA),)
@$(MAKE) java-runtime
endif
ifneq ($(SPARK),)
@$(MAKE) spark2-runtime
endif

javascript-runtime:
@echo "[Q*cert] "
@echo "[Q*cert] Compiling TypeScript files to JavaScript"
@echo "[Q*cert] Building JavaScript runtime"
@echo "[Q*cert] "
cd webdemo && $(TSC) -p "tsconfig.json"
@$(MAKE) -C runtime/javascript

qcert-coq: Makefile.coq
java-runtime:
@echo "[Q*cert] "
@echo "[Q*cert] Compiling Coq source"
@echo "[Q*cert] Building Java runtime"
@echo "[Q*cert] "
@$(MAKE) -f Makefile.coq
@$(MAKE) -C runtime/java

qcert-ocaml:
spark2-runtime:
@echo "[Q*cert] "
@echo "[Q*cert] Extracting compiler to OCaml"
@echo "[Q*cert] Building Spark2 runtime"
@echo "[Q*cert] "
@$(MAKE) -C ocaml realclean all
@$(MAKE) -C runtime/spark2

qcert-javascript:
clean-runtimes:
@$(MAKE) -C runtime/javascript clean
@$(MAKE) -C runtime/java clean
@$(MAKE) -C runtime/spark2 clean

cleanall-runtimes: clean-runtimes


## Demo
demo: bin/qcertJS.js
@echo "[Q*cert] "
@echo "[Q*cert] Extracting compiler to JavaScript"
@echo "[Q*cert] Compiling TypeScript files to JavaScript"
@echo "[Q*cert] "
@$(MAKE) -C ocaml js
cd webdemo && $(TSC) -p "tsconfig.json"

qcert: Makefile.coq
@$(MAKE) qcert-coq
@$(MAKE) qcert-ocaml

Makefile.coq: Makefile $(VS) $(FILES)
@coq_makefile -f _CoqProject $(FILES) -o Makefile.coq
## Runners
qcert-runners:
@$(MAKE) -C samples

clean_detritus:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 ./script/remove_detritus_derived_file.sh
clean-runners:
@$(MAKE) -C samples clean

remove_all_derived:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 rm -f
cleanall-runners:
@$(MAKE) -C samples cleanall

clean:: Makefile.coq remove_all_derived
@$(MAKE) -f Makefile.coq clean
@$(MAKE) -C ocaml cleanall
## Documentation
documentation:
$(MAKE) -C coq documentation


## Cleanup
clean: Makefile.coq remove_all_derived
@$(MAKE) clean-coq
@$(MAKE) clean-ocaml
@$(MAKE) clean-java
@$(MAKE) clean-runtimes
@rm -f Makefile.coq
@rm -f *~

cleanall: clean remove_all_derived clean_detritus

DISTDIR=../qcert-0.1.0

$(DISTDIR):
@cp -R ../qcert $(DISTDIR)
@rm -rf $(DISTDIR)/.git
@$(MAKE) -C $(DISTDIR) clean remove_all_derived

dist:
$(MAKE) $(DISTDIR)
tar cvf $(DISTDIR).tar $(DISTDIR)
gzip $(DISTDIR).tar
cleanall: Makefile.coq remove_all_derived
@$(MAKE) cleanall-coq
@$(MAKE) cleanall-ocaml
@$(MAKE) cleanall-java
@$(MAKE) cleanall-runtimes
@rm -f Makefile.coq
@rm -f *~

cleandist:
rm -rf $(DISTDIR)
rm -f $(DISTDIR).tar.gz
clean_detritus:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 ./script/remove_detritus_derived_file.sh

documentation:
$(MAKE) -C coq documentation
remove_all_derived:
@find . \( -name '*.vo' -or -name '*.v.d' -or -name '*.glob' -or -name '*.aux' \) -print0 | xargs -0 rm -f

documentation_old: Makefile.coq
@$(MAKE) -f Makefile.coq html
##
Makefile.coq: Makefile $(VS) $(FILES)
@coq_makefile -f _CoqProject $(FILES) -o Makefile.coq

.PHONY: all clean clean_detritus documentation documentation_old

19 changes: 19 additions & 0 deletions Makefile.config_tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Uncomment to support a given source or target language

### Source languages configuration

## SQL and SQL++ support requires Java and Ant
SQL=yes
SQLPP=yes

## ODM rules support requires Java and Ant, plus a copy of the jrules-engine.jar (See README.md)
#JRULES=yes

### Target languages configuration

## Java support requires Java and Ant
JAVA=yes

## Spark support requires Scala, SBT (Scala Built Tool), and Ant
#SPARK=yes

50 changes: 50 additions & 0 deletions README-ODM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### Obtaining the ODM Rules dependencies

The ODM rules support requires that you obtain a legal copy of the ODM
Designer component that comes with various versions of ODM.

ODM comes in (at least) two configurations called "ODM Rules" and "ODM
Insights". Each comes with its own Designer, which in turn supports a
characteristic set of languages. There are (at least) two license
arrangements: "ODM Classic" has only the Rules configuration and "ODM
Advanced" comes with both Rules and Insights. There is also ODM in
the cloud, based on the Rules configuration. We hope that our support
will work with either the Insights Designer or the Rules Designer but
we have only tested it with the Rules Designer and it only covers the
languages that are provided by that Designer.

There is no free version of ODM, but some 30 day free trial programs
will allow you to try out certain versions. In order to use our
"technical" rule support, you need a binary jar available only with an
ODM Designer. To use the "designer" rule support, you need to fully
install and utilize an ODM Designer.

One possible route is to sign up for the 30 day free trial of ODM in
the Cloud (https://www.bpm.ibmcloud.com/odm/index.html). Once you are
authorized for the trial, you can log in to the cloud service and
obtain a copy of the ODM Rules Designer (downloaded and installed on
your own machine).

Once you have a Designer component installed on your machine, the next
step is to find the library called **jrules-engine.jar** and copy it
to a directory in the qcert working tree. Start by making the
directory

```
jrules2CAMP/lib
```

if it does not already exist.

If you installed the Designer using ODM in the cloud, there is a copy
of `jrules-engine.jar` in the `studio/lib` directory of the directory
where the Designer is installed. Simply copy that file into the
`jrules2CAMP/lib` directory. If you have some other version of ODM
Rule Designer or Insights Designer, find the location where the ODM
plugins are located and look for a plugin jar whose name starts with
"com.ibm.rules.engine...". Inside this jar you may find a copy of
jrules-engine.jar. Unzipping the outer jar into the `jrules2CAMP`
directory should put a copy of jrules-engine.jar in the `lib`
subdirectory. Beyond those suggestions, you are on your own.


Loading

1 comment on commit dd491f5

@jeromesimeon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closes issue #63.

Please sign in to comment.