Permalink
Browse files

Build of the Jasper and Jpeg libraries.

  • Loading branch information...
pascalhorton committed Dec 6, 2017
1 parent 4409cd4 commit d90a05596a0e084e660d5706eb6c484d5365814a
Showing with 63 additions and 62 deletions.
  1. +5 −5 appveyor.yml
  2. +3 −3 build/cmake/ASgetLibraries.cmake
  3. +54 −53 ci/appveyor/install.ps1
  4. +1 −1 src/shared_base/libs/g2clib/enc_jpeg2000.c
View
@@ -19,21 +19,21 @@ build_script:
- cd C:\projects\atmoswing
- mkdir bin
- cd bin
- cmake -G "Visual Studio 15 2017 Win64" -DBUILD_FORECASTER=ON -DwxWidgets_ROOT_DIR=D:\Development\atmoswing-libs\wxwidgets -DwxWidgets_LIB_DIR=D:\Development\atmoswing-libs\wxwidgets\lib\vc_x64_lib -DwxWidgets_CONFIGURATION=mswu ..
- cmake --build . --config relwithdebinfo > nul
- cmake -G "Visual Studio 15 2017 Win64" -DBUILD_FORECASTER=ON -DBUILD_OPTIMIZER=ON -DUSE_GUI=ON -DCMAKE_PREFIX_PATH="C:\projects\libs\wxwidgets;C:\projects\libs\curl;C:\projects\libs\netcdf;C:\projects\libs\jpeg;C:\projects\libs\jasper" -DwxWidgets_CONFIGURATION=mswu ..
- cmake --build . --config release > nul
test_script:
- cd C:\projects\atmoswing\bin\tests
- ctest -V
after_test:
- cd C:\projects\atmoswing\bin
- C:\projects\cmake\bin\cpack.exe -C relwithdebinfo -G ZIP
- C:\projects\cmake\bin\cpack.exe -C relwithdebinfo -G NSIS
- C:\projects\cmake\bin\cpack.exe -C release -G ZIP
- C:\projects\cmake\bin\cpack.exe -C release -G NSIS
- cd C:\projects\atmoswing
- copy bin\*win64.exe .\
- copy bin\*win64.zip .\
- for %%f in (*win64.exe) do (copy /b bin\RelWithDebInfo\AtmoSwing.pdb %%f.pdb)
- for %%f in (*win64.exe) do (copy /b bin\Release\AtmoSwing.pdb %%f.pdb)
artifacts:
- path: '*win64.exe'
@@ -40,10 +40,10 @@ if (UNIX)
endif (UNIX)
# NetCDF (has to be before GDAL)
mark_as_advanced(CLEAR NETCDF_INCLUDE_DIRECTORIES)
mark_as_advanced(CLEAR NETCDF_C_LIBRARY)
mark_as_advanced(CLEAR NETCDF_INCLUDE_DIR)
mark_as_advanced(CLEAR NETCDF_LIBRARY)
find_package(NetCDF 4 MODULE REQUIRED)
include_directories(${NETCDF_INCLUDE_DIRECTORIES})
include_directories(${NETCDF_INCLUDE_DIRS})
# Jasper
find_package(Jasper REQUIRED)
View
@@ -3,11 +3,14 @@ $TMP_DIR="C:\projects\tmp"
$LIB_DIR="C:\projects\libs"
$CMAKE_DIR="C:\projects\cmake"
$MSC_VER=1911
$VS_VER="Visual Studio 15 2017 Win64"
$ON_APPVEYOR=$true
$WITH_DEBUG_LIBS=$false
# Force rebuilding some libraries
$REBUILD_WX=$false
$REBUILD_JPEG=$false
$REBUILD_JASPER=$false
$REBUILD_CURL=$false
$REBUILD_PROJ=$false
$REBUILD_ZLIB=$false
@@ -18,14 +21,14 @@ $REBUILD_GDAL=$false
# Libraries URL
$CMAKE_URL="https://cmake.org/files/v3.10/cmake-3.10.0-win64-x64.zip"
$WX_URL="https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.zip"
$JPEG_URL="https://github.com/LuaDist/libjpeg/archive/master.zip"
$JASPER_URL="https://github.com/mdadams/jasper/archive/version-2.0.14.zip"
$CURL_URL="https://github.com/curl/curl/archive/curl-7_54_1.zip"
$PROJ_URL="https://github.com/OSGeo/proj.4/archive/4.9.3.zip"
$ZLIB_URL="http://www.zlib.net/zlib1211.zip"
$HDF5_URL="http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.1/src/CMake-hdf5-1.10.1.zip"
$NETCDF_URL="ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.zip"
$GDAL_URL="http://download.osgeo.org/gdal/2.2.3/gdal223.zip"
$JASPER_URL="http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/jasper-1.900.1.zip"
# Setup VS environment
# https://stackoverflow.com/questions/2124753/how-can-i-use-powershell-with-the-visual-studio-command-prompt
@@ -89,6 +92,52 @@ if(!(Test-Path -Path "$LIB_DIR\wxwidgets") -Or $REBUILD_WX) {
}
$env:WXWIN = "$LIB_DIR\wxwidgets"
# Install Jpeg
if(!(Test-Path -Path "$LIB_DIR\jpeg") -Or $REBUILD_JPEG) {
Write-Host "`nBuilding Jpeg" -ForegroundColor Yellow
cd $TMP_DIR
if(Test-Path -Path "$LIB_DIR\jpeg") {
Remove-Item "$LIB_DIR\jpeg" -Force -Recurse
}
mkdir "$LIB_DIR\jpeg" > $null
if ($ON_APPVEYOR) {
appveyor DownloadFile $JPEG_URL -FileName jpeg.zip > $null
} else {
Invoke-WebRequest -Uri $JPEG_URL -OutFile jpeg.zip
}
7z x jpeg.zip -o"$TMP_DIR" > $null
move "$TMP_DIR\libjpeg-*" "$TMP_DIR\jpeg"
cd "$TMP_DIR\jpeg"
mkdir bld > $null
cd bld
cmake .. -G"$VS_VER" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\jpeg" -DBUILD_STATIC=ON -DBUILD_EXECUTABLES=OFF > $null
cmake --build . --config release > $null
cmake --build . --config release --target INSTALL > $null
}
# Install Jasper
if(!(Test-Path -Path "$LIB_DIR\jasper") -Or $REBUILD_JASPER) {
Write-Host "`nBuilding Jasper" -ForegroundColor Yellow
cd $TMP_DIR
if(Test-Path -Path "$LIB_DIR\jasper") {
Remove-Item "$LIB_DIR\jasper" -Force -Recurse
}
mkdir "$LIB_DIR\jasper" > $null
if ($ON_APPVEYOR) {
appveyor DownloadFile $JASPER_URL -FileName jasper.zip > $null
} else {
Invoke-WebRequest -Uri $JASPER_URL -OutFile jasper.zip
}
7z x jasper.zip -o"$TMP_DIR" > $null
move "$TMP_DIR\jasper-*" "$TMP_DIR\jasper"
cd "$TMP_DIR\jasper"
mkdir bld > $null
cd bld
cmake .. -G"$VS_VER" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\jasper" -DCMAKE_BUILD_TYPE=Release -DJAS_ENABLE_SHARED=OFF -DJAS_ENABLE_LIBJPEG=ON -DJAS_ENABLE_PROGRAMS=OFF -DCMAKE_INCLUDE_PATH="$LIB_DIR\jpeg\include" -DCMAKE_LIBRARY_PATH="$LIB_DIR\jpeg\lib" > $null
cmake --build . --config release > $null
cmake --build . --config release --target INSTALL > $null
}
# Install curl
if(!(Test-Path -Path "$LIB_DIR\curl") -Or $REBUILD_CURL) {
Write-Host "`nBuilding curl" -ForegroundColor Yellow
@@ -149,7 +198,7 @@ if(!(Test-Path -Path "$LIB_DIR\zlib") -Or $REBUILD_ZLIB) {
cd "$TMP_DIR\zlib"
mkdir bld > $null
cd bld
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\zlib" > $null
cmake .. -G"$VS_VER" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\zlib" > $null
cmake --build . --config release > $null
cmake --build . --config release --target INSTALL > $null
}
@@ -174,7 +223,7 @@ if(!(Test-Path -Path "$LIB_DIR\hdf5") -Or $REBUILD_HDF5) {
cd "hdf5"
mkdir bld > $null
cd bld
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\hdf5" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DZLIB_LIBRARIES="$LIB_DIR/zlib/lib/zlib.lib" -DZLIB_INCLUDE_DIRS="$LIB_DIR/zlib/include" > $null
cmake .. -G"$VS_VER" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\hdf5" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DZLIB_LIBRARIES="$LIB_DIR/zlib/lib/zlib.lib" -DZLIB_INCLUDE_DIRS="$LIB_DIR/zlib/include" > $null
cmake --build . --config release > $null
cmake --build . --config release --target INSTALL > $null
}
@@ -198,7 +247,7 @@ if(!(Test-Path -Path "$LIB_DIR\netcdf") -Or $REBUILD_NETCDF) {
mkdir bld > $null
cd bld
$LIB_DIR_REV=$LIB_DIR -replace '\\','/'
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="$LIB_DIR_REV/netcdf" -DCMAKE_BUILD_TYPE=Release -DENABLE_NETCDF_4=ON -DENABLE_DAP=OFF -DUSE_DAP=OFF -DHDF5_DIR="$LIB_DIR_REV/hdf5/cmake" -DHDF5_C_LIBRARY="$LIB_DIR_REV/hdf5/lib/libhdf5.lib" -DHDF5_HL_LIBRARY="$LIB_DIR_REV/hdf5/lib/libhdf5_hl.lib" -DHDF5_INCLUDE_DIR="$LIB_DIR_REV/hdf5/include" -DZLIB_INCLUDE_DIR="$LIB_DIR_REV/zlib/include" -DZLIB_LIBRARY="$LIB_DIR_REV/zlib/lib/zlib.lib" -DCMAKE_INCLUDE_PATH="$LIB_DIR_REV/hdf5/include" > $null
cmake .. -G"$VS_VER" -DCMAKE_INSTALL_PREFIX="$LIB_DIR_REV/netcdf" -DCMAKE_BUILD_TYPE=Release -DENABLE_NETCDF_4=ON -DENABLE_DAP=OFF -DUSE_DAP=OFF -DHDF5_DIR="$LIB_DIR_REV/hdf5/cmake" -DHDF5_C_LIBRARY="$LIB_DIR_REV/hdf5/lib/libhdf5.lib" -DHDF5_HL_LIBRARY="$LIB_DIR_REV/hdf5/lib/libhdf5_hl.lib" -DHDF5_INCLUDE_DIR="$LIB_DIR_REV/hdf5/include" -DZLIB_INCLUDE_DIR="$LIB_DIR_REV/zlib/include" -DZLIB_LIBRARY="$LIB_DIR_REV/zlib/lib/zlib.lib" -DCMAKE_INCLUDE_PATH="$LIB_DIR_REV/hdf5/include" > $null
cmake --build . --config release > $null
cmake --build . --config release --target INSTALL > $null
}
@@ -224,51 +273,3 @@ if(!(Test-Path -Path "$LIB_DIR\gdal") -Or $REBUILD_GDAL) {
nmake -f makefile.vc MSVC_VER=$MSC_VER WIN64=1 GDAL_HOME="$LIB_DIR\gdal" CURL_DIR="$LIB_DIR\curl" CURL_INC="-I$LIB_DIR_REV/curl/include" CURL_LIB="$LIB_DIR_REV/curl/lib/libcurl.lib wsock32.lib wldap32.lib winmm.lib" CURL_CFLAGS=-DCURL_STATICLIB install > $null
nmake -f makefile.vc MSVC_VER=$MSC_VER WIN64=1 GDAL_HOME="$LIB_DIR\gdal" CURL_DIR="$LIB_DIR\curl" CURL_INC="-I$LIB_DIR_REV/curl/include" CURL_LIB="$LIB_DIR_REV/curl/lib/libcurl.lib wsock32.lib wldap32.lib winmm.lib" CURL_CFLAGS=-DCURL_STATICLIB devinstall > $null
}
# Install Jasper
if(!(Test-Path -Path "$LIB_DIR\jasper") -Or $REBUILD_PROJ) {
Write-Host "`nBuilding Jasper" -ForegroundColor Yellow
cd $TMP_DIR
if(Test-Path -Path "$LIB_DIR\jasper") {
Remove-Item "$LIB_DIR\jasper" -Force -Recurse
}
mkdir "$LIB_DIR\jasper" > $null
if ($ON_APPVEYOR) {
appveyor DownloadFile $JASPER_URL -FileName jasper.zip > $null
} else {
Invoke-WebRequest -Uri $JASPER_URL -OutFile jasper.zip
}
7z x jasper.zip -o"$TMP_DIR" > $null
move "$TMP_DIR\jasper-*" "$TMP_DIR\jasper"
cd "$TMP_DIR\jasper\src\msvc"
msdev jasper.dsp /MAKE "libjasper – Win32 Debug" /REBUILD
nmake -f Makefile.in INSTDIR="$LIB_DIR\jasper" > $null
nmake -f makefile.vc INSTDIR="$LIB_DIR\jasper" install-all > $null
}
# Install ecCodes (DOES NOT WORK)
if(!(Test-Path -Path "$LIB_DIR\eccodes") -Or $REBUILD_ECCODES) {
Write-Host "`nBuilding ecCodes" -ForegroundColor Yellow
cd $TMP_DIR
if(Test-Path -Path "$LIB_DIR\eccodes") {
Remove-Item "$LIB_DIR\eccodes" -Force -Recurse
}
mkdir "$LIB_DIR\eccodes" > $null
if ($ON_APPVEYOR) {
appveyor DownloadFile $ECCODES_URL -FileName eccodes.tar.gz > $null
} else {
Invoke-WebRequest -Uri $ECCODES_URL -OutFile eccodes.tar.gz
}
7z x eccodes.tar.gz -o"$TMP_DIR" > $null
7z x eccodes.tar -o"$TMP_DIR" > $null
move "$TMP_DIR\eccodes-*" "$TMP_DIR\eccodes"
cd "$TMP_DIR\eccodes"
mkdir bld > $null
cd bld
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="$LIB_DIR\eccodes" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DDISABLE_OS_CHECK=ON -DENABLE_FORTRAN=OFF -DENABLE_EXTRA_TESTS=OFF > $null
cmake --build . --config release --target eccodes > $null
}
@@ -121,7 +121,7 @@ int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,g2int nbits,
image.clrspc_=JAS_CLRSPC_SGRAY; /* grayscale Image */
image.cmprof_=0;
#endif
image.inmem_=1;
//image.inmem_=1;
cmpt.tlx_=0;
cmpt.tly_=0;

0 comments on commit d90a055

Please sign in to comment.