Skip to content

Go wrapper for ecCodes - application programming interface and a set of tools for decoding and encoding messages (GRIB1/2, BUFR3/4, GTS)

License

Notifications You must be signed in to change notification settings

mtfelian/go-eccodes

 
 

Repository files navigation

go-eccodes

Go wrapper for ecCodes

Examples

https://github.com/amsokol/go-eccodes/tree/master/cmd

Build and install ecCodes C library

Build and install ecCodes C library for Linux

Install development tools

sudo apt-get install gcc make cmake libtool

Build and install zlib

source: zlib

cd ./contrib
tar -xzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
make distclean
./configure --static
make
sudo make install
cd ..
rm -r ./zlib-1.2.11
cd ..

Build and install libpng

source: libpng

cd ./contrib
tar -xzf libpng-1.6.34.tar.gz
cd libpng-1.6.34
./configure --disable-shared
make check
sudo make install
cd ..
rm -r ./libpng-1.6.34
cd ..

Build and install libaec

source: libaec

cd ./contrib
tar -xzf libaec-1.0.2.tar.gz
cd libaec-1.0.2
mkdir build
cd build
../configure --disable-shared
make check
sudo make install
cd ../..
rm -r ./libaec-1.0.2
cd ..

Build end install libjpeg

source: libjpeg

cd ./contrib
tar -xzf jpegsrc.v9b.tar.gz
cd jpeg-9b
./configure --disable-shared
make
make test
sudo make install
cd ..
rm -r ./jpeg-9b
cd ..

Build end install libopenjpeg2

source: libopenjpeg2

cd ./contrib
tar -xzf openjpeg-2.1.2.tar.gz
cd openjpeg-2.1.2
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS:bool=OFF -DBUILD_THIRDPARTY:bool=ON ..
make
sudo make install
cd ../..
rm -r ./openjpeg-2.1.2
cd ..

Build end install libjasper

source: libjasper

cd ./contrib
tar -xzf jasper-version-2.0.14.tar.gz
mkdir build
cd build
cmake -DJAS_ENABLE_SHARED=false ../jasper-version-2.0.14
make clean all
make test
sudo make install
cd ..
rm -r ./build
rm -r ./jasper-version-2.0.14
cd ..

Build end install libeccodes

source: libeccodes

cd ./contrib
tar -xzf eccodes-2.12.0-Source.tar.gz
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF \ 
    -DENABLE_NETCDF=OFF \ 
    -DENABLE_JPG=ON \ 
    -DENABLE_PNG=ON \ 
    -DENABLE_AEC=ON \ 
    -DENABLE_PYTHON=OFF \ 
    -DENABLE_FORTRAN=OFF \ 
    -DENABLE_MEMFS=ON \ 
    -DENABLE_ECCODES_THREADS=OFF \ 
    -DENABLE_ECCODES_OMP_THREADS=ON \
    -DENABLE_EXTRA_TESTS=OFF ..
make
ctest
sudo make install
cd ..
rm -r ./build
rm -r ./eccodes-2.12.0-Source
cd ..

Build and install ecCodes C library for Windows (using MSYS2/MINGW64)

Install MSYS2

source: MSYS2

  • download installer for x86_64

  • install MSYS2 following the guide

  • uncomment MSYS=winsymlinks:nativestrict everywhere to enable symbol links

Install Mingw-w64 (run MSYS2 MinGW 64-bit shell)

pacman -S --needed base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake

Install ecCodes dependencies (run MSYS2 MinGW 64-bit shell)

pacman -S mingw-w64-x86_64-zlib
curl -O http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openjpeg2-2.1.2-2-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-openjpeg2-2.1.2-2-any.pkg.tar.xz
pacman -S mingw-w64-x86_64-jasper

Build and install libaec

source: libaec

  • extract libaec-1.0.2.tar.gz to MSYS2 user home directory

  • replace original files by files from contrib\MSYS2\patches\libaec-1.0.2

  • run MSYS2 MinGW 64-bit shell and execute commands to build and install:

tar -xzf libaec-1.0.2.tar.gz
cd libaec-1.0.2
mkdir build
cd build
../configure
make check
make install

Build end install libeccodes

source: libeccodes

  • extract eccodes-2.5.0-Source.tar.gz to MSYS2 user home directory

  • replace original files by files from contrib\MSYS2\patches\eccodes-2.5.0-Source

  • run MSYS2 MinGW 64-bit shell and execute commands to build and install:

mkdir build
cd build
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64 -DDISABLE_OS_CHECK=ON -DENABLE_NETCDF=OFF -DENABLE_JPG=ON -DENABLE_PNG=ON -DENABLE_AEC=ON \
    -DENABLE_PYTHON=OFF -DENABLE_FORTRAN=OFF -DENABLE_MEMFS=OFF ../eccodes-2.5.0-Source
make
make install
  • set ECCODES_DEFINITION_PATH environment variable to <your_path>\msys64\mingw64\share\eccodes\definitions

About

Go wrapper for ecCodes - application programming interface and a set of tools for decoding and encoding messages (GRIB1/2, BUFR3/4, GTS)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 69.4%
  • CMake 15.6%
  • Go 12.8%
  • Dockerfile 1.5%
  • Makefile 0.7%