Error to compile GSI3.7EnKF with cmake

Submitted by ntmanh18196 on Mon, 05/10/2021 - 02:39

Dear GSI-help Team,

I got the error compilation with GSI3.7EnKF with Cmake compiler which is displayed in the below:

-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
 trying to find lapack, GENERIC,
-- A library with LAPACK API found.
setting values for corelibs
Could not find BACIO library, so building from libsrc
setting source for bacio to be in libsrc
Could not find W3NCO library, so building from libsrc
setting source for w3nco to be in libsrc
HEY w3nco lib is called w3nco_v2.0.6
MPI include PATH  /work/apps/intel/mvapich2/2.3.2/include
-- A library with LAPACK API found.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:

Although I set up a CURL library in my environment, it still occurred.

Please help me to resolve this issue!

Thank you in advance.

Best regards,

 

Hi,

 

When you run the cmake command, you can pass environment variables with a flag like "-DCURL_LIBRARY=/path/to/library" to have it look in a specific location.

Can you try pointing these to your library to see if your compile progresses?

 

Thanks,

 

Will

Permalink

In reply to by wmayfield

Hi Will,

Thank you for your reply.

I've added a flag of environment variables on my cmake command, the error related to the CURL libraries is solved, but I got the warning:

cmake -DCURL_LIBRARY=/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib -DCURL_INCLUDE_DIR=/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/include -D_LAPACK=/work/apps/intel_2016/lapack/3.5.0 ../
Build the EnKF with WRF module
Control path is 
The hostname is  igplogin.cluster
-- BUILD_CORELIBS manually-specified as ON
Setting paths for Generic System
/work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3
Setting Intel flags
Compiler version is 19.1.0
Compiler version is 19.1.0
Using installed FindMPI
include dirs are /work/apps/intel/mvapich2/2.3.2/include
include PATH  /work/apps/intel/mvapich2/2.3.2/include
MPI version is 3.1
MPI f90 version is TRUE
MPI f08 version is TRUE
 trying to find lapack, GENERIC, 
-- A library with LAPACK API found.
setting values for corelibs
Could not find BACIO library, so building from libsrc
setting source for bacio to be in libsrc
Could not find W3NCO library, so building from libsrc
setting source for w3nco to be in libsrc

HEY w3nco lib is called w3nco_v2.0.6
MPI include PATH  /work/apps/intel/mvapich2/2.3.2/include
-- A library with LAPACK API found.
-- Configuring done
CMake Warning (dev) at libsrc/w3nco/CMakeLists.txt:14 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target
  "/work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3/build/lib/libsigio_v2.0.1.a"
  of target "w3nco_v2.0.6" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

WARNING: Target "gsi.x" requests linking to directory "/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "enkf_wrf.x" requests linking to directory "/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "enkf_wrf.x" requests linking to directory "/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "enspreproc.x" requests linking to directory "/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "initialens.x" requests linking to directory "/work/users/cloud/user/manh/WRFCHEM-4.2.2-install-script-linux-32bit/WRFCHEM/Libs/grib2/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done

Then I typed "make" command, it reported that:

work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1221): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [FILE_UTILITY]
use file_utility, only : get_lun
----^
/work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1247): error #6404: This name does not have a type, and must have an explicit type.   [GET_LUN]
   luin=get_lun()
--------^
/work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1221): error #6580: Name in only-list does not exist or is not accessible.   [GET_LUN]
use file_utility, only : get_lun
-------------------------^
compilation aborted for /work/users/cloud/user/manh/GSIv3.7EnKFv1.3/comGSIv3.7_EnKFv1.3/src/obsmod.F90 (code 1)
make[2]: *** [src/CMakeFiles/gsilib_shrd.dir/obsmod.F90.o] Error 1
make[1]: *** [src/CMakeFiles/gsilib_shrd.dir/all] Error 2
 

Please help me to solve this problem!

Thank you very much!

Bests,

Manh,

Hi Manh,

 

I looked around online and it seems like this is still due to the cmake linking. I suggest searching about the "Targets may link only to libraries.  CMake is dropping the item." warnings and see if you need to directly link the library rather than the directory to try to make sure it doesn't drop these.

 

Thanks,

 

Will

Hi Will,

Thank you for your reply.

I've tried many times with using the direct link to the libraries and without using it, however, it still failed.

Can you kindly give me the clear and simply method to compile GSI system with Intel Ifort complier?

Thank you very much!

Bests,

Manh, 

Hi Manh,

 

I just noticed that it looks like your Intel compiler version is 19.1, which we have known to produce compiling errors. The last Intel compiler we support is version 18, can you try that one? Please see README.comgsi in the main directory for the full list of tested compilers. Also, it may be useful to run ./util/gsienvreport.sh to see more information about your environment that GSI will use.

 

Thanks,

 

Will 

Hi Will,

Thank you for your explanation.

I've tried using many kinds of compiler, including GNU and PGI, however, I got the same error:

Using installed FindMPI
-- Could NOT find MPI_C (missing: MPI_C_WORKS) 
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_WORKS) 
CMake Error at /work/apps/gnu_4.8.5/cmake/3.14.5/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND MPI_Fortran_FOUND)
Call Stack (most recent call first):
 

Can you kindly give me some useful suggestions?

Thank you very much!

Permalink

In reply to by wmayfield

Hi Will,

Unluckily, my HPC don't have Intel Compiler 18, it just have 2019 and 2020. So I don't have a chance to practice with this version of the Compiler.

So, do have any suggestions for me?

Thank you very much! 

Hi Manh,

 

If you are unable to use one of the compilers that is compatible with GSIv3.7, I have a couple of possible suggestions. One is to use the latest comGSI on github: https://github.com/comgsi/GSI, which should be possible to compile with Intel 19. This version does not come packaged with several needed libraries, however, and there is a separate process to compile those, as described in a document on the github page.

Another suggestion is to implement a fix to allow GSIv3.7 to compile with Intel 19. This fix should be possible with the source code changes shown in the "diff" in the document I am attaching.

 

Thanks,

 

Will

Attach Files

Hi Will,

Thank you very much for your enthusiastic help.

I've tried modifying the /src/enkf/mpisetup.F90 file to like this:

subroutine mpi_initialize()

use mpimod, only : npe,mype integer ierr

#ifdef MPI3 integer nuse,new_group,old_group,nshmemroot,np

@@ -99,7 +99,6 @@

end subroutine

mpi_initialize subroutine mpi_initialize_io(nanals) -use mpimod, only : mpi_comm_world

integer ierr,np,nuse,new_group,old_group

integer, intent(in) :: nanals integer, dimension(:), allocatable :: useprocs, itasks

And the anisofilter_glb.f90 file was changed to be like that:

@@ -92,7 +92,7 @@

filter_p3, pf2aP3, &

triad4,ifilt_ord,npass,normal,binom, &

ngauss,rgauss,anhswgt,an_amp,an_vs, & - ancovmdl, covmap, & 

ancovmdl, covmap, lreadnorm, & nsmooth,nsmooth_shapiro use gridmod, only: nsig,nsig1o,nlon,nlat, &

@@ -125,8 +125,7 @@

use gsi_metguess_mod, only: gsi_metguess_bundle

use gsi_bundlemod, only: gsi_bundlegetpointer 

use anisofilter, only: r015, & qlth_temp0, qltv_temp0, qlth_wind0, qltv_wind0, &

scalex1, scalex2, scalex3, &

stpcode_alloc, stpcode_namelist, &

However, the other error appeared:

work/users/cloud/user/manh/GSI_EnKF3.7/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1221): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [FILE_UTILITY]
use file_utility, only : get_lun
----^
/work/users/cloud/user/manh/GSI_EnKF3.7/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1247): error #6404: This name does not have a type, and must have an explicit type.   [GET_LUN]
   luin=get_lun()
--------^
/work/users/cloud/user/manh/GSI_EnKF3.7/comGSIv3.7_EnKFv1.3/src/obsmod.F90(1221): error #6580: Name in only-list does not exist or is not accessible.   [GET_LUN]
use file_utility, only : get_lun
-------------------------^
compilation aborted for /work/users/cloud/user/manh/GSI_EnKF3.7/comGSIv3.7_EnKFv1.3/src/obsmod.F90 (code 1)
make[2]: *** [src/CMakeFiles/gsilib_shrd.dir/obsmod.F90.o] Error 1
make[1]: *** [src/CMakeFiles/gsilib_shrd.dir/all] Error 2
Please help me to resolve this problem!

Thank you very much!

Best regards,

Manh,