Weiming-Hu / AnalogsEnsemble

The C++ and R packages for parallel ensemble forecasts using Analog Ensemble
https://weiming-hu.github.io/AnalogsEnsemble/
MIT License
18 stars 5 forks source link

C++ PAnEn install with eccodes #65

Closed lec170 closed 4 years ago

lec170 commented 4 years ago

Describe the bug Goal: Install the C++ PAnEn with the use of the grib to netcdf converter. Status: Successfully installed eccodes through homebrew. (Previously had tried allowing the PAnEn to install the eccodes in the C++ PAnEn process but that did not succeed either) However, when I set up the C++ version of the PAnEn, building breaks at the eccodes. See screen shot.

To Reproduce Steps to reproduce the behavior:

  1. Using homebrew install eccodes
  2. Clone repo, make build directory (mkdir build), cd into build directory,
  3. CC=gcc-9 CXX=g++-9 cmake -DBUILD_GRIBCONVERTER=ON ..
  4. make -j
  5. See error

Expected behavior Expect PAnEn to build

Screenshots See attached screen shot and log files. ECCODES_PROJECT-download-out.log ECCODES_PROJECT-configure-out.log ECCODES_PROJECT-configure-err.log ECCODES_PROJECT-build-out.log ECCODES_PROJECT-build-err.log

eccodes_PAnEn_failure

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Weiming-Hu commented 4 years ago

Hi Laura,

Spotted. In you file ECCODES_PROJECT-build-err.log, you have a missing library:

In file included from /Users/rdteclec/github/AnalogsEnsemble/dependency/src/ECCODES_PROJECT/src/grib_jasper_encoding.c:20:
/Library/Frameworks/UnixImageIO.framework/Headers/jasper/jasper.h:65:10: fatal error: 'UnixImageIO/jasper/jas_config.h' file not found
#include <UnixImageIO/jasper/jas_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[5]: *** [src/CMakeFiles/eccodes.dir/grib_jasper_encoding.c.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [src/CMakeFiles/eccodes.dir/all] Error 2
make[3]: *** [all] Error 2

You need to install Jaspber

brew install jasper

reference

Please install the package and retry. I should have added this to the instruction.

Thanks.

Weiming-Hu commented 4 years ago

I have encountered the same problem when trying to install gribConverter on Mac OS.

/Library/Frameworks/UnixImageIO.framework/Headers/jasper/jasper.h:65:10: fatal error: 'UnixImageIO/jasper/jas_config.h' file not found
#include <UnixImageIO/jasper/jas_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/eccodes.dir/grib_jasper_encoding.c.o] Error 1
make[1]: *** [src/CMakeFiles/eccodes.dir/all] Error 2
make: *** [all] Error 2

I already have jasper installed through HomeBrew but the issue persists.

$ brew info jasper
jasper: stable 2.0.16 (bottled)
Library for manipulating JPEG-2000 images
https://www.ece.uvic.ca/~frodo/jasper/
/usr/local/Cellar/jasper/2.0.16_1 (40 files, 1.4MB) *
  Poured from bottle on 2019-04-21 at 23:26:48
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jasper.rb
==> Dependencies
Build: cmake ✘
Required: jpeg ✔
==> Analytics
install: 35,057 (30 days), 109,829 (90 days), 408,279 (365 days)
install_on_request: 379 (30 days), 1,117 (90 days), 7,678 (365 days)
build_error: 0 (30 days)

This problem is caused by make is looking into a different directory UnixImageIO/jasper/jas_config.h, even though jasper has already been installed and the file exists in a different folder:

$ ls /usr/local/Cellar/jasper/2.0.16_1/include/jasper/
jas_cm.h      jas_debug.h   jas_fix.h     jas_icc.h     jas_init.h    jas_math.h    jas_stream.h  jas_tmr.h     jas_types.h   jasper.h
jas_config.h  jas_dll.h     jas_getopt.h  jas_image.h   jas_malloc.h  jas_seq.h     jas_string.h  jas_tvp.h     jas_version.h
Weiming-Hu commented 4 years ago

This has been resolved in commit eeb96aa.

If you are using system eccodes, it should just work.

If you are building eccodes during the compilation, please follow this.