ufs-community / ufs-weather-model

UFS Weather Model
Other
141 stars 248 forks source link

Build fails on ubuntu system in ccpp_prebuild.py #106

Closed edwardhartnett closed 4 years ago

edwardhartnett commented 4 years ago

I set my environment vars to this:

export CC=mpicc
export FC=mpifort
export CXX=mpicxx
export ESMFMKFILE=/home/ed/NCEPLIBS-external/esmf/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk
export PKG_CONFIG_PATH=/usr/local/NCEPLIBS-external/lib/pkgconfig
export NETCDF=/usr/local/NCEPLIBS-external/
export NEMSIO_INC=/home/ed/local/NCEPLIBS/include/
export NEMSIO_LIB=/home/ed/local/NCEPLIBS/lib/libnemsio_v2.3.0.a
export BACIO_LIB4=/home/ed/local/NCEPLIBS/lib/libbacio_v2.2.0_8.a
export SP_LIBd=/home/ed/local/NCEPLIBS/lib/libsp_v2.1.0_d.a
export W3EMC_LIBd=/home/ed/local/NCEPLIBS/lib/libw3emc_v2.5.0_d.a
export W3NCO_LIBd=/home/ed/local/NCEPLIBS/lib/libw3nco_v2.1.0_d.a
export CMAKE_Platform=linux.GNU

Then I run the build script:

(base) ed@mikado:~/ufs-weather-model$ ./build.sh 
Calling ccpp_prebuild.py ...
Call to ccpp_prebuild.py failed, check /home/ed/ufs-weather-model/build/ccpp_prebuild.log

The mentioned log file says:


Traceback (most recent call last):
  File "./FV3/ccpp/framework/scripts/ccpp_prebuild.py", line 17, in <module>
    from metadata_parser import merge_dictionaries, parse_scheme_tables, parse_variable_tables
  File "/home/ed/ufs-weather-model/FV3/ccpp/framework/scripts/metadata_parser.py", line 9, in <module>
    from mkcap import Var
  File "/home/ed/ufs-weather-model/FV3/ccpp/framework/scripts/mkcap.py", line 19, in <module>
    from conversion_tools import unit_conversion
  File "/home/ed/ufs-weather-model/FV3/ccpp/framework/scripts/conversion_tools/__init__.py", line 8, in <module>
    import unit_conversion
ModuleNotFoundError: No module named 'unit_conversion'
climbfuji commented 4 years ago

Which Python version are you using?

edwardhartnett commented 4 years ago
python --version
Python 3.7.4
climbfuji commented 4 years ago

See release notes - the mrw app v1.0.0 works with Python 2.7.x only. The forthcoming release v1.1.0 (around July this year) will work with Python 2.7.x and Python 3.x.

edwardhartnett commented 4 years ago

Made it further this time:

[ 75%] Building Fortran object FV3/CMakeFiles/fv3core.dir/atmos_cubed_sphere/tools/sim_nc_mod.F90.o
/home/ed/ufs-weather-model/FV3/atmos_cubed_sphere/tools/sim_nc_mod.F90:45:2:

  1           
Fatal Error: netcdf.inc: No such file or directory
compilation terminated.
FV3/CMakeFiles/fv3core.dir/build.make:508: recipe for target 'FV3/CMakeFiles/fv3core.dir/atmos_cubed_sphere/tools/sim_nc_mod.F90.o' failed
make[2]: *** [FV3/CMakeFiles/fv3core.dir/atmos_cubed_sphere/tools/sim_nc_mod.F90.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 75%] Building Fortran object FV3/io/CMakeFiles/io.dir/module_write_nemsio.F90.o
[ 76%] Building Fortran object FV3/io/CMakeFiles/io.dir/module_write_netcdf.F90.o
/home/ed/ufs-weather-model/FV3/io/module_write_netcdf.F90:1:29:

 !#define ESMF_ERR_ABORT(rc) \

Warning: backslash and newline separated by space
/home/ed/ufs-weather-model/FV3/io/module_write_netcdf.F90:14:6:

   use netcdf
      1
Fatal Error: Can't open module file ‘netcdf.mod’ for reading at (1): No such file or directory
compilation terminated.
FV3/io/CMakeFiles/io.dir/build.make:118: recipe for target 'FV3/io/CMakeFiles/io.dir/module_write_netcdf.F90.o' failed
make[2]: *** [FV3/io/CMakeFiles/io.dir/module_write_netcdf.F90.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:462: recipe for target 'FV3/CMakeFiles/fv3core.dir/all' failed
make[1]: *** [FV3/CMakeFiles/fv3core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:573: recipe for target 'FV3/io/CMakeFiles/io.dir/all' failed
make[1]: *** [FV3/io/CMakeFiles/io.dir/all] Error 2
Makefile:168: recipe for target 'all' failed
make: *** [all] Error 2
climbfuji commented 4 years ago

Something isn't quite right with your NCEPLIBS-external installation. Are the NetCDF modules and libraries really installed under export NETCDF=/usr/local/NCEPLIBS-external/? I also find it weird that your esmf.mk is in a different directory. Almost seems like the make process for NCEPLIBS-external (which does the install step as well) didn't complete?

edwardhartnett commented 4 years ago

The make process for NCEPLIBS-external did not complete, and I have an issue open for that.

But I installed all the libraries manually.

My netcdf.mod file us in /usr/local/NCEPLIBS-external/include.

climbfuji commented 4 years ago

I'ts also looking for netcdf.inc (a few lines up in your error log).

edwardhartnett commented 4 years ago

OK, with some help over on NCEPLIBS-external I got that working and installed, and then these problems went away. I will close this ticket, but eventually will have to reinvestigate this issue, as it will be necessary for me to be able to build this with the external libraries that were not installed with NCEPLIBS-external.

edwardhartnett commented 4 years ago

BTW the only way I found to work around the python version problem was to change the build.sh script from:

./FV3/ccpp/framework/scripts/ccpp_prebuild.py \

to:

python2 ./FV3/ccpp/framework/scripts/ccpp_prebuild.py \

I tried setting: alias python=python2 but that did not work.