From 4a90e9eaf0a59b66db1187cf892b083b01ac2034 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Mon, 27 Feb 2012 07:13:50 +0000 Subject: added optional multistresstest target, slightly extended multistresstest git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2174 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- src/Makefile.am | 3 +++ src/Makefile.in | 14 ++++++++++++-- src/multistresstest.c | 22 +++++++++++++++++----- 3 files changed, 32 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index b8d0e952..97e9e833 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,5 @@ bin_PROGRAMS = proj nad2bin geod cs2cs +EXTRA_PROGRAMS = multistresstest INCLUDES = -DPROJ_LIB=\"$(pkgdatadir)\" \ -DMUTEX_@MUTEX_SETTING@ @JNI_INCLUDE@ @@ -11,11 +12,13 @@ proj_SOURCES = proj.c gen_cheb.c p_series.c cs2cs_SOURCES = cs2cs.c gen_cheb.c p_series.c nad2bin_SOURCES = nad2bin.c geod_SOURCES = geod.c geod_set.c geod_for.c geod_inv.c geodesic.h +multistresstest_SOURCES = multistresstest.c proj_LDADD = libproj.la cs2cs_LDADD = libproj.la nad2bin_LDADD = libproj.la geod_LDADD = libproj.la +multistresstest_LDADD = libproj.la -lpthread lib_LTLIBRARIES = libproj.la diff --git a/src/Makefile.in b/src/Makefile.in index 3d3281ba..412bd0bd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -38,6 +38,7 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = proj$(EXEEXT) nad2bin$(EXEEXT) geod$(EXEEXT) \ cs2cs$(EXEEXT) +EXTRA_PROGRAMS = multistresstest$(EXEEXT) subdir = src DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/proj_config.h.in @@ -119,6 +120,9 @@ am_geod_OBJECTS = geod.$(OBJEXT) geod_set.$(OBJEXT) geod_for.$(OBJEXT) \ geod_inv.$(OBJEXT) geod_OBJECTS = $(am_geod_OBJECTS) geod_DEPENDENCIES = libproj.la +am_multistresstest_OBJECTS = multistresstest.$(OBJEXT) +multistresstest_OBJECTS = $(am_multistresstest_OBJECTS) +multistresstest_DEPENDENCIES = libproj.la am_nad2bin_OBJECTS = nad2bin.$(OBJEXT) nad2bin_OBJECTS = $(am_nad2bin_OBJECTS) nad2bin_DEPENDENCIES = libproj.la @@ -139,9 +143,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libproj_la_SOURCES) $(cs2cs_SOURCES) $(geod_SOURCES) \ - $(nad2bin_SOURCES) $(proj_SOURCES) + $(multistresstest_SOURCES) $(nad2bin_SOURCES) $(proj_SOURCES) DIST_SOURCES = $(libproj_la_SOURCES) $(cs2cs_SOURCES) $(geod_SOURCES) \ - $(nad2bin_SOURCES) $(proj_SOURCES) + $(multistresstest_SOURCES) $(nad2bin_SOURCES) $(proj_SOURCES) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags @@ -271,10 +275,12 @@ proj_SOURCES = proj.c gen_cheb.c p_series.c cs2cs_SOURCES = cs2cs.c gen_cheb.c p_series.c nad2bin_SOURCES = nad2bin.c geod_SOURCES = geod.c geod_set.c geod_for.c geod_inv.c geodesic.h +multistresstest_SOURCES = multistresstest.c proj_LDADD = libproj.la cs2cs_LDADD = libproj.la nad2bin_LDADD = libproj.la geod_LDADD = libproj.la +multistresstest_LDADD = libproj.la -lpthread lib_LTLIBRARIES = libproj.la libproj_la_LDFLAGS = -no-undefined -version-info 7:0:7 libproj_la_SOURCES = \ @@ -451,6 +457,9 @@ cs2cs$(EXEEXT): $(cs2cs_OBJECTS) $(cs2cs_DEPENDENCIES) geod$(EXEEXT): $(geod_OBJECTS) $(geod_DEPENDENCIES) @rm -f geod$(EXEEXT) $(LINK) $(geod_OBJECTS) $(geod_LDADD) $(LIBS) +multistresstest$(EXEEXT): $(multistresstest_OBJECTS) $(multistresstest_DEPENDENCIES) + @rm -f multistresstest$(EXEEXT) + $(LINK) $(multistresstest_OBJECTS) $(multistresstest_LDADD) $(LIBS) nad2bin$(EXEEXT): $(nad2bin_OBJECTS) $(nad2bin_DEPENDENCIES) @rm -f nad2bin$(EXEEXT) $(LINK) $(nad2bin_OBJECTS) $(nad2bin_LDADD) $(LIBS) @@ -572,6 +581,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geod_set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jniproj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mk_cheby.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multistresstest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nad2bin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nad_cvt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nad_init.Plo@am__quote@ diff --git a/src/multistresstest.c b/src/multistresstest.c index 61cbc821..bb7dab21 100644 --- a/src/multistresstest.c +++ b/src/multistresstest.c @@ -33,19 +33,20 @@ #include "proj_api.h" #define num_threads 10 -#define num_iterations 100000 +#define num_iterations 1000000 #define reinit_every_iteration 0 typedef struct { const char *src_def; const char *dst_def; - int skip; - double src_x, src_y, src_z; double dst_x, dst_y, dst_z; int dst_error; + int skip; + + } TestItem; TestItem test_list[] = { @@ -57,6 +58,11 @@ TestItem test_list[] = { { "+proj=utm +zone=11 +datum=NAD83", "+proj=latlong +datum=NAD27", + 150000.0, 3000000.0, 0.0, + }, + { + "+proj=utm +zone=11 +datum=NAD83", + "+proj=latlong +nadgrids=@null +ellps=WGS84", 150000.0, 3000000.0, 0.0, }, { @@ -209,7 +215,6 @@ static void *TestThread( void *pData ) #if reinit_every_iteration == 0 for( i = 0; i < test_count; i++ ) { - TestItem *test = test_list + i; pj_free( src_pj_list[i] ); pj_free( dst_pj_list[i] ); } @@ -224,6 +229,8 @@ static void *TestThread( void *pData ) repeat_count, test_count ); active_thread_count--; + + return NULL; } /************************************************************************/ @@ -274,6 +281,10 @@ int main( int argc, char **argv ) pj_free( dst_pj ); test->skip = 0; + +#ifdef notdef + printf( "Test %d - output %.14g,%.14g,%g\n", i, test->dst_x, test->dst_y, test->dst_z ); +#endif } printf( "%d tests initialized.\n", test_count ); @@ -301,5 +312,6 @@ int main( int argc, char **argv ) sleep( 1 ); printf( "all tests complete.\n" ); - + + return 0; } -- cgit v1.2.3