NOAA-EMC / NCEPLIBS-g2c

This library contains C decoder/encoder routines for GRIB edition 2.
Other
18 stars 11 forks source link

building g2c with cmake #40

Closed BoiVuong-NOAA closed 3 years ago

BoiVuong-NOAA commented 3 years ago

Kyle, I try to build g2c library by using cmake as follow: cmake .. -DCMAKE_INSTALL_PREFIX=myg2c -DCMAKE_PREFIX_PATH="${PNG_LIBDIR};${PNG_INC};${JASPER_LIBDIR};${JASPER_INC}" make and make install Then, I change to myg2c (where is my destination of g2c library) It built the g2c library in three directories: lib64 and lib and include. But, The lib directory has only cmake file and the include directory has only one file which is grib2.h. The include directory should be included the following files: drstemplates.h grib2.h gridtemplates.h pdstemplates.h Why the lib has no library file ? and the lib64 directory has libg2c.a.

kgerheiser commented 3 years ago

See #41

BoiVuong-NOAA commented 3 years ago

The grib2.h

kgerheiser commented 3 years ago

The grib2.h

What's the problem?

BoiVuong-NOAA commented 3 years ago

It works. The grib2.h has not change the G2_VERSION "g2clib-1.6.0".
Should we have the other *.h file in include directory ?

BoiVuong-NOAA commented 3 years ago

Just a question ! Why do we name the directory lib64 instead of lib ? I think we should call it as lib to make it consistent with the others libraries.

kgerheiser commented 3 years ago

It depends on the platform. It installs at lib64 if that's the standard for that OS. On other systems it will install at lib.

CMake chooses the correct one by using CMAKE_INSTALL_LIBDIR instead of hardcoding it.

BoiVuong-NOAA commented 3 years ago

Ed, Do you have any suggestions in these directories: include and lib or lib64 ? in include directory: We should have the following files *.h drstemplates.h grib2.h gridtemplates.h pdstemplates.h

Is it lib or lib64 ? If we name directory lib64 all existing module on WCOSS, will not work with cmake build ?

kgerheiser commented 3 years ago

For what you're doing, you should use a tag (v1.6.2) instead of directly using the develop branch. Then, we can sort out any issues.

BoiVuong-NOAA commented 3 years ago

If I am using the tag (v1.6.2), I am unable to make changes (such as a unit_test,...)

kgerheiser commented 3 years ago

If you're making a change locally to make some tests, why does it matter if it's at lib64 or lib then?

I thought this was for the NCO delivery thing you're doing?

BoiVuong-NOAA commented 3 years ago

You are correct.

kgerheiser commented 3 years ago

This is what prompted the change:

https://github.com/NOAA-EMC/NCEPLIBS/issues/36

BoiVuong-NOAA commented 3 years ago

Got it.

kgerheiser commented 3 years ago

Also, I'm pretty sure the only place you'll see this behavior is WCOSS Cray. All the other machines will install at lib.

BoiVuong-NOAA commented 3 years ago

Yes, I do see it. on Cray: /gpfs/hps/nco/ops/nwprod/lib

kgerheiser commented 3 years ago

I mean if you do make install with this library it will end up at lib instead of lib64 on all NOAA HPC machines except WCOSS Cray and maybe certain Linux distros.

BoiVuong-NOAA commented 3 years ago

When I do make and make install, I see it has include and lib64

cmake .. -DCMAKE_INSTALL_PREFIX=myg2c

kgerheiser commented 3 years ago

Yes, on WCOSS Cray it's lib64. If you do that same thing most other places it will be lib

BoiVuong-NOAA commented 3 years ago

I see. I have not tried on CRAY yet. I tried it on DELL and see library was in lib64 instead of lib. Why ?

climbfuji commented 3 years ago

Because the operating system says that the standard name of the library directory is "lib64". Different OS have different names, either "lib" or "lib64". This is the same for hdf5, netcdf, ...

On Dec 4, 2020, at 2:24 PM, Boi Vuong notifications@github.com wrote:

I see. I have not tried on CRAY yet. I tried it on DELL and see library was in lib64 instead of lib. Why ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/NCEPLIBS-g2c/issues/40#issuecomment-739028963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5C2RKYLDZZJACCZ5RKWR3STFHSNANCNFSM4UN4BJEA.

kgerheiser commented 3 years ago

Ah, I guess it's like that there too. It depends on the OS.

Most of our builds use CMake, which doesn't care about lib or lib64. It knows how to search for both of them.

BoiVuong-NOAA commented 3 years ago

Thanks, Kyle. Let me know if you have any news