Skip to content
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

Add detailed instructions for building on Windows #521

Merged
merged 1 commit into from
Nov 14, 2017

Conversation

SueChaplain
Copy link
Contributor

Adding the detailed build instructions for creating
an OpenjDK V9 with OpenJ9 binary for Windows.

Created as a completely separate section in the existing
build instructions. No attempt to merge instructions
for platforms yet.

Work supports issue at
ibmruntimes/openj9-openjdk-jdk9#18

Issue #18

Signed-off-by: Sue Chaplain sue_chaplain@uk.ibm.com

You must install a number of software dependencies to create a suitable build environment on your system.

- [Cygwin](https://cygwin.com/install.html), which provides a Unix-style command line interface.
- [Microsoft Visual Studio 2013](https://msdn.microsoft.com/en-us/library/dd831853(v=vs.120)), which is the same compiler level used by OpenJDK. Later levels of this compiler are not supported.
Copy link
Member

Choose a reason for hiding this comment

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

@DanHeidinga
Copy link
Member

Has someone followed these instructions and been able successfully build on windows?

I've started down that path but am blocked on getting visual studio to install.

@SueChaplain
Copy link
Contributor Author

I modified the VisualStudio link to the one provided by @DanHeidinga (https://my.visualstudio.com/Downloads?q=visual%20studio%202013&wt.mc_id=o~msft~vscom~older-downloads)

Q from Dan: Has someone followed these instructions and been able successfully build on windows?

  • @vsebe reviewed the instructions a couple of days ago but we've not had someone independently test. Same goes for the AIX process (although AIX systems are a bit harder to come by).

@DanHeidinga
Copy link
Member

@SueChaplain I wasn't able to get the visual studio to install from that link due to errors related to "windows program compatibility". There's a direct link to a download in the Windows.yml file that appears to work. @vsebe Can that link be shared?

@andrewcraik
Copy link
Contributor

As an outsider to all this, but someone who has used VS - are there any concerns about VS incompatibility or making sure the right VS is picked up that need to be accounted for in the instructions?

@vsebe
Copy link
Contributor

vsebe commented Nov 7, 2017

@SueChaplain - VS 2013 download link: https://go.microsoft.com/fwlink/?LinkId=532495
It can be downloaded via a web browser or wget (wget https://go.microsoft.com/fwlink/?LinkId=532495 -O c:\temp\vs2013.exe).
Run the vs2013.exe to launch the installer. After the installation, check if the following environment variables are set: PATH, INCLUDE, LIB, VCINSTALLDIR:

PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow:C:\Program Files (x86)\MSBuild\12.0\bin\amd64:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64:C:\Windows\Microsoft.NET\Framework64\v4.0.30319:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools:C:\Program Files (x86)\HTML Help Workshop:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools:C:\Program Files (x86)\Windows Kits\8.1\bin\x64:C:\Program Files (x86)\Windows Kits\8.1\bin\x86:C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64";%PATH%
INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;"
LIB="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;; "
VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
WindowsSdkDir="C:\Program Files (x86)\Windows Kits\8.1"

For more details see VS documentation: https://msdn.microsoft.com/en-us/library/f2ccy3wt(v=vs.120).aspx

The ansible playbooks are available in the infra-can repository. For windows requirements see Windows.yml.

@SueChaplain
Copy link
Contributor Author

Thanks @vsebe. A few questions please:

  1. Env vars: I see an extra envvar in the codeblock for WindowsSdkDir. I don't see any mention of this in the MS article. Is this something you inadvertently copied, or is it really required?
  2. The ansible playbook looks to contain many more pre-reqs than I have in these instructions. I guess some, like ANT, are required for that build process, but I'm wondering whether there are others that I should also be including?
  • Cygwin seems to require quite a few extra packages. Should I expand the Cygwin section to ensure people get all the ones they need? Are they all needed? And also add this to the PATH?
  • FF
  • Strawberry perl

If you can give me a few more pointers I'll try and build it myself.
Thanks

@vsebe
Copy link
Contributor

vsebe commented Nov 8, 2017

@SueChaplain

  1. dispense of WindowsSdkDir
  2. ant is required for testing only - ignore
  • cygwin requires devel category and only zip and unzip to build the jdk.

Should I expand the Cygwin section ... Mentioning the required packages and referring to the cygwin documentation should be enough.

No need to add cygwin to the path.

  • freemarker and freetype are required
  • Strawberry perl is not required for build (only for testing) - ignore

@SueChaplain
Copy link
Contributor Author

Thanks @vsebe - will update the doc.
BTW - think I spotted a typo in the ansible file. The var Cygwin_CATEGORIES is later called as {{ Cygwin_CATEGORIE }} in the install section.

@vsebe
Copy link
Contributor

vsebe commented Nov 8, 2017

@SueChaplain nice catch, I'll fix it thanks.

@SueChaplain
Copy link
Contributor Author

I've finished testing the build on a fresh Windows 10 install. A few observations:

  1. Cygwin doesn't get all the dependencies but does report which one is missing, complete with URL. I was able to wget that too. I updated the instructions to say "Install any further package dependencies that are identified by the installer."
  2. When VS is downloaded the file permissions need amending to add u+x. Added a bullet for this.
  3. When freemarker is untarred with the command specified, freemarker.jar is actually in /cygdrive/c/temp/freemarker/lib ... so I amended the configure step accordingly.

Compile time was long, but the machine didn't have a huge amount of resources.
@vsebe Any concerns?
@DanHeidinga I think this is good to merge now.

@vsebe
Copy link
Contributor

vsebe commented Nov 9, 2017

@SueChaplain, as the MS Visual Studio environment variables are not intuitive and there isn't a straight forward way to set them, I handled the set up in the code (this should simplify the instructions).
Please remove all references to the environment variables, also remove the entire section regarding PATH, LIB, INCLUDE and VCINSTALLD.

@SueChaplain
Copy link
Contributor Author

@vsebe - VS install section updated to remove all content/references to the env variables. Are there any further changes required please?

@vsebe
Copy link
Contributor

vsebe commented Nov 13, 2017

No other changes, looks good to me. Thank you, @SueChaplain !

@DanHeidinga
Copy link
Member

I'm following the directions on a Windows VM and should be able to report back by end of day.

@DanHeidinga DanHeidinga self-assigned this Nov 13, 2017

- To unpack the Freemarker and Freetype compressed files, run:
```
tar --one-top-level=/cygdrive/c/temp/freemarker --strip-components=1 -xzf freemarker-2.3.8.tar.gz
Copy link
Member

Choose a reason for hiding this comment

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

Is this tar command intended to put the freemarker.jar into the /cygdrive/c/temp? It doesn't seem to work and is different than the tar commands for the other platforms.

AIX: tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2 \
linux: tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2

Either this or the configure command below need to be updated

Copy link
Contributor

@vsebe vsebe Nov 13, 2017

Choose a reason for hiding this comment

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

To unpack freemarker:
tar -xzf freemarker-2.3.8.tar.gz freemarker-2.3.8/lib/freemarker.jar --strip=2

If we want the commands to be identical on all platforms than:

  • to download freemarker:
    wget https://sourceforge.net/projects/freemarker/files/freemarker/2.3.8/freemarker-2.3.8.tar.gz/download -O freemarker.tgz
    @SueChaplain note the output file -O freemarker.tgz

  • to unpack:
    tar -xzf freemarker.tgz freemarker-2.3.8/lib/freemarker.jar --strip=2

Copy link
Member

Choose a reason for hiding this comment

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

Where possible, the instructions should be the same across all platforms. Longer term, it makes sense to have a single set of instructions with only the platform setup being different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the wget command for freemarker, modified the tar command to put freemarker.jar in the root, and reverted the change I made to configure that previously fixed the path.

It's a shame that we still have differences in the configure between platforms, but I agree that we should try and create platform specific sections for preparing your build environment and try to merge the other sections. Would be nice to see ARM and z/OS before doing this, but not sure what progress is being made for these.

@DanHeidinga
Copy link
Member

Once the tar command is fixed, this will be ready to merge. I've successfully built a windows JDK using the instructions. Nice work @SueChaplain & @vsebe!

Adding the detailed build instructions for creating
an OpenjDK V9 with OpenJ9 binary for Windows.

Created as a completely separate section in the existing
build instructions. No attempt to merge instructions
for platforms yet.

[ci skip]

Work supports issue at
ibmruntimes/openj9-openjdk-jdk9#18

Issue eclipse-openj9#18

Signed-off-by: Sue Chaplain <sue_chaplain@uk.ibm.com>
@DanHeidinga
Copy link
Member

Jenkins line endings check

@DanHeidinga DanHeidinga merged commit 6bee4fb into eclipse-openj9:master Nov 14, 2017
@SueChaplain SueChaplain deleted the addv9windows branch April 30, 2018 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants