nexusformat / code

NeXus API code and helper applications
GNU Lesser General Public License v2.1
12 stars 16 forks source link

4.4.1 rc2 fails to build on Fedora 23 #409

Closed stuartcampbell closed 8 years ago

stuartcampbell commented 8 years ago

Myself and @peterfpeterson have the same problem. Grabbing the 4.4.1-rc2 tarball and building with -DENABLE_HDF5=1 -DENABLE_HDF4=1 -DENABLE_MXML=1 -DENABLE_CXX=1 -DENABLE_FORTRAN77=1 -DENABLE_FORTRAN90=1 -DENABLE_APPS=1

You end up with lots of errors...

[ 18%] Linking Fortran executable NXtestf90
/usr/lib64/hdf/libdf.a(atom.o): In function `HAinit_group':
(.text+0x0): multiple definition of `HAinit_group'
/usr/lib64/hdf/libdf.a(atom.o):(.text+0x0): first defined here
/usr/lib64/hdf/libdf.a(atom.o): In function `HAdestroy_group':
(.text+0x180): multiple definition of `HAdestroy_group'
/usr/lib64/hdf/libdf.a(atom.o):(.text+0x180): first defined here
/usr/lib64/hdf/libdf.a(atom.o):(.data+0x0): multiple definition of `atom_id_cache'
/usr/lib64/hdf/libdf.a(atom.o):(.data+0x0): first defined here
/usr/lib64/hdf/libdf.a(atom.o):(.bss+0x0): multiple definition of `atom_obj_cache'
/usr/lib64/hdf/libdf.a(atom.o):(.bss+0x0): first defined here
/usr/lib64/hdf/libdf.a(atom.o): In function `HAregister_atom':
(.text+0x280): multiple definition of `HAregister_atom'
/usr/lib64/hdf/libdf.a(atom.o):(.text+0x280): first defined here
...

4.4.1-rc1 builds ok on the same machine.

stuartcampbell commented 8 years ago

Running with -DENABLE_FORTRAN77=0 -DENABLE_FORTRAN90=0 seems to build

FreddieAkeroyd commented 8 years ago

@stuartcampbell Hi if you remove ${NAPI_LINK_LIBS} from the target_link_libraries line for NXtestf90 in test/CMakeLists.txt does that help?

eugenwintersberger commented 8 years ago

Removing ${NAPI_LINK_LIBS} did the job as Freddy expected (see also my commit message). However, the Fortran 77 tests for HDF4 and MXML are still causing segfaults on Fedora 23.

FreddieAkeroyd commented 8 years ago

XML works for me after Eugen's fix, crash in HDF4 is in Vattach() - stopping the crash requires a patch to the hdf4 source code

In Vattach() at hdf/src/vgp.c line 1248 where the code looks like

/* convert file id to file record and check for write-permission */
  file_rec = HAatom_object(f);
  if((file_rec==NULL || acc_mode=='w') && !(file_rec->access&DFACC_WRITE))
       HGOTO_ERROR(DFE_BADACC, FAIL);

You need to change the middle line to:

if ( (file_rec==NULL) || ((acc_mode=='w') && !(file_rec->access&DFACC_WRITE)) )

To avoid a NULL pointer dereference. After that, the test no longer crashes but instead prints "ERROR: HDF could not create Vgroup". Not sure why it can't create a vgroup at the moment, but I've report the above incorrect logic issue to the HDF group

FreddieAkeroyd commented 8 years ago

OK, for me "make test" now works but if I run the test by hand it fails. @eugenwintersberger I believe you were seeing this the other way around?

eugenwintersberger commented 8 years ago

@FreddieAkeroyd Yes, I saw this the other way around. It failed during make test.

eugenwintersberger commented 8 years ago

Looks good for me. Tests are passing now on Fedora 23.

peterfpeterson commented 8 years ago

Looks good by me too