fimex:install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fimex:install [2010-05-07 14:01:26]
heikok
fimex:install [2022-05-31 09:29:32] (current)
Line 1: Line 1:
 ====== Installation ====== ====== Installation ======
 +
 +===== Pre-built Packages =====
 +
 +If you are lucky to run one of the following operating systems, you can install fimex from a package repository, please check the [[fimex:download|download]] page.
  
 ===== Dependencies ===== ===== Dependencies =====
  
 Fimex requires at least the following libraries to be installed for compilation: Fimex requires at least the following libraries to be installed for compilation:
-  * c99/c++ compiler+  * c99/c++11 compiler
   * [[http://www.xmlsoft.org|libxml2]] >= 2.5.0   * [[http://www.xmlsoft.org|libxml2]] >= 2.5.0
-  * [[http://www.boost.org/|boost library]] >= 1.33 
   * [[http://proj.maptools.org|proj-4]] >= 4.4.9   * [[http://proj.maptools.org|proj-4]] >= 4.4.9
-  * [[http://www.unidata.ucar.edu/packages/udunits/|udunits]] 1.12.x or >= 2.1.11+  * [[http://www.unidata.ucar.edu/packages/udunits/|udunits]] >= 2.1.
 +  * [[https://github.com/metno/mi-cpptest|mi-cpptest]] 
 +  * [[https://github.com/metno/mi-programoptions|mi-programoptions]] 
 +  * [[https://github.com/pybind/pybind11|pybind11]]
   
-To configure the different file formats it requires:+To configure the different file formats or features it requires:
   * [[http://www.unidata.ucar.edu/software/netcdf/|NetCDF]] (netcdf-3 > 3.6)   * [[http://www.unidata.ucar.edu/software/netcdf/|NetCDF]] (netcdf-3 > 3.6)
-  * Felt (libmi or libfelt (bundled) +  * [[https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home|ecCodes]] 
-  * [[http://www.ecmwf.int/products/data/software/grib_api.html|grib_api]] (> 1.4)+  * [[http://log4cpp.sourceforge.net/|Log4cpp]]: advanced logging library 
 +  * [[http://www.openmp.org/|OpenMP-3.0]] enable compiler: Parallelization 
 +  * [[http://en.wikibooks.org/wiki/Fortran_2003|Fortran-2003]] compiler (tested with gfortran-4.6 and ifortran-12)
  
 ===== Build ===== ===== Build =====
  
-The installation follows the usual autoconf rules, see 'INSTALL' for +See [[https://github.com/metno/fimex/blob/master/README.md|README.md]] for build instructions.
-extensive information. Since Fimex makes some floating-point calculations +
-in large loops, it is advisable to switch on SIMD/SSE operations in your +
-compiler. On a Xeon machine with a x386 machine and gcc, I use the  +
-following flags (those are default for x86-64) (see [[http://heikok.blogspot.com/2008/08/microbenchmark-of-sse-in-c-revisited.html|microbenchmark of sse]] for more information)+
  
-Since fimex 0.16, with included felt-c++ library:+==== Optimizations with gcc ==== 
 + 
 +The following optimizations have been tried with gcc 4.4 and kd-tree interpolation. 
 + 
 +  * **-O2** general optimizations like loop-unrolling/inline  
 +  * **-mfpmath=sse -msse2** on i386 computers, use math from sse-unit. The build-in FPU is not IEEE conform and performs very slowly (> factor 2) when calculating sqrt(nan). This is already the default on i386-64. 
 +  * //-ftree-vectorize -fno-math-errno// gives tiny performance gain through auto-vecotrization. //-fno-math-errno// is required to enable vectorization of intrinsic functions like //sqrt//. 
 +  * //-fno-trapping-math -fno-signaling-nans// fimex does not make use of trapping-math or signaling-nans, so this option can safely be switched onUnfortunatelythis does not give any performance gain. 
 +  * //-O3// gives no visible performance gain. This should be tested again with newer compiler-versions. 
 +  * //-fprofile-generate/-fprofile-use// gives a performance gain of ~4%. Since it complicates the build, it is not used by default. 
 + 
 +==== Parallelization (OpenMP) ==== 
 + 
 +Fimex can be build with OpenMP parallelization support with the //configure// option //--enable-openmp//. The following operations are parallelized: 
 + 
 +  * interpolation: fill2d (good parallelization on z-axis) 
 +  * interpolation with coord_nearestneighbor (good parallelization in startup) 
 + 
 +===== Test ===== 
 + 
 +  * Download the file with testdata: {{:fimex:flth00.dat.gz|}} 
 +  * Put this file into the test-catalogue 
 +  * gunzip the file 
 +  * run ''make test'' (it will work even without the testdata and skip a lot of tests) 
 + 
 +===== Known Problems ===== 
 + 
 +==== udunits1 and FMRC ==== 
 + 
 +udunits1 does not differ between a date and a timespan, e.g. 
 <code> <code>
-CFLAGS='-O2 -mfpmath=sse -msse2' CXXFLAGS='-O2 -mfpmath=sse -msse2' ./configure --with-NetCDF-lib-dir=/usr/lib/netcdf--with-NetCDF-include-dir=/usr/include/netcdf-+./udunits 
-make +You have: hours 
-make check +You want: hours since 2010-01-01 00:00:00 
-make install+    <hours since 2010-01-01 00:00:00> <hours>*1 78888 
 +    <hours since 2010-01-01 00:00:00> <hours>/78888
 </code> </code>
  
-Before fimex 0.16:+Therefore, data with two time-axis, e.g. in [[http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/FmrcAggregation.html|ForecastModelRuntimeConvention]] cannot get read proberly. This results in a 
 +test-failure:
 <code> <code>
-export milib_CFLAGS=-I/disk1/metno/local/include +unknown location:0: fatal error in "test_cs_slicebuilder_reftime": unknown type 
-export milib_LIBS='-L/disk1/metno/local/lib -lmic -lmi -lg2c' +testCoordinateSystemSliceBuilder.cc:69: last checkpoint 
-CFLAGS='-O2 -mfpmath=sse -msse2' CXXFLAGS='-O2 -mfpmath=sse -msse2' ./configure --with-NetCDF-lib-dir=/usr/lib/netcdf-3 -with-NetCDF-include-dir=/usr/include/netcdf-3 + 
-make +*** 1 failure detected in test suite "Master Test Suite" 
-make check +FAIL: testCoordinateSystemSliceBuilder
-make install+
 </code> </code>
  
-In case of compilation against the netcdf4 library with hdf5 supportadditional libraries needed by netcdf4 need to be added manually in LDFLAGSe.g.:+If you don't intend to use FMRCyou can ignore this error, otherwise, you should upgrade to udunits2. 
 + 
 + 
 +==== udunits1 and udunits2 ==== 
 + 
 +If both udunits1 and udunits2 are available on the machinefimex might prefer udunits1 unless explicitly disabledTo explicitly disable udunits1, use:
 <code> <code>
- LDFLAGS='-L/usr/local/hdf5.1.8/lib -lhdf5_hl -lhdf5 -lz'+./configure --without-udunits --with-udunits2 ...
 </code> </code>
  
 +==== MacOS X and gcc ====
  
-===== Test =====+Under MacOS X strings may come in different flavour for gcc, either static or fully dynamic. Libraries compiled with one type of strings don't work well with programs/libraries compiled with the other type. This might result in an segmentation fault when running ''fimex'' with the message: 
 +<code> 
 + pointer being freed not allocated 
 +</code> 
 + 
 +boost::program_options is affected by this and must be compiled with the same compiler as fimex is compiled, e.g. 
 +  * download boost 
 +  * add ''using darwin : : g++-mp-4.6 ;'' in ''user-config.jam'' 
 +  * run <code> 
 +./bootstrap.sh --prefix=/usr/local 
 +./b2 install 
 +</code> 
 +For more information, see http://lists.boost.org/boost-users/2010/06/59548.php 
 + 
 + 
 +==== AIX ==== 
 + 
 +The boost libraries (1.44) are not compatible with the AIX XL/C++ compiler V10 and we had to compile boost and fimex with gcc to get it working under AIX. This might have been improved with newer versions of the AIX compiler, but hasn't been tested: http://www-01.ibm.com/support/docview.wss?uid=swg27018656
  
-  * Download the file with testdata: {{:fimex:flth00.dat.gz|}} 
-  * Put this file into the test-catalogue 
-  * gunzip the file 
-  * run 'make check' (make check will work even without the testdata and skip a lot of tests) 
  • fimex/install.1273240886.txt.gz
  • Last modified: 2022-05-31 09:23:15
  • (external edit)