Skip to content

Commit

Permalink
Merge f0440d0 into 720574b
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerfraser committed Jul 29, 2021
2 parents 720574b + f0440d0 commit 0bece98
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 85 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/cmake_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:
# Build and test using shell script
- name: Build
run: |
cd ..
cp ./DynAdjust/resources/make_dynadjust_gcc.sh ./
chmod +x ./make_dynadjust_gcc.sh
./make_dynadjust_gcc.sh --no-install --auto --do-not-clone
chmod +x ./resources/make_dynadjust_gcc.sh
./resources/make_dynadjust_gcc.sh --no-install --auto --do-not-clone
6 changes: 2 additions & 4 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ jobs:
# Build and test using shell script
- name: Build and test
run: |
cd ..
cp ./DynAdjust/resources/make_dynadjust_gcc.sh ./
chmod +x ./make_dynadjust_gcc.sh
./make_dynadjust_gcc.sh --no-install --auto --do-not-clone --test
chmod +x ./resources/make_dynadjust_gcc.sh
./resources/make_dynadjust_gcc.sh --no-install --auto --do-not-clone --test
# Submit to coveralls
- name: Submit coverage to Coveralls
Expand Down
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ before_install:
- sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
- sudo apt-get update
- sudo apt-get install -y intel-mkl-64bit-2018.3-051
# - bash resources/install_dynadjust_prerequisites.sh -m 1

script:
- cd ..
- cp ./DynAdjust/resources/make_dynadjust_gcc.sh ./
- bash make_dynadjust_gcc.sh --no-install --auto --do-not-clone --test
- chmod +x ./resources/make_dynadjust_gcc.sh
- ./resources/make_dynadjust_gcc.sh --no-install --auto --no-clone --test

after_success:
- cd ./DynAdjust/dynadjust/
# - coveralls --root . -E ".*CMakeFiles.*"
# - coveralls --root . --verbose --exclude-pattern ".*feature_tests.*" --exclude-pattern ".*CompilerId.*" --gcov-options '\-lp'
- cd ./dynadjust/
- coveralls
--gcov /usr/bin/gcov
--exclude-pattern ".*feature_tests.*"
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update &&\
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install cpio intel-mkl-64bit-2018.3-051 &&\
chmod +x ./DynAdjust/resources/make_dynadjust_gcc.sh &&\
./DynAdjust/resources/make_dynadjust_gcc.sh
cd ./DynAdjust
chmod +x ./resources/make_dynadjust_gcc.sh &&\
./resources/make_dynadjust_gcc.sh

2 changes: 1 addition & 1 deletion dynadjust/dynadjust/dnaimport/dnaparser_pimpl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ void StationCoord_pimpl::pre()

void StationCoord_pimpl::Name(const ::std::string& Name)
{
_parent_dnaStn->SetName(Name);
//_parent_dnaStn->SetName(Name);
}

void StationCoord_pimpl::XAxis(const ::std::string& XAxis)
Expand Down
26 changes: 8 additions & 18 deletions dynadjust/include/io/dnaiosnxread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,24 +405,14 @@ void dna_io_snx::format_station_names(v_discontinuity_tuple* stn_discontinuities
year = _it_discont_site->date_start.year();
ss << siteOccurrence_.at(site).site_name << "_";

if (year == DISCONT_TIME_IMMEMORIAL)
{
// format using the start epoch
// year (4 chars)
ss << siteOccurrence_.at(site).formatted_date.substr(4, 4);
// doy (3 chars)
ss << siteOccurrence_.at(site).formatted_date.substr(0, 3);
}
else
{
// format using the discontinuity date
ss << year;
if (doy < 100)
ss << "0";
if (doy < 10)
ss << "0";
ss << doy;
}
// format date using the start of the window defining the
// period up to which a discontinuity has been identified
ss << year;
if (doy < 100)
ss << "0";
if (doy < 10)
ss << "0";
ss << doy;

siteOccurrence_.at(site).formatted_name = ss.str();
//TRACE("Site %s\n", siteOccurrence_.at(site).formatted_name.c_str());
Expand Down
60 changes: 50 additions & 10 deletions resources/install_dynadjust_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
#
#################################################################################


_distro_centos="CentOS Linux"
_distro_debian="Debian"
_distro_fedora="Fedora"
_distro_opensusel="openSUSE Leap"
_distro_opensuse="openSUSE"
_distro_rhels="Red Hat Enterprise Linux Server"
_distro_rhel="Red Hat Enterprise Linux"
_distro_ubuntu="Ubuntu"

#################################################################################
# Capture system variables and set defaults
Expand All @@ -27,6 +34,7 @@ _system=$(uname -sroi)
_script="install_dynadjust_prerequisites.sh"
_mode=0
_distribution=
_create_downloads_dir=0
#################################################################################


Expand All @@ -48,8 +56,14 @@ function help {
echo ""
usage
echo -e "options:"
echo -e " -d [ --distro ] arg The linux distribution, e.g. \"Ubuntu\", \"Fedora\", etc. "
echo -e " If not provided, try to get from /etc/os-release."
echo -e " -d [ --distro ] arg The linux distribution. Recognised distros include:"
echo -e " - ${_distro_centos}"
echo -e " - ${_distro_debian}"
echo -e " - ${_distro_fedora}"
echo -e " - ${_distro_opensuse}"
echo -e " - ${_distro_rhel}"
echo -e " - ${_distro_ubuntu}"
echo -e " If not provided, I will try to get the distro from /etc/os-release."
echo -e " -m [ --mode ] arg Mode of installing prerequisites:"
echo -e " 0: interactive (default)"
echo -e " 1: package manager"
Expand Down Expand Up @@ -99,20 +113,26 @@ function args_check {
if [[ ! -z $_distribution ]]; then
# Set distro based on first character
if [[ "$firstletter" = "C" ]]; then
_distro="CentOS Linux"
_distro=${_distro_centos}
elif [[ "$firstletter" = "R" ]]; then
_distro="Red Hat Enterprise Linux Server"
_distro=${_distro_rhel}
elif [[ "$firstletter" = "F" ]]; then
_distro="Fedora"
_distro=${_distro_fedora}
elif [[ "$firstletter" = "O" ]]; then
_distro="openSUSE"
_distro=${_distro_opensuse}
elif [[ "$firstletter" = "U" ]]; then
_distro="Ubuntu"
_distro=${_distro_ubuntu}
elif [[ "$firstletter" = "D" ]]; then
_distro="Debian"
_distro=${_distro_debian}
else
# error
echo -e "\nUnknown value: --distro $_distribution"
echo -e "\nerror: Unknown distribution: \"$_distribution\"\n"
echo -e " If your Linux distribution is based on a distro in the supported"
echo -e " list (e.g. Mint is based on Ubuntu), try running:"
echo -e " $ ${_script} -d base-distro\n"
echo -e " If this fails to work, please submit an issue at:"
echo -e " https://github.com/icsm-au/DynAdjust/issues including this message"
echo -e " and your distribution."
help
exit 1 # error
fi
Expand Down Expand Up @@ -397,6 +417,13 @@ elif [[ $REPLY == 2 ]]; then
sudo mkdir /opt/xerces-c/3.1.4
fi

if [[ ! -d "$DOWNLOADS_FOLDER_FULLPATH" ]]; then
mkdir "$DOWNLOADS_FOLDER_FULLPATH"
_create_downloads_dir=1
else
#echo -e "\n ${DOWNLOADS_FOLDER} exists"
fi

# 2. download:
echo "Downloading xerces-c 3.1.4..."
echo " "
Expand Down Expand Up @@ -435,6 +462,11 @@ elif [[ $REPLY == 2 ]]; then
if [[ -e "$XERCES_TMP_FILE" ]]; then
rm -f "$XERCES_TMP_FILE"
fi

if [[ _create_downloads_dir -eq 1 ]]; then
#echo -e "\n ${DOWNLOADS_FOLDER} removed"
rm -R "$DOWNLOADS_FOLDER_FULLPATH"
fi

else
echo " "
Expand Down Expand Up @@ -513,6 +545,9 @@ elif [[ $REPLY == 2 ]]; then

if [[ ! -d "$DOWNLOADS_FOLDER_FULLPATH" ]]; then
mkdir "$DOWNLOADS_FOLDER_FULLPATH"
_create_downloads_dir=1
else
#echo -e "\n ${DOWNLOADS_FOLDER} exists"
fi

# 2. download:
Expand Down Expand Up @@ -550,6 +585,11 @@ elif [[ $REPLY == 2 ]]; then
rm -f "$XSD_TMP_FILE"
fi

if [[ _create_downloads_dir -eq 1 ]]; then
#echo -e "\n ${DOWNLOADS_FOLDER} removed"
rm -R "$DOWNLOADS_FOLDER_FULLPATH"
fi

else
echo " "
echo "Skipping xsd installation."
Expand Down

0 comments on commit 0bece98

Please sign in to comment.