Issue #243 - standardized the Windows build of jep and gridslice. Both can be built from within Visual C++ 2008 or headless via a cmd console.

Former-commit-id: 4faf9831ed [formerly 67562b0674 [formerly de3970ed2c199ca0c2a6bdf9a7eaa3d0d0069122]]
Former-commit-id: 67562b0674
Former-commit-id: c78e988d55
This commit is contained in:
Bryan Kowal 2012-02-13 13:57:10 -06:00
parent 2f80fdcd73
commit 02c48be369
2 changed files with 92 additions and 14 deletions

View file

@ -2,8 +2,6 @@
REM This script will compile a Windows version of the gridslice library.
REM In order to compile the gridslice library, you will need to have
REM Microsoft Visual C++ 2008 installed and the AWIPS II Runtime Environment.
REM This script assumes that Microsoft Visual Studio has been installed in the
REM standard location - in the Program Files directory.
REM
REM This script should work on both a 32-bit and a 64-bit Windows 7
REM installation.
@ -11,9 +9,8 @@ REM installation.
SET CONTAINING_DIR=%~dp0
REM Determine what our architecture is.
SET REG_EXE=
SET PROGRAM_FILES_DIR=
REM Determine what our architecture is.
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
GOTO OS_64_BIT
) ELSE (
@ -21,41 +18,53 @@ IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
GOTO OS_32_BIT
) ELSE (
echo "ERROR: Unrecognized Architecture."
PAUSE
PAUSE && EXIT 1
)
)
REM Set the Program Files location based on the architecture.
:OS_32_BIT
SET PROGRAM_FILES_DIR=%ProgramFiles%
SET REG_EXE=C:\Windows\System32\reg.exe
GOTO ARCH_KNOWN
:OS_64_BIT
SET PROGRAM_FILES_DIR=%ProgramFiles(x86)%
SET REG_EXE=C:\Windows\SysWOW64\reg.exe
GOTO ARCH_KNOWN
:ARCH_KNOWN
REM Determine where AWIPS II Python has been installed.
SET MVC_VERSION=9.0
REM TODO: Update so that we could also potentially use the full version of
REM Visual Studio C++ 2008 if it is available.
SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
SET MVC_REG="HKLM\Software\Microsoft\VCExpress\%MVC_VERSION%\Setup\VC"
%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
IF ERRORLEVEL 1 (
echo ENVIRONMENT ERROR - Unable to find AWIPS II Python.
PAUSE && EXIT 1
)
%REG_EXE% QUERY %MVC_REG% /v ProductDir > NUL 2>&1
IF ERRORLEVEL 1 (
echo ENVIRONMENT ERROR - Unable to find Visual C++ 2008 Express.
PAUSE && EXIT 1
)
REM Determine where AWIPS II Python has been installed.
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory'
) DO (
SET PythonInstallDirectory=%%B
)
REM Visual Studio 2008 is Version 9.0 of Microsoft Visual Studio.
SET MVS_VERSION=Microsoft Visual Studio 9.0
REM Determine where Microsoft Visual C++ 2008 Express has been installed.
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %MVC_REG% /v ProductDir'
) DO (
SET VCPlusPlusProductDir=%%B
)
REM Use the MS Visual Studion vcvarsall.bat utility to prepare
REM the environment for this build.
REM Until further notice, we assume the build is 32-bit.
cd "%PROGRAM_FILES_DIR%\%MVS_VERSION%\VC"
cd "%VCPlusPlusProductDir%"
CALL vcvarsall.bat x86
IF NOT ERRORLEVEL 0 (
echo ERROR: Unable to prepare the environment.
@ -72,7 +81,7 @@ cl.exe /LD "%CONTAINING_DIR%..\sliceConvert.c" ^
/link/out:gridslice.pyd /EXPORT:initgridslice
if ERRORLEVEL 1 (
echo ERROR: The gridslice compile has failed.
PAUSE
PAUSE && EXIT 1
)
REM Move the build artifacts to the build directory.
@ -87,4 +96,4 @@ MOVE /Y "%CONTAINING_DIR%gridslice*" ^
echo.
echo.
echo The gridslice compile was successful.
PAUSE
PAUSE

View file

@ -0,0 +1,69 @@
@echo OFF
REM This script will compile a Windows version of the jep library.
REM In order to compile the jep library, you will need to have
REM MSBuild 4.0 installed and the AWIPS II Runtime Environment.
REM
REM This script should work on both a 32-bit and a 64-bit Windows 7
REM installation.
SET CONTAINING_DIR=%~dp0
SET REG_EXE=
REM Determine what our architecture is.
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
GOTO OS_64_BIT
) ELSE (
IF "%PROCESSOR_ARCHITECTURE%" == "x86" (
GOTO OS_32_BIT
) ELSE (
echo "ERROR: Unrecognized Architecture."
PAUSE && EXIT 1
)
)
:OS_32_BIT
SET REG_EXE=C:\Windows\System32\reg.exe
:OS_64_BIT
SET REG_EXE=C:\Windows\SysWOW64\reg.exe
:ARCH_KNOWN
REM Lookup the location of MSBuild.
SET MSBUILD_VERSION=4.0
SET MSBUILD_REG="HKLM\Software\Microsoft\MSBuild\ToolsVersions\%MSBUILD_VERSION%"
REM Verify that MSBuild is installed.
%REG_EXE% QUERY %MSBUILD_REG% /v MSBuildToolsPath > NUL 2>&1
IF ERRORLEVEL 1 (
echo ENVIRONMENT ERROR - Unable to find MSBuild %MSBUILD_VERSION%.
PAUSE && EXIT 1
)
FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %MSBUILD_REG% /v MSBuildToolsPath') DO (
SET MSBuildToolsPath=%%B)
pushd . > NUL 2>&1
cd %CONTAINING_DIR%
%MSBuildToolsPath%MSBuild.exe ^
/p:Configuration=py27-java16 ^
/p:Platform=win32 ^
jep.sln
if ERRORLEVEL 1 (
echo ERROR: The jep compile has failed.
PAUSE && EXIT 1
)
REM Move the build artifacts to the build directory.
IF NOT EXIST "%CONTAINING_DIR%build" (
MKDIR "%CONTAINING_DIR%build"
)
MOVE /Y "%CONTAINING_DIR%Active\jep.dll" ^
"%CONTAINING_DIR%build"
popd > NUL 2>&1
echo.
echo.
echo The jep compile was successful.
PAUSE