Bug 733819 - cgnslib is not built using HDF5 or ADF in fedora hence broken(?)
Summary: cgnslib is not built using HDF5 or ADF in fedora hence broken(?)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cgnslib
Version: 15
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Shakthi Kannan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-27 05:51 UTC by fedvasu
Modified: 2016-05-29 16:00 UTC (History)
4 users (show)

Fixed In Version: cgnslib-2.5-5.r2.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-09 16:57:51 UTC


Attachments (Terms of Use)
fortran example of writing a simple grid file taken from "User's guide to cgns" (1.41 KB, text/x-fortran)
2011-08-27 05:51 UTC, fedvasu
no flags Details

Description fedvasu 2011-08-27 05:51:51 UTC
Created attachment 520159 [details]
fortran example of writing a simple grid file taken from "User's guide to cgns"

Description of problem:
cgnslib has undefined refernces to functions (from HDF5) on which it is supposed to build and linking error, due to which (binary)executable is not formed.

Version-Release number of selected component (if applicable):
cgns version 2.5.5-r1 (the versions shipped with fedora 15 and 14)

How reproducible:
just compile the attached fortran program and put into executable form
by using commands

gfortran -c cgnstest.f95 -I /usr/include/cgnslib_f.h 
#untiil now is fine here cgnstest.o created 
gfortran -c cgnstest cgnstest.o -L /usr/lib/libcgns.so -lcgns
#after the second command or linking directive the following is the output

/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_INT32_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Pcreate'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tcopy'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_UINT32_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sget_simple_extent_dims'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Eset_auto2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sget_simple_extent_ndims'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Aget_type'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fcreate'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_SCHAR_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Aopen_name'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gunlink'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Lget_val'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tget_native_type'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Acreate2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Aclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_C_S1_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tset_precision'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dopen2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dget_type'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_FLOAT_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Lunpack_elink_val'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dwrite'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Lcreate_external'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Screate_simple'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Aread'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5check_version'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Iget_name'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Lis_registered'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fget_obj_ids'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gcreate2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Giterate'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tget_size'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_UCHAR_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Screate'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_IEEE_F32BE_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gopen2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dset_extent'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_IEEE_F64BE_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dget_space'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5P_CLS_FILE_ACCESS_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_UINT64_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Pset_nlinks'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Pclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fflush'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5P_CLS_LINK_ACCESS_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_IEEE_F64LE_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fis_hdf5'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_INT64_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_IEEE_F32LE_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gget_objinfo'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sselect_hyperslab'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Ewalk2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Awrite'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Gmove'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Pset_fclose_degree'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sget_simple_extent_npoints'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5open'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dread'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5garbage_collect'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tget_precision'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tset_size'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Aiterate2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fget_obj_count'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5get_libversion'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fopen'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Fclose'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Glink'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5T_NATIVE_DOUBLE_g'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Dcreate2'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Tequal'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../libcgns.so: undefined reference to `H5Sget_select_npoints'
collect2: ld returned 1 exit status



Steps to Reproduce:
1.Downlaod the fortran program
2.install cgnslib
3.execute the commands to compile the attached fortran program and(try to) create executable(you'll fail) 
  
Actual results:
The executable is not created due to undefined refernce functions in the library "libcgns.so" , I think these functions 

Expected results:
should compile and executable be created and run fine producing a .cgns file conatining a simple(structured) grid/mesh. as i have tested it in Ubuntu 10.10 cgnslib 2.5.4 (it has libhdf5 as dependency and is built with that) and i could even read the output .cgns file using another program.  

Additional info:
I think yum should consider hdf5 and hdf5-devel as dependencies for cgnslib and compile(or) build it using them. like debian or Ubuntu's "apt" considers libhdf5 as dependencies for cgnslib

Comment 1 giulix 2011-08-27 09:25:56 UTC
Try installing package hdf5-devel too:

su -c "yum install cgnslib-devel hdf5-devel"

Then compile with

gfortran -o cgnstest cgnstest.f -I /usr/include -l cgns -l hdf5

It should produce no errors

Comment 2 fedvasu 2011-08-27 13:07:13 UTC
(In reply to comment #1)
> Try installing package hdf5-devel too:
> 
> su -c "yum install cgnslib-devel hdf5-devel"
> 
> Then compile with
> 
> gfortran -o cgnstest cgnstest.f -I /usr/include -l cgns -l hdf5
> 
> It should produce no errors

It works, i had already installed hdf5-devel (i missed the point that hdf5 too is a library & can be linked explicitly),but don't you think it's a "work-around" rather than solution?, b'coz just linking to libcgns.so should get all functions,cgns user shouldn't be bothered with underlying mechanism (or he should bother?)

anyway thanx ,now i can get my workdone ..


cheers..

Comment 3 Shakthi Kannan 2011-08-29 05:13:37 UTC
hdf5-devel is already included as a dependency in the cgnslib.spec file.

If you intend to do development, you will need to install the cgnslib-devel package, which provides libcgns.so.

Comment 4 fedvasu 2011-08-29 10:32:51 UTC
really hdf5-devel is included as dependency? i did yum install it didn't install hdf5-devel neither did it install hdf5 (you can see for your self) , when i installed cgnslib (i manually installed and explicitly linked them to get program compiled , as pointed out by giulix) 

and in "user's guide" it's mentioned to link just to cgns library using -l
gfortran -c cgnstest cgnstest.o -L /usr/lib/libcgns.so -lcgns

it didn't occur to me that i have to explicit link to hdf5 too.

Comment 5 Shakthi Kannan 2011-08-29 10:42:27 UTC
"really hdf5-devel is included as dependency?" as BuildRequires when building the package, and not during installation.

If it is required during installation, I shall add hdf5, hdf5-devel as Requires.

Comment 6 fedvasu 2011-08-29 13:28:16 UTC
(In reply to comment #5)
> "really hdf5-devel is included as dependency?" as BuildRequires when building
> the package, and not during installation.
> 
> If it is required during installation, I shall add hdf5, hdf5-devel as
> Requires.

As i said it before

"like debian or Ubuntu's "apt" considers
libhdf5 (more modern versions build it by default libhdf-serial) as dependencies for cgnslib(installs it!)",
 
No offence, but you can check that out in debian or an *buntus and see for yourself.   

I think this what makes explicit linking to hdf5 unnecesary(that was the whole point of this bug report) and also mentioned in their documentation cgns can be build either on ADF  or HDF5 (default is HDF5 from version 2.5) so i think you have to add hdf5 as installation dependency.

Comment 7 Shakthi Kannan 2011-08-29 16:02:32 UTC
Option #1

Installing cgnslib will also install hdf5. Installing cgnslib-devel will also install hdf5-devel.

Option #2

Remove cgnslib-devel, and have only cgnslib, which when installed will also install hdf5, and hdf5-devel.

Which is your recommended usage for cgnslib? I will update it accordingly.

Comment 8 fedvasu 2011-08-29 17:18:47 UTC
(In reply to comment #7)
> Option #1
> 
> Installing cgnslib will also install hdf5. Installing cgnslib-devel will also
> install hdf5-devel.
> 
> Option #2
> 
> Remove cgnslib-devel, and have only cgnslib, which when installed will also
> install hdf5, and hdf5-devel.
> 
> Which is your recommended usage for cgnslib? I will update it accordingly.

i think option 2 seems correct,only if the new cgnslib contains both cgnslib (library files) and cgnslib-devel (header files) , otherwise we can't write programs (header files are required).

otherwise option 1 is safer, any guy who wants to write small fortran/c program will definitely install cgnslib-devel and hennce install cgns,hdf5 & hdf5-devel

'so i would say go for option #1' 

hope i was clear about the assesment.

Comment 9 Fedora Update System 2011-09-01 05:47:21 UTC
cgnslib-2.5-5.r2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.fc15

Comment 10 Fedora Update System 2011-09-01 05:47:28 UTC
cgnslib-2.5-5.r2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.el6

Comment 11 Fedora Update System 2011-09-01 05:47:36 UTC
cgnslib-2.5-5.r2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.fc16

Comment 12 Fedora Update System 2011-09-01 05:47:43 UTC
cgnslib-2.5-5.r2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.fc14

Comment 13 Fedora Update System 2011-09-01 19:03:45 UTC
Package cgnslib-2.5-5.r2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cgnslib-2.5-5.r2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.fc16
then log in and leave karma (feedback).

Comment 14 fedvasu 2011-09-01 20:08:18 UTC
i will check it out once the update (it is not yet) is available and send the feedback.

Comment 15 Fedora Update System 2011-09-09 16:57:45 UTC
cgnslib-2.5-5.r2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 fedvasu 2011-09-10 21:31:23 UTC
OK,I've tested the update-testing version of cgnslib and it does install hdf5 as dependency and cgnslib-devel installs hdf5-devel as dependency , but one problem still persists , you still have to explicitly link to hdf5 using -lhdf5 , which is still annoying. i wanted to give feedback here 

https://admin.fedoraproject.org/updates/cgnslib-2.5-5.r2.fc16 

if it weren't for explicit linking annoyance , i wouldn't have cared to file a bug in the first place, in fact cgnslib is not broken dependencies were handled improperly and unusual (perhaps natural) mechanism of linking is forced on the user.
(a similar observation , one has to explicitly install numpy and numpy-f2py FORTRAN wrapper , no offense again here, if this is the fedora way of packaging , i can't say much here, and am fine as long as it doesn't annoy me) 

but i couldn't sign up,it always tells captcha invalid doesn't even refresh the captcha, anyway i don't care about it, i care about cgns and most of the things are done , if explicit linking is feature rather than a bug i can't say much, i would give all the feedback from here if there's anything more to say(as i apparently can't join fedora).

job done, but can be made better!

Comment 17 Fedora Update System 2011-09-10 23:56:51 UTC
cgnslib-2.5-5.r2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2011-09-10 23:57:49 UTC
cgnslib-2.5-5.r2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Shakthi Kannan 2011-09-11 01:49:16 UTC
Regarding comment #16:

  "you still have to explicitly link to hdf5 using -lhdf5"

If you are using a library for development, you have to link against it. 

  "one has to explicitly install numpy and numpy-f2py FORTRAN wrapper"

You had asked for hdf5, hdf5-devel, so they have been added as install dependencies. You haven't mentioned whether you want numpy, and numpy-f2py to be installed with cgnslib or cgnslib-devel.

Comment 20 fedvasu 2011-09-13 15:08:33 UTC
hahaha funny, i was just giving an example , numpy is not even wildly related and has nothing to do with cgns (there used to be pyCGNS.. now another experimental python cgns wrapper is available),so it was just an example how things are in fedora, that's it. (not it is "a similar observation")

I guess this mis-communication is due to my verbose comments , so i'l try to be terse, again FWIW i'll repeat again

when making an executable(linking phase) i should just link cgns library that's it!, the -lhdf5 should be unnecessary.if you had made that it would have been better. The problem is not just cgnslib's install dependencies were not installed but also it was(And still is) for the user to understand the underlying library to use cgns API.

I'm sure , i was precise this time , I do want to apologize for not precisely conveying the desired behavior of the system.

IMHO opinion you don't have to reopen the bug (b'coz it's almost solved), just make sure that linking to cgnslib automatically links to hdf5

i.e.  currently
    gfortran -o cgsntest cgnstest.o -L /usr/lib/libcgsn.so -lcgns -lhdf5

desired 
    gfortran -o cgnstest cgnstest.o -L /usr/lib/libcgns.so -lcgns

that's it!

cheers...

Comment 21 fedvasu 2011-09-13 15:10:26 UTC
PS, if this can't be done or against rules of packaging in fedora, i can live with it.

Comment 22 Fedora Update System 2011-09-17 22:00:12 UTC
cgnslib-2.5-5.r2.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Jens Petersen 2011-11-02 06:09:57 UTC
So for debian/ubuntu, -lcgns implies -lhdf5?

I guess there is no pkgconfig for cgns/fortran? :)

Comment 24 Jens Petersen 2011-11-02 06:32:50 UTC
Anyway it seems cgns is not linked against hdf5, which I think
is the problem Vadie is seeing.

So I guess the question is shouldn't it be?
(Seems Ubuntu suggests so - maybe good to check if they have a patch for that)
and if so, how to do that?

If upstream is active - then probably good to query them too
and try to improve the build process (including the current .so patch).

Comment 25 fedvasu 2011-11-03 14:01:31 UTC
(In reply to comment #23)
> So for debian/ubuntu, -lcgns implies -lhdf5?

yes Jens,in Debian/Ubuntu/lmde it does (there is one place it is packaged, 'Debian')

yeah upstream, should be able to respond (and i'm sure linking -lcgns would mean -lhdf5 as well), i guess they are pretty much active , they update their documents every 3-4 months and released version 3.1 quite recently.

Comment 26 boolegue@gmail.com 2016-05-29 16:00:37 UTC
In package 3.2.1-5.fc23, the linking issue against hdf5 is present. This brings troubles with building systems that try to discover the cgns library. Using ldd on libcgns.so does not show any of the hdf5 libraries as it shall.


Note You need to log in before you can comment on or make changes to this bug.