FS#50672 - [cmake] error in FindHDF5.cmake module

Attached to Project: Arch Linux
Opened by Michele Mocciola (mickele) - Monday, 05 September 2016, 22:16 GMT
Last edited by Felix Yan (felixonmars) - Tuesday, 04 April 2017, 17:17 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Module FindHDF5.cmake creates wrong HDF5_DEFINITIONS variable. On my system it should be equale to "-D_FORTIFY_SOURCE=2", but it is equal to "_FORTIFY_SOURCE=2". Module removes -D.
This issue causes an error at compile time.
Attached patch solves the issue.

Additional info:
* version 3.6
* compile KERNEL module of http://www.salome-platform.org/

Steps to reproduce:
download src.7.8.0.tar.gz from "http://files.salome-platform.org/Salome/Salome7.8.0/src7.8.0.tar.gz"
Install
Untar tha package and enter KERNEL_SRC/
After installing 'python2-numpy' 'boost' 'omniorb416' 'omniorbpy36' 'omninotify-omniorb416' 'hdf5_18' 'graphviz' 'libxml2' 'cppunit' 'lapack' 'net-tools' 'openmpi' launch

cmake . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=On \
-DSALOME_CMAKE_DEBUG=On \
-DSALOME_USE_LIBBATCH=On \
-DSALOME_USE_MPI=On \
-DMPI_ROOT_DIR=/usr \
-DHDF5_C_COMPILER_EXECUTABLE=/usr/bin/h5cc_18 \
-DHDF5_C_LIBRARY_hdf5=/usr/lib/hdf5_18/libhdf5.so \
-DHDF5_DIFF_EXECUTABLE=/usr/bin/h5diff_18 \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5_18 \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
-DPTHREAD_ROOT_DIR=/usr \
-DBOOST_ROOT_DIR=/usr \
-DCPPUNIT_ROOT_DIR=/usr \
-DDOXYGEN_ROOT_DIR=/usr \
-DGRAPHVIZ_ROOT_DIR=/usr \
-DSPHINX_EXECUTABLE=/usr/bin/sphinx-build2 \
-DSPHINX_APIDOC_EXECUTABLE=/usr/bin/sphinx-apidoc2 \
-DOMNIORB_ROOT_DIR=/usr \
-DOMNIORBPY_ROOT_DIR=/usr \
-DSWIG_EXECUTABLE=/usr/bin/swig-2 \
-DLIBXML2_ROOT_DIR=/usr \
-DLibXml2_DIR=/usr/lib/cmake/libxml2 \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2

and subsequently

make

You'll have error

[ 15%] Building C object src/HDFPersist/CMakeFiles/SalomeHDFPersist.dir/HDFarrayClose.c.o
cd /home/mickele/aur-work/salome-kernel/src/KERNEL_SRC/build/src/HDFPersist && /usr/bin/cc -DH5_USE_16_API -DPCLINUX64 -DSalomeHDFPersist_EXPORTS -DWITH_PORTMANAGER -D_DEBUG_ -I/usr/include/hdf5_18 -I/usr/lib/include -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -g -fPIC _FORTIFY_SOURCE=2 -o CMakeFiles/SalomeHDFPersist.dir/HDFarrayClose.c.o -c /home/mickele/aur-work/salome-kernel/src/KERNEL_SRC/src/HDFPersist/HDFarrayClose.c
cc: error: _FORTIFY_SOURCE=2: File o directory not found
This task depends upon

Closed by  Felix Yan (felixonmars)
Tuesday, 04 April 2017, 17:17 GMT
Reason for closing:  Upstream
Additional comments about closing:  3.7.2
Comment by Michele Mocciola (mickele) - Thursday, 23 March 2017, 21:57 GMT
Version 3.7.2 of cmake solves the issue.
For me this bug can be closed.

Loading...