Project

General

Profile

Development Environment Setup and Building FWD on Windows

This page provides information on how to setup development environment and how to build FWD on Windows. It is an amendment to the pages Building FWD From Source and Development_Environment_Setup_and_Building_FWD_on_Linux. We recommend to read both and apply the information from this page on top.

The minimum required versions are Windows XP 32-bit Professonal SP3 and Windows XP 64-bit Professional SP2 for 32 and 64 bit modes respectively.

Note that in the pages Building FWD From Source and Development_Environment_Setup_and_Building_FWD_on_Linux we use forward slash ('/') as the file path separator. On Windows systems we recommend to always use backslash ('\'). Thus please watch your file paths and modify accordingly.

Hardware Requirements

Make sure your system matches the recommended minimums in System Requirements.

Software Requirements

Requirement Version Notes
Java Development Kit (JDK) 8.0 or later The only option for Windows is Oracle JDK.
GNU Compiler Collection (GCC) C compiler and binutils 4.8.1 or later The native portions of FWD must be built using gcc, make and related tools. The MinGW tools package for Windows is known as stable to build native modules in (GCC) coding standards. The binary packages for 32-bit and 64-bit are available to download from the Web.
libffi n/a The library libffi*.lib is required to build FWD native modules for Windows. Current project implementation requires the libffi-6.lib to be installed in (GCC) compiler libraries directory. Libffi is available on the Web as a sources. After sources downloading it is required to compile them with MinGW for required target. It is possible to build 64-bit binaries on 32-bit Windows.
NCURSES Development Headers n/a NCURSES library is not required on Windows.

Installing JDK

After installing the Java Development Kit using the standard procedure, make sure the parent directory of java.exe is defined in the PATH system variable.

Installing MinGW Compiler and Utils

MinGW is the recommended build tools suite for building FWD native code on Windows. It is an open source Windows port of gcc and the other common build tools that exist on UNIX/Linux (the linker, make...) and is packaged in a manner that allows full WIN32 development. As this is not using the Cygwin compatibility environment at runtime, the native FWD code will link to the msvcrt library to get the basic C runtime routines.

To install:
  1. Download and unpack one of the MinGW archives, mingw-w32-bin-i686-2013MMDD.7z or mingw-w64-bin-x86_64-2013MMDD.7z, to \mingw32 or \mingw64. See the download links below.
  2. Include the appropriate \mingwXX\bin to the PATH system variable, i.e. C:\mingw64\bin or C:\mingw32\bin, depending on Windows architecture.
  3. Ensure java server library jvm.lib is copied into (GCC):
    • 32-bit: copy %JAVA_HOME%\lib\jvm.lib \mingw32\i686-w64-mingw32\lib\
    • 64-bit: copy %JAVA_HOME%\lib\jvm.lib \mingw64\x86_64-w64-mingw32\lib\

The precompiled binaries can be found at MinGW precompiled page or at https://proj.goldencode.com/downloads/mingw/mingw32_4.9.0_20140425.zip for 32-bit binary or https://proj.goldencode.com/downloads/mingw/mingw64_4.9.0_20140425.zip for 64-bit binary.

Building and Installing libffi

On Windows, the library needs to be built from the source. An installed and working MinGW (32-bit or 64-bit, depending on Windows OS) is required. Follow these steps to build and install libffi:

  1. Download MSYS(32-bit) from sourceforge msys page and unpack it in a desired location. No special installation required.
  2. Take the libffi sources from sourceforge libffi page and unpack to desired location. The source package can also de downloaded from here: https://proj.goldencode.com/downloads/
  3. Run MSYS shell - msys.bat from \msys directory. Inside opened MSYS shell:
    • Go to the libffi sources, for example: cd c:\libffi-3.2.1
    • Prepare target build config:
      32 bit: sh ./configure
      or
      64 bit: sh ./configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32

      The explicit architecture specification is mandatory for 64-bit Windows (and installed 64-bit MinGW). The reason is the MSYS is 32-bit package and by default can not build valid configuration for 64-bit compiler.
    • Run make
  4. After successful build, these binaries and include files are created:
    32 bit: libffi-(root)/i686-pc-mingw32/.libs and libffi-(root)/i686-pc-mingw32/include
    64 bit: libffi-(root)/x86_64-w64-mingw32/.libs and libffi-(root)/x86_64-w64-mingw32/include
  5. Copy headers, libraries to the corresponding MinGW folders and dlls to the system dll directory (the directory where Windows stores commonly used dll, usually %windir%\system32\). The include files and libraries will be used in FWD native code compilation and the dlls are used at runtime to load P2J.DLL code:
    • Include files
      32-bit: copy libffi-(root)\i686-pc-mingw32\include\*.h \mingw32\i686-w64-mingw32\include\
      64-bit: copy libffi-(root)\x86_64-w64-mingw32\include\*.h \mingw64\x86_64-w64-mingw32\include\
    • Link libraries
      32-bit: copy libffi-(root)\i686-pc-mingw32\.libs\libffi*.*a* \mingw32\i686-w64-mingw32\lib\
      64-bit: copy libffi-(root)\x86_64-w64-mingw32\.libs\libffi*.*a* \mingw64\x86_64-w64-mingw32\lib\
    • DLL Runtime library
      32-bit: copy libffi-(root)\i686-pc-mingw32\.libs\libffi*.dll %windir%\system32\
      64-bit: copy libffi-(root)\x86_64-w64-mingw32\.libs\libffi*.dll %windir%\system32\

There are already prebuilt binaries for both 32-bit and 64 bit systems. It is possible to download them from here: https://proj.goldencode.com/downloads/. The packages already have the proper i686-pc-mingw32 and x86_64-w64-mingw32 directories to use.

Patch NCURSES

This section is not required for building on Windows.

Fix TERMINFO Definitions

This section is not required for building on Windows.

Install FWD Collation Services for H2 Database

There are no Windows specific steps except the Java home folder will differ on Windows. Its default location is C:\Program Files\Java\jre1.8.0_REVISION.

PostgreSQL server

TODO: It is required to understand if we have good working environment for PostgreSQL server.

H2 server

There are no Windows specific steps.

Building FWD on Windows.

Introduction

There are no Windows specific steps.

Install FWD Project Code

There are no Windows specific steps.

Satisfying 3rd Party Software Dependencies

There are no Windows specific steps.

Build FWD

Use gradlew.bat Gradle Wrapper to build on Windows:

cd %P2J%
gradlew.bat all

64-bit build and cross-compile builds

The Windows specific steps are already included in Building FWD From Source

Available Build Tasks

There are no Windows specific steps.

Artifacts Versioning

There are no Windows specific steps.

IDE integration

There are no Windows specific steps.

Test Conversion

Follow the instructions in Development Environment Setup and Building FWD on Linux and replace $P2J with %P2J%, server.sh with server.cmd, and client.sh with client.cmd. Also on Windows there is no simple replacement for the tail Linux command. Possible alternative is using PowerShell with Get-Content myTestLog.log –Wait.


© 2004-2017 Golden Code Development Corporation. ALL RIGHTS RESERVED.