Repository: OPENDAP/bes
Pull request #1091: HYRAX-1751, adding the gen_dmrpp_sidecar tests to th…
Author: login: kyang2014
Created: 2025-05-09T18:09:29Z | Merged: 2025-05-22T21:39:29Z

…e integration test. Now the two python tests that generate dmrpp are integrated to the the BES testsuite. The most challenging part is to get "make distcheck" working.


Diff:
diff --git a/configure.ac b/configure.ac
index 3aeaa3c170..d605fa4871 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1124,6 +1124,7 @@ AM_COND_IF([DAP_BUILTIN_MODULES],
     modules/dmrpp_module/writer/Makefile
     modules/dmrpp_module/build_dmrpp_h4/Makefile
     modules/dmrpp_module/get_dmrpp/Makefile
+    modules/dmrpp_module/get_dmrpp/unit-tests/Makefile
 
     modules/fileout_json/Makefile
     modules/fileout_json/unit-tests/Makefile 
diff --git a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am
index 278af46c68..4d4e14677e 100644
--- a/modules/dmrpp_module/build_dmrpp_h4/Makefile.am
+++ b/modules/dmrpp_module/build_dmrpp_h4/Makefile.am
@@ -62,7 +62,7 @@ lib_besdir=$(libdir)/bes
 # libcmr_module_la_LIBADD = $(LIBADD)
 
 
-EXTRA_DIST =
+EXTRA_DIST = get_dmrpp_h4
 
 CLEANFILES = *~
 
diff --git a/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4 b/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4
index 89f5c38d61..a78866cf33 100755
--- a/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4
+++ b/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4
@@ -122,18 +122,32 @@ def generate_tmp_bes_conf_file(user_conf,out_conf):
         locate = shutil.which(bes_cmd)
         # print(locate)
 
-        # Remove the end characters, bin/besstandalone
-        locate_par_dir = locate[:len(locate) - 17]
-        # print(locate_par_dir)
-
-        locate_lib_path = locate_par_dir
-        if (locate_par_dir == '/usr/'):
-            if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
-                locate_lib_path = '/usr/lib64/bes/'
-            else:
-                locate_lib_path = '/usr/lib/bes/'
+        bin_bes_cmd = 'bin/besstandalone'
+        if (len(locate) <len(bes_cmd)):
+            print("Cannot locate besstandalone")
+            sys.exit(1)
+
+        # If it is not under ???/bin, we assume the modules are under the current directory.
+        # The assumption is mainly for "make distcheck" to work. 
+        if (len(locate) <len(bin_bes_cmd)):
+            locate_lib_path = os.getcwd()+'/'
         else:
-            locate_lib_path = locate_par_dir + 'lib/bes/'
+            if locate[len(locate)-len(bin_bes_cmd):len(locate)-len(bes_cmd)] != 'bin/':
+                locate_lib_path = os.getcwd()+'/'
+            else:
+                locate_par_dir = locate[:len(locate) - len(bin_bes_cmd)]
+                # Remove the end characters, bin/besstandalone
+                #locate_par_dir = locate[:len(locate) - 17]
+                print(locate_par_dir)
+
+                locate_lib_path = locate_par_dir
+                if (locate_par_dir == '/usr/'):
+                    if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
+                        locate_lib_path = '/usr/lib64/bes/'
+                    else:
+                        locate_lib_path = '/usr/lib/bes/'
+                else:
+                    locate_lib_path = locate_par_dir + 'lib/bes/'
 
         libdap_path = locate_lib_path + 'libdap_module.so'
         libdap_xml_path = locate_lib_path + 'libdap_xml_module.so'
@@ -144,6 +158,7 @@ def generate_tmp_bes_conf_file(user_conf,out_conf):
         has_all_modules = module_exist(libdap_path) and module_exist(libdap_xml_path) \
                           and module_exist(libhdf4_path)
         if (has_all_modules == False):
+            print("In get_dmrpp_h4")
             print("Some required modules don't exist; cannot generate the bes configuration file.")
             print("You may try the option -s to see if the system-provided BES configuration file works for you.")
             print("You may also try the option -u by providing your own BES configuration file.")
diff --git a/modules/dmrpp_module/get_dmrpp/Makefile.am b/modules/dmrpp_module/get_dmrpp/Makefile.am
index fd53c2a7b2..c6c7ae9f19 100644
--- a/modules/dmrpp_module/get_dmrpp/Makefile.am
+++ b/modules/dmrpp_module/get_dmrpp/Makefile.am
@@ -1,2 +1,8 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = unit-tests
 dist_bin_SCRIPTS = gen_dmrpp_side_car get_hdf_side_car get_dmrpp_h5
+
+
+	
 CLEANFILES =
diff --git a/modules/dmrpp_module/get_dmrpp/get_dmrpp_h5 b/modules/dmrpp_module/get_dmrpp/get_dmrpp_h5
index 47463f617b..248e571e12 100755
--- a/modules/dmrpp_module/get_dmrpp/get_dmrpp_h5
+++ b/modules/dmrpp_module/get_dmrpp/get_dmrpp_h5
@@ -122,19 +122,33 @@ def generate_tmp_bes_conf_file(user_conf,is_cf,out_conf):
         locate = shutil.which(bes_cmd)
         # print(locate)
 
-        # Remove the end characters, bin/besstandalone
-        locate_par_dir = locate[:len(locate) - 17]
-        # print(locate_par_dir)
-
-        locate_lib_path = locate_par_dir
-        if (locate_par_dir == '/usr/'):
-            if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
-                locate_lib_path = '/usr/lib64/bes/'
-            else:
-                locate_lib_path = '/usr/lib/bes/'
-        else:
-            locate_lib_path = locate_par_dir + 'lib/bes/'
+        bin_bes_cmd = 'bin/besstandalone'
+        if (len(locate) <len(bes_cmd)):
+            print("Cannot locate besstandalone")
+            sys.exit(1)
 
+        # If it is not under ???/bin, we assume the modules are under the current directory.
+        # The assumption is mainly for "make distcheck" to work now. 
+        if (len(locate) <len(bin_bes_cmd)):
+            locate_lib_path = os.getcwd()+'/'
+        else:
+            if locate[len(locate)-len(bin_bes_cmd):len(locate)-len(bes_cmd)] != 'bin/':
+                locate_lib_path = os.getcwd()+'/'
+            else:
+                locate_par_dir = locate[:len(locate) - len(bin_bes_cmd)]
+                # Remove the end characters, bin/besstandalone
+                #locate_par_dir = locate[:len(locate) - 17]
+                print(locate_par_dir)
+        
+                locate_lib_path = locate_par_dir
+                if (locate_par_dir == '/usr/'):
+                    if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
+                        locate_lib_path = '/usr/lib64/bes/'
+                    else:
+                        locate_lib_path = '/usr/lib/bes/'
+                else:
+                    locate_lib_path = locate_par_dir + 'lib/bes/'
+        
         libdap_path = locate_lib_path + 'libdap_module.so'
         libdap_xml_path = locate_lib_path + 'libdap_xml_module.so'
         libhdf5_path = locate_lib_path + 'libhdf5_module.so'
@@ -144,6 +158,7 @@ def generate_tmp_bes_conf_file(user_conf,is_cf,out_conf):
         has_all_modules = module_exist(libdap_path) and module_exist(libdap_xml_path) \
                           and module_exist(libhdf5_path)
         if (has_all_modules == False):
+            print("In get_dmrpp_h5: ")
             print("Some required modules don't exist; cannot generate the bes configuration file.")
             print("You may try the option -s to see if the system-provided BES configuration file works for you.")
             print("You may also try the option -u by providing your own BES configuration file.")
diff --git a/modules/dmrpp_module/get_dmrpp/get_hdf_side_car b/modules/dmrpp_module/get_dmrpp/get_hdf_side_car
index c25a29a50b..15875e97a5 100755
--- a/modules/dmrpp_module/get_dmrpp/get_hdf_side_car
+++ b/modules/dmrpp_module/get_dmrpp/get_hdf_side_car
@@ -64,18 +64,34 @@ def generate_tmp_bes_conf_file(enable_cf):
     locate = shutil.which(bes_cmd)
     # print(locate)
 
-    # Remove the end characters, bin/besstandalone
-    locate_par_dir = locate[:len(locate) - 17]
-    # print(locate_par_dir)
-
-    locate_lib_path = locate_par_dir
-    if (locate_par_dir == '/usr/'):
-        if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
-            locate_lib_path = '/usr/lib64/bes/'
-        else:
-            locate_lib_path = '/usr/lib/bes/'
+    bin_bes_cmd = 'bin/besstandalone'
+
+    if (len(locate) <len(bes_cmd)):
+        print("Cannot locate besstandalone")
+        sys.exit(1)
+
+    # If it is not under ???/bin, we assume the modules are under the current directory.
+    # The assumption is mainly for "make distcheck" to work now. 
+    if (len(locate) <len(bin_bes_cmd)):
+        locate_lib_path = os.getcwd()+'/'
     else:
-        locate_lib_path = locate_par_dir + 'lib/bes/'
+        if locate[len(locate)-len(bin_bes_cmd):len(locate)-len(bes_cmd)] != 'bin/':
+            locate_lib_path = os.getcwd()+'/'
+        else:
+            locate_par_dir = locate[:len(locate) - len(bin_bes_cmd)]
+            # Remove the end characters, bin/besstandalone
+            #locate_par_dir = locate[:len(locate) - 17]
+            print(locate_par_dir)
+            
+            locate_lib_path = locate_par_dir
+            if (locate_par_dir == '/usr/'):
+                if (os.path.isfile('/usr/lib64/bes/libdap_module.so') == True):
+                    locate_lib_path = '/usr/lib64/bes/'
+                else:
+                    locate_lib_path = '/usr/lib/bes/'
+            else:
+                locate_lib_path = locate_par_dir + 'lib/bes/'
+ 
 
     libdap_path = locate_lib_path + 'libdap_module.so'
     libdap_xml_path = locate_lib_path + 'libdap_xml_module.so'
@@ -88,6 +104,7 @@ def generate_tmp_bes_conf_file(enable_cf):
     has_all_modules = module_exist(libdap_path) and module_exist(libdap_xml_path) \
                       and module_exist(libhdf4_path)
     if (has_all_modules == False):
+        print(" In get_hdf_sidecar: ")
         print("Some required modules don't exist; cannot generate the bes configuration file.")
         sys.exit(1)
 
diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/Makefile.am b/modules/dmrpp_module/get_dmrpp/unit-tests/Makefile.am
new file mode 100644
index 0000000000..865034333a
--- /dev/null
+++ b/modules/dmrpp_module/get_dmrpp/unit-tests/Makefile.am
@@ -0,0 +1,57 @@
+AUTOMAKE_OPTIONS = foreign
+HDF_FILES = *.hdf
+HDF5_FILES = *.h5
+PYTHON_FILES = *.py
+BASELINE_FILES = *.baseline
+
+EXTRA_DIST = *.hdf *.h5 *.py *.baseline
+
+cp_build_script:
+	if test $(srcdir) != .; then \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/gen_dmrpp_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_hdf_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_dmrpp_h5 $(builddir); \
+	cp -f $(srcdir)/$(HDF_FILES) $(builddir); \
+	cp -f $(srcdir)/$(HDF5_FILES) $(builddir); \
+	cp -f $(srcdir)/$(PYTHON_FILES) $(builddir); \
+	cp -f $(srcdir)/$(BASELINE_FILES) $(builddir); \
+	cp -f $(abs_top_srcdir)/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4 $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf5_handler/.libs/libhdf5_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf4_handler/.libs/libhdf4_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/fileout_netcdf/.libs/libfonc_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/xmlcommand/.libs/libdap_xml_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/dap/.libs/libdap_module.so $(builddir); \
+	else \
+	cp -f  ../$(srcdir)/gen_dmrpp_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_hdf_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_dmrpp_h5 $(builddir); \
+	fi;
+
+check-local: check-local-gen-dmrpp 
+
+check-local-gen-dmrpp: cp_build_script
+
+check-local-gen-dmrpp:
+	if test $(srcdir) != .; then \
+	(PATH=$(abs_top_builddir)/modules/dmrpp_module:$(abs_top_builddir)/modules/dmrpp_module/build_dmrpp_h4:$(abs_top_builddir)/standalone:$(abs_builddir):$$PATH; python3 -m unittest gen_dmrpp_side_car_test) \
+	else \
+	python3 -m unittest gen_dmrpp_side_car_test; \
+        fi;
+
+clean-local:
+	rm -f $(builddir)/gen_dmrpp_side_car; \
+	rm -f $(builddir)/get_hdf_side_car; \
+	rm -f $(builddir)/get_dmrpp_h5; \
+	if test $(srcdir) != .; then \
+	rm -f $(builddir)/$(HDF_FILES); \
+	rm -f $(builddir)/$(HDF5_FILES); \
+	rm -f $(builddir)/$(PYTHON_FILES); \
+	rm -f $(builddir)/$(BASELINE_FILES); \
+	rm -f $(builddir)/get_dmrpp_h4; \
+	rm -f $(builddir)/libhdf5_module.so; \
+	rm -f $(builddir)/libhdf4_module.so; \
+	rm -f $(builddir)/libfonc_module.so; \
+	rm -f $(builddir)/libdap_xml_module.so; \
+	rm -f $(builddir)/libdap_module.so; \
+	rm -rf $(builddir)/__pycache__; \
+	fi;
diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py b/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py
index c52607710c..d541358e56 100644
--- a/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py
+++ b/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py
@@ -13,7 +13,7 @@ class TestSample(unittest.TestCase):
     def test_gen_dmrpp_side_car(self):
         
         print("Testing grid_2_2d_ps.hdf")
-        subprocess.run(["../gen_dmrpp_side_car", "-i", "grid_2_2d_ps.hdf","-H"])
+        subprocess.run(["./gen_dmrpp_side_car", "-i", "grid_2_2d_ps.hdf","-H"])
         result = filecmp.cmp("grid_2_2d_ps.hdf.dmrpp","grid_2_2d_ps.hdf.dmrpp.baseline")
         self.assertEqual(result ,True )
         subprocess.run(["rm", "-rf", "grid_2_2d_ps.hdf.dmrpp"])
@@ -23,7 +23,7 @@ def test_gen_dmrpp_side_car(self):
     def test_gen_dmrpp_side_car2(self):
         
         print("Testing grid_2_2d_sin.h5")
-        subprocess.run(["../gen_dmrpp_side_car", "-i", "grid_2_2d_sin.h5"])
+        subprocess.run(["./gen_dmrpp_side_car", "-i", "grid_2_2d_sin.h5"])
         with open('grid_2_2d_sin.h5.dmrpp') as f:
             dmrpp_lines_after_19 = f.readlines()[19:]
         with open('grid_2_2d_sin.h5.dmrpp.baseline') as f1:
diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline
index 7cd68dd227..9fa68b81d0 100644
--- a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline
+++ b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline
@@ -86,10 +86,10 @@ END
                 <Value>NPGrid eos_cf_projection</Value>
             </Attribute>
             <dmrpp:chunks fillValue="0" byteOrder="LE">
-                <dmrpp:chunk offset="9746" nBytes="1" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="9786" nBytes="1" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Byte>
-        <Float64 name="XDim">
+        <Float64 name="XDim_NPGrid">
             <Dim name="/XDim_NPGrid"/>
             <Attribute name="standard_name" type="String">
                 <Value>projection_x_coordinate</Value>
@@ -108,10 +108,10 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>4</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="9747" nBytes="33" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="9787" nBytes="33" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
-        <Float64 name="YDim">
+        <Float64 name="YDim_NPGrid">
             <Dim name="/YDim_NPGrid"/>
             <Attribute name="standard_name" type="String">
                 <Value>projection_y_coordinate</Value>
@@ -130,7 +130,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>5</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="9780" nBytes="38" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="9820" nBytes="38" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Float64 name="Latitude">
@@ -144,7 +144,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>5 4</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="9818" nBytes="171" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="9858" nBytes="171" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Float64 name="Longitude">
@@ -158,7 +158,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>5 4</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="9989" nBytes="171" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10029" nBytes="171" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Group name="Data_Fields">
@@ -208,10 +208,10 @@ END
                 <Value>SPGrid eos_cf_projection</Value>
             </Attribute>
             <dmrpp:chunks fillValue="0" byteOrder="LE">
-                <dmrpp:chunk offset="10160" nBytes="1" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10200" nBytes="1" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Byte>
-        <Float64 name="XDim">
+        <Float64 name="XDim_SPGrid">
             <Dim name="/XDim_SPGrid"/>
             <Attribute name="standard_name" type="String">
                 <Value>projection_x_coordinate</Value>
@@ -230,10 +230,10 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>3</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="10161" nBytes="26" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10201" nBytes="26" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
-        <Float64 name="YDim">
+        <Float64 name="YDim_SPGrid">
             <Dim name="/YDim_SPGrid"/>
             <Attribute name="standard_name" type="String">
                 <Value>projection_y_coordinate</Value>
@@ -252,7 +252,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>4</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="10187" nBytes="32" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10227" nBytes="32" chunkPositionInArray="[0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Float64 name="Latitude">
@@ -266,7 +266,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>4 3</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="10219" nBytes="83" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10259" nBytes="83" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Float64 name="Longitude">
@@ -280,7 +280,7 @@ END
             </Attribute>
             <dmrpp:chunks compressionType="deflate" deflateLevel="4" fillValue="0" byteOrder="LE">
                 <dmrpp:chunkDimensionSizes>4 3</dmrpp:chunkDimensionSizes>
-                <dmrpp:chunk offset="10302" nBytes="62" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
+                <dmrpp:chunk offset="10342" nBytes="62" chunkPositionInArray="[0,0]" href="grid_2_2d_ps.hdf_mvs.h5" />
             </dmrpp:chunks>
         </Float64>
         <Group name="Data_Fields">


Reviews:
user: login: jgallagher59701
body: I think the suggestion to the Makefile.am might help avoid 'random' behavior, but I'm not 100% sure it's needed. 
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-22T19:58:34Z
user: login: kyang2014
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-22T20:18:50Z

Review comments:
diff_hunk: @@ -0,0 +1,55 @@
+AUTOMAKE_OPTIONS = foreign
+HDF_FILES = *.hdf
+HDF5_FILES = *.h5
+PYTHON_FILES = *.py
+BASELINE_FILES = *.baseline
+
+EXTRA_DIST = *.hdf *.h5 *.py *.baseline
+
+cp_build_script:
+	if test $(srcdir) != .; then \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/gen_dmrpp_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_hdf_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_dmrpp_h5 $(builddir); \
+	cp -f $(srcdir)/$(HDF_FILES) $(builddir); \
+	cp -f $(srcdir)/$(HDF5_FILES) $(builddir); \
+	cp -f $(srcdir)/$(PYTHON_FILES) $(builddir); \
+	cp -f $(srcdir)/$(BASELINE_FILES) $(builddir); \
+	cp -f $(abs_top_srcdir)/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4 $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf5_handler/.libs/libhdf5_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf4_handler/.libs/libhdf4_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/fileout_netcdf/.libs/libfonc_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/xmlcommand/.libs/libdap_xml_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/dap/.libs/libdap_module.so $(builddir); \
+	else \
+	cp -f  ../$(srcdir)/gen_dmrpp_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_hdf_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_dmrpp_h5 $(builddir); \
+	fi;
+
+check-local: cp_build_script check-local-gen-dmrpp 
path: modules/dmrpp_module/get_dmrpp/unit-tests/Makefile.am
user: login: jgallagher59701
body: I was thinking about this and I _think_ it's OK, but it might be that a parallel make might build these two dependencies at the same time. That might be OK most of the time, but not always. A way to safeguard against that would be to make "cp_build_script" a dependency of the "check-local-gen-dmrpp" target. That would look like this:

```
check-local: check-local-gen-dmrpp 

check-local-gen-dmrpp: cp_build_script
    if test $(srcdir) != .; then \
    ...

```

So check-local depends on check-local-gen-dmrpp and check-local-gen-dmrpp depends on cp_build_script.

created_at: 2025-05-22T19:57:24Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,55 @@
+AUTOMAKE_OPTIONS = foreign
+HDF_FILES = *.hdf
+HDF5_FILES = *.h5
+PYTHON_FILES = *.py
+BASELINE_FILES = *.baseline
+
+EXTRA_DIST = *.hdf *.h5 *.py *.baseline
+
+cp_build_script:
+	if test $(srcdir) != .; then \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/gen_dmrpp_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_hdf_side_car $(builddir); \
+	cp -f `echo $(srcdir) | rev | cut -c 11- | rev`/get_dmrpp_h5 $(builddir); \
+	cp -f $(srcdir)/$(HDF_FILES) $(builddir); \
+	cp -f $(srcdir)/$(HDF5_FILES) $(builddir); \
+	cp -f $(srcdir)/$(PYTHON_FILES) $(builddir); \
+	cp -f $(srcdir)/$(BASELINE_FILES) $(builddir); \
+	cp -f $(abs_top_srcdir)/modules/dmrpp_module/build_dmrpp_h4/get_dmrpp_h4 $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf5_handler/.libs/libhdf5_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/hdf4_handler/.libs/libhdf4_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/modules/fileout_netcdf/.libs/libfonc_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/xmlcommand/.libs/libdap_xml_module.so $(builddir); \
+	cp -f $(abs_top_builddir)/dap/.libs/libdap_module.so $(builddir); \
+	else \
+	cp -f  ../$(srcdir)/gen_dmrpp_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_hdf_side_car $(builddir); \
+	cp -f  ../$(srcdir)/get_dmrpp_h5 $(builddir); \
+	fi;
+
+check-local: cp_build_script check-local-gen-dmrpp 
path: modules/dmrpp_module/get_dmrpp/unit-tests/Makefile.am
user: login: kyang2014
body: Will do and check. 
created_at: 2025-05-22T20:18:50Z
author_association: COLLABORATOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-22T21:35:54Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=opendap-bes-submodules&pullRequest=1091) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=opendap-bes-submodules&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=opendap-bes-submodules&pullRequest=1091&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=opendap-bes-submodules&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=opendap-bes-submodules&pullRequest=1091&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=opendap-bes-submodules&pullRequest=1091&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=opendap-bes-submodules&pullRequest=1091)


author_association: NONE
user: login: sonarqubecloud[bot]
created_at: 2025-05-22T21:36:03Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=opendap-bes-modules&pullRequest=1091) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=opendap-bes-modules&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=opendap-bes-modules&pullRequest=1091&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=opendap-bes-modules&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=opendap-bes-modules&pullRequest=1091&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=opendap-bes-modules&pullRequest=1091&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=opendap-bes-modules&pullRequest=1091)


author_association: NONE
user: login: sonarqubecloud[bot]
created_at: 2025-05-22T21:36:36Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=opendap-bes&pullRequest=1091) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=opendap-bes&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=opendap-bes&pullRequest=1091&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=opendap-bes&pullRequest=1091&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=opendap-bes&pullRequest=1091&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=opendap-bes&pullRequest=1091&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=opendap-bes&pullRequest=1091)


author_association: NONE