How to specify the build output directory?
Christian Thalinger
christian.thalinger at oracle.com
Mon Oct 28 20:49:07 PDT 2013
On Oct 28, 2013, at 10:17 AM, Doug Simon <doug.simon at oracle.com> wrote:
> I think this should help:
>
> $ mx buildvars
> HotSpot build variables that can be set by the -D option to "mx build":
>
> ALT_BOOTDIR
> The location of the bootstrap JDK installation (default: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home)
> ALT_OUTPUTDIR
> Build directory
> HOTSPOT_BUILD_JOBS
> Number of CPUs used by make (default: 4)
> INSTALL
> Install the built VM into the JDK? (default: y)
> ZIP_DEBUGINFO_FILES
> Install zipped debug symbols file? (default: 0)
>
> Note that these variables can be given persistent values in the file /Users/dsimon/linz/basic-graal/mx/env (see 'mx about').
>
> You then use this in combination with the --installed-jdks option. For example:
>
> $ mx --installed-jdks /tmp/alt-jdks build -DALT_OUTPUTDIR=/tmp/alt-jdks/build
>
> Christian Thalinger has some experience using --installed-jdks for (re)using a current JDK workspace so he can provide further help if the 'mx help' info for the --installed-jdks option is not clear enough.
Since Volker is a long-term HotSpot guy like me :-) he probably also likes to build Graal directly. Essentially I never use mx to build or run stuff; just to set up Eclipse.
To build a Graal-only VM just set your environment variables as you would do for a regular HotSpot build and do:
$ make productgraal
If you want to build hosted-Graal do:
$ make product INCLUDE_GRAAL=true
For my SPARC work I only built the C++ part, disabled the compilation of graal.jar:
diff -r 7f55cdeec6af make/Makefile
--- a/make/Makefile Mon Oct 28 17:03:59 2013 +0100
+++ b/make/Makefile Mon Oct 28 20:33:42 2013 -0700
@@ -282,7 +281,7 @@ generic_buildgraal: $(HOTSPOT_SCRIPT) bu
# Builds code that can be shared among different build flavors
buildshared:
- python2.7 -u $(GAMMADIR)/mxtool/mx.py build --no-native --export-dir $(SHARED_DIR)
+# python2.7 -u $(GAMMADIR)/mxtool/mx.py build --no-native --export-dir $(SHARED_DIR)
and sym-linked graal.jar into my JDK copy (in my case over NFS, but that’s just a detail). Works like a charm.
For running unit tests I created a sym-link to my JDK:
$ ls -l jdk1.8.0-ea/
total 8
lrwxr-xr-x 1 cthaling staff 41 Oct 24 11:12 product@ -> /Users/cthaling/build/graal/jdk-universal
and then you can run the test with:
$ ./mx.sh --installed-jdks . --vm server unittest
>
> -Doug
>
> On Oct 28, 2013, at 5:54 PM, Volker Simonis <volker.simonis at gmail.com> wrote:
>
>> Hi,
>>
>> I've just started to play around with Graal but I couldn't find a way
>> to specify a build output directory to the mx tool.
>>
>> While I personally don't like to clobber my source directory with
>> unknown build artifacts (and I think it is good practice not to do
>> so), not having the possibility to specify an arbitrary output
>> directory also implies practical problems. The most important is that
>> it seems to me that it is not possible to build Graal for two
>> platforms from the same repository because the output will be mixed
>> (and the settings in mx/env will be shared).
>>
>> For me, building the same repository on different platforms seems an
>> essential feature. Otherwise I'll always have to mess with
>> transplanting changesets back and forth to ensure the changes for one
>> platform don't break another one.
>>
>> So to cut a long story short - is there a possibility with the current
>> Graal build tools to redirect all the build output to a configurable
>> directory? And if not, are there any plans to provide such a feature?
>> Or am I missing something here?
>>
>> Thank you and best regards,
>> Volker
>
More information about the graal-dev
mailing list