From 523f3df490c217dcea9c8b9926e1569a961d13a9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 2 Apr 2013 15:17:46 +0100 Subject: [PATCH] Cmake changes and merges from master --- .gitignore | 24 +++++++++++++++++++ CMakeLists.txt | 4 +++- definitions/CMakeLists.txt | 14 +++++++++++ doxygen/grib_api_wiz.cfg | 2 +- fortran/CMakeLists.txt | 1 + .../definitions/grib1/section.4.def | 3 +-- src/CMakeLists.txt | 2 ++ src/extrules.am | 15 +++++------- src/grib2c.pl | 1 - src/make_accessor_class_hash.ksh | 2 +- src/make_class.pl | 4 ++-- src/make_hash_keys.ksh | 2 +- 12 files changed, 56 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index a77244e3f..190beef2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,27 @@ +# Generated stuff from libtool, automake etc +Makefile +Makefile.in +*.lo +*.la +.deps/ +/libtool +config.h.in +lex.yy.c +stamp-h1 +src/config.h +autom4te.cache/ +config.log +config.status +configure +grib_api.spec +grib_api.pc +grib_api_f90.pc +perl/GRIB-API/Makefile.PL +rpms/grib_api.pc +rpms/grib_api.spec +rpms/grib_api_f90.pc +aclocal.m4 + # compiled source # ################### *.com diff --git a/CMakeLists.txt b/CMakeLists.txt index 41acbafe5..087d0848b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,9 @@ add_subdirectory( definitions ) add_subdirectory( tests ) add_subdirectory( tigge ) add_subdirectory( examples ) -# add_subdirectory( samples ) + +add_subdirectory( samples ) +add_subdirectory( ifs_samples ) # must come after samples # ecbuild_dont_pack( DIRS samples DONT_PACK_REGEX "*.grib" ) diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index e69de29bb..5868bf4a2 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -0,0 +1,14 @@ +file( GLOB definition_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.def" ) +file( GLOB table_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.table" ) + +install( FILES ${definition_files} ${table_files} + DESTINATION share/${PROJECT_NAME}/definitions + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) + +install( DIRECTORY budg cdf common grib1 grib2 gts mars tide + DESTINATION share/${PROJECT_NAME}/definitions + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.table" + PATTERN "4.2.192.*.table" EXCLUDE + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) diff --git a/doxygen/grib_api_wiz.cfg b/doxygen/grib_api_wiz.cfg index 981e49ec7..8795f0d39 100644 --- a/doxygen/grib_api_wiz.cfg +++ b/doxygen/grib_api_wiz.cfg @@ -105,7 +105,7 @@ INPUT = grib_api.dox \ ../tools/grib_keys.dox \ ../tools/grib_copy.dox \ ../tools/grib_index_build.dox \ - ../python/gribapi.py + ../python/eccode.py FILE_PATTERNS = *.c \ *.cc \ *.cxx \ diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 133188e6b..225fc4b9d 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -4,5 +4,6 @@ if( GRB_API_FORTRAN ) # add here the building of fortran bindings + install( FILES grib_api_F77.h DESTINATION include/${PROJECT_NAME} ) endif() diff --git a/grib_api_for_mars/definitions/grib1/section.4.def b/grib_api_for_mars/definitions/grib1/section.4.def index c95d47859..f522e38cd 100644 --- a/grib_api_for_mars/definitions/grib1/section.4.def +++ b/grib_api_for_mars/definitions/grib1/section.4.def @@ -2,11 +2,10 @@ # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. -# +# # In applying this licence, ECMWF does not waive the privileges and immunities granted to it by # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # - # START grib1::section # SECTION 4, Binary data section # Length of section diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 899851c2b..fab42ea75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -316,3 +316,5 @@ ecbuild_add_library( TARGET grib_api # TODO: add support for jpg and png + +install( FILES grib_api.h DESTINATION include/${PROJECT_NAME} ) \ No newline at end of file diff --git a/src/extrules.am b/src/extrules.am index 126f90037..55ab47074 100644 --- a/src/extrules.am +++ b/src/extrules.am @@ -3,22 +3,21 @@ grib_errors.c : grib_errors.txt errors.pl ./errors.pl - cmp grib_errors.c grib_errors.c.new || (p4 edit grib_errors.c ; cp grib_errors.c.new grib_errors.c) - cmp grib_api.h grib_api.h.new || (p4 edit grib_api.h ; cp grib_api.h.new grib_api.h) - cmp ../fortran/grib_api_constants.h grib_api_constants.h.new || (p4 edit ../fortran/grib_api_constants.h ; cp grib_api_constants.h.new ../fortran/grib_api_constants.h) - cmp ../python/grib_errors.h grib_errors.h.new || (p4 edit ../python/grib_errors.h ; cp grib_errors.h.new ../python/grib_errors.h) + cmp grib_errors.c grib_errors.c.new || (cp grib_errors.c.new grib_errors.c) + cmp grib_api.h grib_api.h.new || (cp grib_api.h.new grib_api.h) + cmp ../fortran/grib_api_constants.h grib_api_constants.h.new || (cp grib_api_constants.h.new ../fortran/grib_api_constants.h) + cmp ../python/grib_errors.h grib_errors.h.new || (cp grib_errors.h.new ../python/grib_errors.h) -proto:;-p4 edit grib_api_prototypes.h;mkptypes -A $(libgrib_api_a_prototypes) $(libgrib_api_extra_prototypes) > grib_api_prototypes.h +proto:;-chmod +w grib_api_prototypes.h;mkptypes -A $(libgrib_api_a_prototypes) $(libgrib_api_extra_prototypes) > grib_api_prototypes.h test:all;(cd ../tests; make tests) templates: - -p4 edit grib_templates.h + -chmod +w grib_templates.h ./grib2c.pl ../templates/*.grib grib_lex.c : gribl.l grib_yacc.h $(LEX) gribl.l - p4 edit grib_lex.c sed 's/yy/grib_yy/g' < $(LEX_OUTPUT_ROOT).c | sed 's/static void grib_yyunput/void grib_yyunput/' > grib_lex1.c sed 's/fgetc/getc/g' < grib_lex1.c > grib_lex.c rm -f grib_lex1.c @@ -26,11 +25,9 @@ grib_lex.c : gribl.l grib_yacc.h grib_yacc.h grib_yacc.c : griby.y $(YACC) -d griby.y - p4 edit grib_yacc.c sed 's/yy/grib_yy/g' < y.tab.c > grib_yacc1.c sed 's/fgetc/getc/g' < grib_yacc1.c > grib_yacc.c rm -f grib_yacc1.c - p4 edit grib_yacc.h sed 's/yy/grib_yy/g' < y.tab.h > grib_yacc.h rm -f y.tab.c y.tab.h diff --git a/src/grib2c.pl b/src/grib2c.pl index 29fd2d1c8..c00ae47da 100755 --- a/src/grib2c.pl +++ b/src/grib2c.pl @@ -13,7 +13,6 @@ use Data::Dumper; my $name; my %entries; -system("p4 edit grib_templates.h"); open(OUT,">grib_templates.h") or "die grib_templates.h: $!"; print OUT "/* This file is automatically generated by $0, do not edit */\n\n"; diff --git a/src/make_accessor_class_hash.ksh b/src/make_accessor_class_hash.ksh index 32c217777..da9edd215 100755 --- a/src/make_accessor_class_hash.ksh +++ b/src/make_accessor_class_hash.ksh @@ -12,7 +12,7 @@ EOF cat grib_accessor_factory_hash_list | sed 's/\/\*/#/g' >> accessor_class_list.gperf -p4 edit grib_accessor_classes_hash.c +# editing grib_accessor_classes_hash.c gperf -W classes -t -G -H grib_accessor_classes_get_id -N grib_accessor_classes_hash -m 1 -j 1 accessor_class_list.gperf | sed s/__inline//g | sed s/inline//g > grib_accessor_classes_hash.c diff --git a/src/make_class.pl b/src/make_class.pl index 820563287..99c871eab 100755 --- a/src/make_class.pl +++ b/src/make_class.pl @@ -72,7 +72,7 @@ foreach $name ( @ARGV ) if(compare_text("$name.tmp",$name)) { print "UPDATING file $name\n"; - system("p4 edit $name") unless(-w $name); + system("chmod +w $name") unless(-w $name); cp($name,"$name.old") or die "cp($name,$name.old): $!"; cp("$name.tmp",$name) or die "cp($name.tmp,$name): $!"; } @@ -211,7 +211,7 @@ EOF if(-f $file) { local $_; - system("p4 edit $file") unless(-w $file); + system("chmmod +w $file") unless(-w $file); open(F,"<$file") or die "$file: $!"; while() diff --git a/src/make_hash_keys.ksh b/src/make_hash_keys.ksh index f9503c43e..0ba46d1aa 100755 --- a/src/make_hash_keys.ksh +++ b/src/make_hash_keys.ksh @@ -7,7 +7,7 @@ cd ../tests cd ../src -p4 edit keys grib_hash_keys.c +# Editing keys grib_hash_keys.c gperf -I -t -G -H hash_keys -N grib_keys_hash_get -m 3 ../tests/keys | sed s/__inline//g | sed s/inline//g > grib_hash_keys.c