From d069cca3f95e8bdff5333d0d65d212e74e9f5321 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 20 Mar 2013 17:04:39 -0600 Subject: [PATCH] - Add patch to handle netcdf better with cmake - BR netcdf-devel instead of netcdf-cxx-devel --- gdl-netcdf.patch | 123 +++++++++++++++++++++++++++++++++++++++++++++++ gdl.spec | 12 ++++- 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 gdl-netcdf.patch diff --git a/gdl-netcdf.patch b/gdl-netcdf.patch new file mode 100644 index 0000000..6f51863 --- /dev/null +++ b/gdl-netcdf.patch @@ -0,0 +1,123 @@ +diff -up gdl-0.9.3/CMakeLists.txt.netcdf gdl-0.9.3/CMakeLists.txt +--- gdl-0.9.3/CMakeLists.txt.netcdf 2013-03-20 16:59:45.275423730 -0600 ++++ gdl-0.9.3/CMakeLists.txt 2013-03-20 16:59:47.882410649 -0600 +@@ -373,18 +373,18 @@ if(NETCDF) + find_package(NetCDF QUIET) + if(NETCDF_FOUND) + set(CMAKE_REQUIRED_INCLUDES ${NETCDF_INCLUDE_DIRS}) +- check_include_file_cxx(netcdfcpp.h HAVE_NETCDFCPP_H) +- if(HAVE_NETCDFCPP_H) ++ check_include_file_cxx(netcdf.h HAVE_NETCDF_H) ++ if(HAVE_NETCDF_H) + set(LIBRARIES ${LIBRARIES} ${NETCDF_LIBRARIES}) + set(LINK_DIRECTORIES ${LINK_DIRECTORIES} ${NETCDF_LIBRARY_DIRS}) + include_directories(${NETCDF_INCLUDE_DIRS}) + set(USE_NETCDF 1) +- else(HAVE_NETCDFCPP_H) ++ else(HAVE_NETCDF_H) + message(FATAL_ERROR "NetCDF installation seems not to be usable.\n" + "This suggests a conflicting netCDF-HDF4 installation e.g.\n" + "- Uninstalling HDF4 after installation of NetCDF.\n" + "- Installing NetCDF before HDF4.") +- endif(HAVE_NETCDFCPP_H) ++ endif(HAVE_NETCDF_H) + set(CMAKE_REQUIRED_INCLUDES) + else(NETCDF_FOUND) + message(FATAL_ERROR "NetCDF version 3.5.1 or later is required but was not found.\n" +diff -up gdl-0.9.3/CMakeModules/FindNetCDF.cmake.netcdf gdl-0.9.3/CMakeModules/FindNetCDF.cmake +--- gdl-0.9.3/CMakeModules/FindNetCDF.cmake.netcdf 2012-12-27 09:22:45.000000000 -0700 ++++ gdl-0.9.3/CMakeModules/FindNetCDF.cmake 2013-03-20 16:59:47.882410649 -0600 +@@ -9,24 +9,17 @@ + # + + +-find_path(NETCDFPKG netcdf.pc PATH_SUFFIXES lib lib/pkgconfig) +-include(FindPackageHandleStandardArgs) +-if(NETCDFPKG) +- set(ENV{PKG_CONFIG_PATH} ${NETCDFPKG}) # pkg search path +- include(FindPkgConfig) +- pkg_check_modules(NETCDF netcdf) +- if(NETCDF_FOUND) +- find_package_handle_standard_args(NETCDF DEFAULT_MSG NETCDF_LIBRARIES NETCDF_INCLUDE_DIRS) +- endif(NETCDF_FOUND) +-else(NETCDFPKG) # no netcdf.pc file ++find_package(PkgConfig QUIET) ++pkg_check_modules(NETCDF netcdf) ++if(NETCDF_FOUND) # no netcdf.pc file ++ find_package_handle_standard_args(NETCDF DEFAULT_MSG NETCDF_LIBRARIES) ++else(NETCDF_FOUND) # no netcdf.pc file + find_library(NETCDF_LIBRARIES NAMES netcdf) +- find_path(NETCDF_INCLUDE_DIRS NAMES netcdfcpp.h PATH_SUFFIXES netcdf-3) ++ find_path(NETCDF_INCLUDE_DIRS NAMES netcdf.h PATH_SUFFIXES netcdf-3) + find_package_handle_standard_args(NETCDF DEFAULT_MSG NETCDF_LIBRARIES NETCDF_INCLUDE_DIRS) +-endif(NETCDFPKG) ++endif(NETCDF_FOUND) + + mark_as_advanced( +-NETCDFPKG +-NETCDF + NETCDF_INCLUDE_DIRS + NETCDF_LIBRARIES + ) +diff -up gdl-0.9.3/configure.in.netcdf gdl-0.9.3/configure.in +--- gdl-0.9.3/configure.in.netcdf 2013-03-20 16:59:45.277423720 -0600 ++++ gdl-0.9.3/configure.in 2013-03-20 17:00:59.002056390 -0600 +@@ -562,8 +562,8 @@ if test "x$with_netcdf" != "xno"; then + exit -1 + ]) + +- AC_CHECK_HEADERS("netcdfcpp.h", [], [ +- AC_CHECK_HEADERS("$ncdfincdir/netcdfcpp.h", [], [ ++ AC_CHECK_HEADERS("netcdf.h", [], [ ++ AC_CHECK_HEADERS("$ncdfincdir/netcdf.h", [], [ + echo "" + echo "Error! netCDF installation seems not to be usable" + echo " This suggests a conflicting netCDF-HDF4 installation, e.g." +diff -up gdl-0.9.3/src/ncdf_att_cl.cpp.netcdf gdl-0.9.3/src/ncdf_att_cl.cpp +--- gdl-0.9.3/src/ncdf_att_cl.cpp.netcdf 2012-12-27 09:22:44.000000000 -0700 ++++ gdl-0.9.3/src/ncdf_att_cl.cpp 2013-03-20 16:59:47.883410644 -0600 +@@ -32,7 +32,7 @@ + # include + # include + # include +-# include ++# include + + # include "datatypes.hpp" + # include "math_utl.hpp" +diff -up gdl-0.9.3/src/ncdf_cl.hpp.netcdf gdl-0.9.3/src/ncdf_cl.hpp +--- gdl-0.9.3/src/ncdf_cl.hpp.netcdf 2012-12-27 09:22:44.000000000 -0700 ++++ gdl-0.9.3/src/ncdf_cl.hpp 2013-03-20 16:59:47.883410644 -0600 +@@ -18,7 +18,7 @@ + #ifndef NCDF_HPP_CL_ + #define NCDF_HPP_CL_ + +-#include ++#include + #include + + namespace lib { +diff -up gdl-0.9.3/src/ncdf_dim_cl.cpp.netcdf gdl-0.9.3/src/ncdf_dim_cl.cpp +--- gdl-0.9.3/src/ncdf_dim_cl.cpp.netcdf 2012-12-27 09:22:44.000000000 -0700 ++++ gdl-0.9.3/src/ncdf_dim_cl.cpp 2013-03-20 16:59:47.883410644 -0600 +@@ -30,7 +30,7 @@ + #include + #include + #include +-#include ++#include + + #include "datatypes.hpp" + #include "math_utl.hpp" +diff -up gdl-0.9.3/src/ncdf_var_cl.cpp.netcdf gdl-0.9.3/src/ncdf_var_cl.cpp +--- gdl-0.9.3/src/ncdf_var_cl.cpp.netcdf 2013-03-20 16:59:45.301423599 -0600 ++++ gdl-0.9.3/src/ncdf_var_cl.cpp 2013-03-20 16:59:47.884410639 -0600 +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include + + #include "datatypes.hpp" + #include "math_utl.hpp" diff --git a/gdl.spec b/gdl.spec index 93f43b0..3c6fa24 100644 --- a/gdl.spec +++ b/gdl.spec @@ -2,7 +2,7 @@ Name: gdl Version: 0.9.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GNU Data Language Group: Applications/Engineering @@ -24,6 +24,9 @@ Patch3: gdl-build.patch Patch4: gdl-test_ce.patch # Patch to have run tests without stdin Patch5: gdl-tests.patch +# Patch to find netcdf with cmake +# https://sourceforge.net/tracker/?func=detail&aid=3608649&group_id=97659&atid=618685 +Patch6: gdl-netcdf.patch # Build with system antlr library. Request for upstream change here: # https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&group_id=97659&atid=618686 Patch13: gdl-0.9-antlr-cmake.patch @@ -44,7 +47,7 @@ BuildRequires: java %endif BuildRequires: readline-devel, ncurses-devel BuildRequires: gsl-devel, plplot-devel, ImageMagick-c++-devel -BuildRequires: netcdf-cxx-devel, hdf5-devel, libjpeg-devel +BuildRequires: netcdf-devel, hdf5-devel, libjpeg-devel BuildRequires: python-devel, numpy, python-matplotlib BuildRequires: fftw-devel, hdf-static %if 0%{?fedora} || 0%{?rhel} >= 6 @@ -110,6 +113,7 @@ popd %patch3 -p1 -b .build %patch4 -p1 -b .test_ce %patch5 -p1 -b .tests +%patch6 -p1 -b .netcdf rm ltmain.sh rm -r CMakeFiles @@ -188,6 +192,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Mar 20 2013 Orion Poplawski - 0.9.3-5 +- Add patch to handle netcdf better with cmake +- BR netcdf-devel instead of netcdf-cxx-devel + * Fri Mar 15 2013 Orion Poplawski - 0.9.3-4 - Change to use cmake - Update to current cvs via patch