diff --git a/distro/scripts/adl_cots.sh b/distro/scripts/adl_cots.sh
index 15c7fc8fde0f0123acbf8ce397c2a0310c330cf1..dae8ff45f0a8678fbfac4ec328082ac4e48569fa 100755
--- a/distro/scripts/adl_cots.sh
+++ b/distro/scripts/adl_cots.sh
@@ -474,7 +474,8 @@ nagg(){
     cd hdf5_HL_REGION*  && \
     export HDF5_INSTALL_DIR=${USER_COTS_PATH}/lib  && \
     export LDFLAGS=" -static -L${USER_COTS_PATH}/lib "  && \
- 
+    export CPPFLAGS=" -I${USER_COTS_PATH}/include "${CPPFLAGS}
+    export LIBS="-L${USER_COTS_PATH}/lib -lhdf5"
     ls ${USER_COTS_PATH}/lib
     make
     make install
@@ -488,8 +489,7 @@ nagg(){
     ls ${USER_COTS_PATH}/include
     cd nagg-1.6.2  && \
     patch -p1 <  ${COTS_HOME}/scripts/revised_nagg.patch   && \
-    export CPPFLAGS=" -I${USER_COTS_PATH}/include "${CPPFLAGS}
-    export LIBS="-L${USER_COTS_PATH}/lib -lhdf5"
+
     ./configure --help
     ./configure  --prefix=${USER_COTS_PATH}   --exec-prefix=${USER_COTS_PATH} --with-hlregion=${USER_COTS_PATH}/lib   && \
     make   && \