Skip to content

Intel Build Error cannot see libg2c.a (or libg2c.a missing components) #346

@wjcapehart

Description

@wjcapehart

Hello All

I have a build error at the first "cmake" level using the Intel openapi compilers (2024.2 base & HPC toolkits).

I had installed the NCEPLIBS-g2 and NCEPLIBS-g2c and other prerequisites before this with no errors and successful tests and installs.

The output is provided below.

cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local  -DCMAKE_PREFIX_PATH=/usr/local;/usr/local/bin;/usr/local/lib;/usr/local/include 
-- The C compiler identification is IntelLLVM 2024.2.1
-- The Fortran compiler identification is IntelLLVM 2024.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/2024.2/bin/icx - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/intel/oneapi/compiler/2024.2/bin/ifx - skipped
-- Setting build type to 'Release' as none was specified.
-- Found JPEG: /usr/local/lib/libjpeg.so (found version "90") 
-- Found Jasper: /usr/local/lib/libjasper.so (found suitable version "4.2.4", minimum required is "2.0.25") 
-- Found ZLIB: /usr/local/lib/libz.so (found version "1.3.1")  
-- Found PNG: /usr/local/lib/libpng.so (found version "1.6.43") 
-- Found bacio: /usr/local/lib/libbacio.a (found version "2.6.0")
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: /opt/intel/oneapi/mkl/2024.2/lib/libmkl_intel_lp64.so;/opt/intel/oneapi/mkl/2024.2/lib/libmkl_intel_thread.so;/opt/intel/oneapi/mkl/2024.2/lib/libmkl_core.so;/opt/intel/oneapi/compiler/2024.2/lib/libiomp5.so;-lm;-ldl  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- Found LAPACK: /opt/intel/oneapi/mkl/2024.2/lib/libmkl_intel_lp64.so;/opt/intel/oneapi/mkl/2024.2/lib/libmkl_intel_thread.so;/opt/intel/oneapi/mkl/2024.2/lib/libmkl_core.so;/opt/intel/oneapi/compiler/2024.2/lib/libiomp5.so;-lm;-ldl;-lm;-ldl  
-- Found ip: /usr/local/lib/libip_4.a (found version "5.1.0")
-- Found bacio: /usr/local/lib/libbacio.a (found version "2.6.0")
-- Found w3emc: /usr/local/lib/libw3emc_4.a (found version "2.12.0")
-- Found g2: /usr/local/lib/libg2_4.a (found version "3.5.1")
-- Using bacio library bacio
-- In cnvgrib using bacio library bacio
-- In cnvgrib /usr/local/lib/libjasper.so;/usr/local/lib/libjpeg.so
-- In cnvgrib /usr/local/lib/libz.so
-- g2c_compare not found.
-- Configuring done (2.4s)
CMake Error at /usr/local/lib/cmake/g2/g2-targets.cmake:61 (set_target_properties):
  The link interface of target "g2::g2_4" contains:

    g2c::g2c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /usr/local/lib/cmake/g2/g2-config.cmake:34 (include)
  CMakeLists.txt:47 (find_package)


CMake Error at /usr/local/lib/cmake/g2/g2-targets.cmake:69 (set_target_properties):
  The link interface of target "g2::g2_d" contains:

    g2c::g2c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /usr/local/lib/cmake/g2/g2-config.cmake:34 (include)
  CMakeLists.txt:47 (find_package)


-- Generating done (0.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
bash: /usr/local/bin: Is a directory
bash: /usr/local/lib: Is a directory
bash: /usr/local/include: Is a directory

Libraries libbacio.a; libpng.so /libz.so libjasper.so llibjpeg.so; libg2_4.a; libg2_d.a; libg2c.a; libw3emc_4.a & libw3emc_d.a are all present.

I am unsure if the cmake configuration script is looking for a g2c_compare.o routine in any of the files and I cannot find them in the inventories for libg2c.a, libg2_d.a, and libg2_d.a

I've included the contents of libg2c.a, libg2_d.a, and libg2_d.a and their inventories are

llibg2c.a

# ar -t /usr/local/lib/libg2c.a
cmplxpack.c.o
compack.c.o
comunpack.c.o
drstemplates.c.o
g2_addfield.c.o
g2_addgrid.c.o
g2_addlocal.c.o
g2_create.c.o
g2_free.c.o
g2_getfld.c.o
g2_gribend.c.o
g2_info.c.o
g2_miss.c.o
g2_unpack1.c.o
g2_unpack2.c.o
g2_unpack3.c.o
g2_unpack4.c.o
g2_unpack5.c.o
g2_unpack6.c.o
g2_unpack7.c.o
gbits.c.o
getdim.c.o
getpoly.c.o
gridtemplates.c.o
int_power.c.o
misspack.c.o
mkieee.c.o
pack_gp.c.o
pdstemplates.c.o
rdieee.c.o
reduce.c.o
seekgb.c.o
simpack.c.o
simunpack.c.o
specpack.c.o
specunpack.c.o
util.c.o
decenc_png.c.o
pngpack.c.o
pngunpack.c.o
decenc_jpeg2000.c.o
jpcpack.c.o
jpcunpack.c.o

libg2_4.a

# ar -t /usr/local/lib/libg2_4.a
compack.F90.o
drstemplates.F90.o
g2bytes.F90.o
g2grids.F90.o
g2get.F90.o
g2getgb2.F90.o
g2index.F90.o
g2gf.F90.o
g2unpack.F90.o
g2create.F90.o
gribmod.F90.o
gridtemplates.F90.o
intmath.F90.o
g2jpc.F90.o
pack_gp.f.o
params_ecmwf.F90.o
params.F90.o
pdstemplates.F90.o
g2png.F90.o
realloc.F90.o
reduce.f.o
g2sim.F90.o
skgb.F90.o
g2spec.F90.o
g2logging.F90.o
gdt2gds.F90.o
mova2i.c.o

and

libg2_4.d

# ar -t /usr/local/lib/libg2_d.a
compack.F90.o
drstemplates.F90.o
g2bytes.F90.o
g2grids.F90.o
g2get.F90.o
g2getgb2.F90.o
g2index.F90.o
g2gf.F90.o
g2unpack.F90.o
g2create.F90.o
gribmod.F90.o
gridtemplates.F90.o
intmath.F90.o
g2jpc.F90.o
pack_gp.f.o
params_ecmwf.F90.o
params.F90.o
pdstemplates.F90.o
g2png.F90.o
realloc.F90.o
reduce.f.o
g2sim.F90.o
skgb.F90.o
g2spec.F90.o
g2logging.F90.o
gdt2gds.F90.o
mova2i.c.o

Ideas at this point are welcome. I've exausted my unix sleuthing skills.
Bill Capehart, SD Mines

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions