From c63a86d35ece81a22fb7f6cc42ec37f26b5f3167 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Thu, 18 Nov 2021 10:13:30 -0800 Subject: [PATCH 01/21] Update setup-Linux-debian-9.sh --- build-aux/setup-Linux-debian-9.sh | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 79dfb3fb8..caa721e6b 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -5,23 +5,23 @@ apt-get -q update apt-get -q install tzdata -y -# install python 3.7 -apt-get -q install software-properties-common -y -apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y -cd /tmp -curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz -tar -xf Python-3.7.3.tar.xz -cd Python-3.7.3 -./configure --enable-optimizations --enable-shared CXXFLAGS="-fPIC" -make -j10 altinstall -cd /usr/local/bin -ln -s python3.7 python3 -ln -s python3.7m-config python3-config -ln -s pip3.7 pip3 - -# install python libraries by validation -pip3 -q install --upgrade pip -pip -q install pandas matplotlib mysql-client Pillow +# python3.9.x support needed as of 4.2 + if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version | cut -f-2 -d.) != "Python 3.9" ]; thenapt-get -q install software-properties-common -y + apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libbz2-dev libssl-dev libreadline-dev libffi-dev curl -y + cd /tmp + curl https://www.python.org/ftp/python/3.9.6/Python-3.9/6.tgz | tar xz + cd Python-3.9/6 + ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" + make -j $(nproc) + make altinstall + ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 + ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config + ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc + ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle + ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 + curl -sSL https://bootstrap.pypa.io/get-pip.py | /usr/local/bin/python3 + /usr/local/bin/python3 pip -m install mysql-connector mysql-client matplotlib numpy pandas Pillow networkx +fi # install system build tools needed by gridlabd apt-get -q install git -y From 4960d81551ff215575c868ec202fc5e1b37dc55c Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Fri, 19 Nov 2021 06:23:20 -0800 Subject: [PATCH 02/21] Update setup-Linux-debian-9.sh --- build-aux/setup-Linux-debian-9.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index caa721e6b..742e4e4b0 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -7,7 +7,7 @@ apt-get -q install tzdata -y # python3.9.x support needed as of 4.2 if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version | cut -f-2 -d.) != "Python 3.9" ]; thenapt-get -q install software-properties-common -y - apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libbz2-dev libssl-dev libreadline-dev libffi-dev curl -y + apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libbz2-dev libssl-dev libreadline-dev libffi-dev liblzma-dev curl -y cd /tmp curl https://www.python.org/ftp/python/3.9.6/Python-3.9/6.tgz | tar xz cd Python-3.9/6 From c74119395f43540cc11f88081930e3eb34acaf68 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 15:23:37 -0800 Subject: [PATCH 03/21] add setup-Linux-debian-11.sh --- Dockerfile | 15 +++++ build-aux/setup-Linux-debian-11.sh | 92 ++++++++++++++++++++++++++++++ build-aux/setup-Linux-debian-9.sh | 59 ++++++++++++------- 3 files changed, 145 insertions(+), 21 deletions(-) create mode 100644 Dockerfile create mode 100644 build-aux/setup-Linux-debian-11.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d76801b7a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:9 +RUN apt-get -q update +RUN apt-get -q install tzdata -y + +RUN apt-get -q install software-properties-common -y +RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y + +# install system build tools needed by gridlabd + +RUN apt-get -q install git -y +WORKDIR /usr/local/src +RUN git clone -b develop https://github.com/slacgismo/gridlabd.git +WORKDIR /usr/local/src/gridlabd +COPY ./build-aux/setup-Linux-debian-9.sh ./build-aux/setup-Linux-debian-9.sh +RUN ./install.sh -v -t --parallel \ No newline at end of file diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh new file mode 100644 index 000000000..1475011e5 --- /dev/null +++ b/build-aux/setup-Linux-debian-11.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +# Install needed system tools +# update first +apt-get -q update +apt-get -q install tzdata -y + +apt-get -q install software-properties-common -y +apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y + +# install system build tools needed by gridlabd + +apt-get -q install git -y +apt-get -q install unzip -y +apt-get -q install autoconf -y +apt-get -q install libtool -y +apt-get -q install g++ -y +apt-get -q install cmake -y +apt-get -q install flex -y +apt-get -q install bison -y +apt-get -q install libcurl4-gnutls-dev -y +apt-get -q install subversion -y +apt-get -q install util-linux -y +apt-get install liblzma-dev -y +apt-get install libbz2-dev -y +apt-get install libncursesw5-dev -y +apt-get install xz-utils -y + +# Install python 3.9.6 +# python3 support needed as of 4.2 +if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Python 3.9.6" ]; then + echo "install python 3.9.6" + cd /usr/local/src + + curl https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz | tar xz + # tar xzf Python-3.9.6.tgz + cd Python-3.9.6 + + ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" + + make -j $(nproc) + make altinstall + /sbin/ldconfig /usr/local/lib + ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 + ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config + ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc + ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle + ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 + /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3 + /usr/local/bin/python3 -m pip install IPython censusdata +fi + + + +# doxgygen +apt-get -q install gawk -y +if [ ! -x /usr/bin/doxygen ]; then + if [ ! -d /usr/local/src/doxygen ]; then + git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen + fi + if [ ! -d /usr/local/src/doxygen/build ]; then + mkdir /usr/local/src/doxygen/build + fi + cd /usr/local/src/doxygen/build + cmake -G "Unix Makefiles" .. + make + make install +fi + +# # mono + +if [ ! -f /usr/bin/mono ]; then + cd /tmp + apt install apt-transport-https dirmngr gnupg ca-certificates -y + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + apt-get -q update -y + apt-get -q install mono-devel -y +fi + +# natural_docs +if [ ! -x /usr/local/bin/natural_docs ]; then + cd /usr/local + curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip + unzip -qq natural_docs + rm -f natural_docs.zip + mv Natural\ Docs natural_docs + echo '#!/bin/bash +mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs + chmod a+x /usr/local/bin/natural_docs +fi + diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 742e4e4b0..1475011e5 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -5,25 +5,11 @@ apt-get -q update apt-get -q install tzdata -y -# python3.9.x support needed as of 4.2 - if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version | cut -f-2 -d.) != "Python 3.9" ]; thenapt-get -q install software-properties-common -y - apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libbz2-dev libssl-dev libreadline-dev libffi-dev liblzma-dev curl -y - cd /tmp - curl https://www.python.org/ftp/python/3.9.6/Python-3.9/6.tgz | tar xz - cd Python-3.9/6 - ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" - make -j $(nproc) - make altinstall - ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 - ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config - ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc - ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle - ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 - curl -sSL https://bootstrap.pypa.io/get-pip.py | /usr/local/bin/python3 - /usr/local/bin/python3 pip -m install mysql-connector mysql-client matplotlib numpy pandas Pillow networkx -fi +apt-get -q install software-properties-common -y +apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y # install system build tools needed by gridlabd + apt-get -q install git -y apt-get -q install unzip -y apt-get -q install autoconf -y @@ -33,8 +19,38 @@ apt-get -q install cmake -y apt-get -q install flex -y apt-get -q install bison -y apt-get -q install libcurl4-gnutls-dev -y -apt-get -q install libncurses5-dev -y apt-get -q install subversion -y +apt-get -q install util-linux -y +apt-get install liblzma-dev -y +apt-get install libbz2-dev -y +apt-get install libncursesw5-dev -y +apt-get install xz-utils -y + +# Install python 3.9.6 +# python3 support needed as of 4.2 +if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Python 3.9.6" ]; then + echo "install python 3.9.6" + cd /usr/local/src + + curl https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz | tar xz + # tar xzf Python-3.9.6.tgz + cd Python-3.9.6 + + ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" + + make -j $(nproc) + make altinstall + /sbin/ldconfig /usr/local/lib + ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 + ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config + ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc + ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle + ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 + /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3 + /usr/local/bin/python3 -m pip install IPython censusdata +fi + + # doxgygen apt-get -q install gawk -y @@ -51,12 +67,13 @@ if [ ! -x /usr/bin/doxygen ]; then make install fi -# mono -apt-get -q install curl -y +# # mono + if [ ! -f /usr/bin/mono ]; then cd /tmp + apt install apt-transport-https dirmngr gnupg ca-certificates -y apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb http://download.mono-project.com/repo/ubuntu wheezy/snapshots/4.8.0 main" | tee /etc/apt/sources.list.d/mono-official.list + echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list apt-get -q update -y apt-get -q install mono-devel -y fi From a016b42d2b53babdc2eab1fe433d5c4e72dcb0e2 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 17:00:24 -0800 Subject: [PATCH 04/21] add --enable-share --- Dockerfile | 5 +++-- build-aux/setup-Linux-debian-11.sh | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 build-aux/setup-Linux-debian-11.sh diff --git a/Dockerfile b/Dockerfile index d76801b7a..ee1a3d516 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:9 +FROM debian:11 RUN apt-get -q update RUN apt-get -q install tzdata -y @@ -11,5 +11,6 @@ RUN apt-get -q install git -y WORKDIR /usr/local/src RUN git clone -b develop https://github.com/slacgismo/gridlabd.git WORKDIR /usr/local/src/gridlabd -COPY ./build-aux/setup-Linux-debian-9.sh ./build-aux/setup-Linux-debian-9.sh +COPY ./build-aux/setup-Linux-debian-11.sh ./build-aux/setup-Linux-debian-11.sh +RUN chmod +rxw ./build-aux/setup-Linux-debian-11.sh RUN ./install.sh -v -t --parallel \ No newline at end of file diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh old mode 100644 new mode 100755 index 1475011e5..5dcb4b06c --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -36,7 +36,7 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Py # tar xzf Python-3.9.6.tgz cd Python-3.9.6 - ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" + ./configure --prefix=/usr/local --enable-shared --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" make -j $(nproc) make altinstall @@ -67,7 +67,7 @@ if [ ! -x /usr/bin/doxygen ]; then make install fi -# # mono +# # # mono if [ ! -f /usr/bin/mono ]; then cd /tmp @@ -78,7 +78,7 @@ if [ ! -f /usr/bin/mono ]; then apt-get -q install mono-devel -y fi -# natural_docs +# # natural_docs if [ ! -x /usr/local/bin/natural_docs ]; then cd /usr/local curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip From 281b4717cf659848aad0920f75e3b22b8e8c8be6 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 17:20:48 -0800 Subject: [PATCH 05/21] remove temporary test Dockerfile --- Dockerfile | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ee1a3d516..000000000 --- a/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM debian:11 -RUN apt-get -q update -RUN apt-get -q install tzdata -y - -RUN apt-get -q install software-properties-common -y -RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y - -# install system build tools needed by gridlabd - -RUN apt-get -q install git -y -WORKDIR /usr/local/src -RUN git clone -b develop https://github.com/slacgismo/gridlabd.git -WORKDIR /usr/local/src/gridlabd -COPY ./build-aux/setup-Linux-debian-11.sh ./build-aux/setup-Linux-debian-11.sh -RUN chmod +rxw ./build-aux/setup-Linux-debian-11.sh -RUN ./install.sh -v -t --parallel \ No newline at end of file From 582b1e931cc3007d98171af24d8a153ba36389f7 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 19:32:46 -0800 Subject: [PATCH 06/21] add install latex --- Dockerfile | 16 ++++++++++++++++ build-aux/setup-Linux-debian-11.sh | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9f406a6bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM debian:11 +RUN apt-get -q update +RUN apt-get -q install tzdata -y + +RUN apt-get -q install software-properties-common -y +RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y + +# install system build tools needed by gridlabd + +RUN apt-get -q install git -y +WORKDIR /usr/local/src +RUN git clone -b develop https://github.com/slacgismo/gridlabd.git +WORKDIR /usr/local/src/gridlabd +COPY ./build-aux/setup-Linux-debian-11.sh ./build-aux/setup-Linux-debian-11.sh +RUN chmod +rxw ./build-aux/setup-Linux-debian-11.sh +# RUN ./install.sh -v -t --parallel \ No newline at end of file diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh index 5dcb4b06c..8c7544d5b 100755 --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -51,6 +51,10 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Py fi +# install latex +apt-get install texlive-base +apt-get install biblatex +apt-get install texlive-fonts-recommended # doxgygen apt-get -q install gawk -y From 43d40d4edf998e25cb8de852f4b4b330c5d36955 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 20:10:30 -0800 Subject: [PATCH 07/21] comment out unnecessary installation to speed up test in windows debian --- build-aux/setup-Linux-debian-10.sh | 3 +- build-aux/setup-Linux-debian-11.sh | 77 +++++++++++++++--------------- build-aux/setup-Linux-debian-9.sh | 3 +- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 1475011e5..4412b44e9 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -50,7 +50,8 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Py /usr/local/bin/python3 -m pip install IPython censusdata fi - +# install latex +apt-get install texlive -y # doxgygen apt-get -q install gawk -y diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh index 8c7544d5b..da5bdde97 100755 --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -51,46 +51,45 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Py fi -# install latex -apt-get install texlive-base -apt-get install biblatex -apt-get install texlive-fonts-recommended - -# doxgygen -apt-get -q install gawk -y -if [ ! -x /usr/bin/doxygen ]; then - if [ ! -d /usr/local/src/doxygen ]; then - git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen - fi - if [ ! -d /usr/local/src/doxygen/build ]; then - mkdir /usr/local/src/doxygen/build - fi - cd /usr/local/src/doxygen/build - cmake -G "Unix Makefiles" .. - make - make install -fi +# # install latex +# apt-get install texlive -y -# # # mono -if [ ! -f /usr/bin/mono ]; then - cd /tmp - apt install apt-transport-https dirmngr gnupg ca-certificates -y - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list - apt-get -q update -y - apt-get -q install mono-devel -y -fi +# # doxgygen +# apt-get -q install gawk -y +# if [ ! -x /usr/bin/doxygen ]; then +# if [ ! -d /usr/local/src/doxygen ]; then +# git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen +# fi +# if [ ! -d /usr/local/src/doxygen/build ]; then +# mkdir /usr/local/src/doxygen/build +# fi +# cd /usr/local/src/doxygen/build +# cmake -G "Unix Makefiles" .. +# make +# make install +# fi -# # natural_docs -if [ ! -x /usr/local/bin/natural_docs ]; then - cd /usr/local - curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip - unzip -qq natural_docs - rm -f natural_docs.zip - mv Natural\ Docs natural_docs - echo '#!/bin/bash -mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs - chmod a+x /usr/local/bin/natural_docs -fi +# # # # mono + +# if [ ! -f /usr/bin/mono ]; then +# cd /tmp +# apt install apt-transport-https dirmngr gnupg ca-certificates -y +# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +# echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list +# apt-get -q update -y +# apt-get -q install mono-devel -y +# fi + +# # # natural_docs +# if [ ! -x /usr/local/bin/natural_docs ]; then +# cd /usr/local +# curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip +# unzip -qq natural_docs +# rm -f natural_docs.zip +# mv Natural\ Docs natural_docs +# echo '#!/bin/bash +# mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs +# chmod a+x /usr/local/bin/natural_docs +# fi diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 1475011e5..4412b44e9 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -50,7 +50,8 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Py /usr/local/bin/python3 -m pip install IPython censusdata fi - +# install latex +apt-get install texlive -y # doxgygen apt-get -q install gawk -y From ac436ed1e04cff62e10794e92330db2159f172fa Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 21:36:16 -0800 Subject: [PATCH 08/21] set default timezone to fix window wsl/debian timezone missing issue --- build-aux/setup-Linux-debian-10.sh | 10 ++++++++-- build-aux/setup-Linux-debian-11.sh | 15 +++++++++++++-- build-aux/setup-Linux-debian-9.sh | 11 +++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 4412b44e9..b85a4e976 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -3,7 +3,13 @@ # Install needed system tools # update first apt-get -q update -apt-get -q install tzdata -y +# Set default timezone as America/Pacific +# In windows wsl/debain, the default timezone is etc/GMT+X +# The ETC timezone will causes installation error +export DEBIAN_FRONTEND=noninteractive +ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +apt-get install -y tzdata +dpkg-reconfigure --frontend noninteractive tzdata apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y @@ -28,7 +34,7 @@ apt-get install xz-utils -y # Install python 3.9.6 # python3 support needed as of 4.2 -if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Python 3.9.6" ]; then +if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f2 -d.)" != "Python 3.9" ]; then echo "install python 3.9.6" cd /usr/local/src diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh index da5bdde97..a1db530fb 100755 --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -1,9 +1,20 @@ #!/bin/bash + + # Install needed system tools # update first apt-get -q update -apt-get -q install tzdata -y +# apt-get -q install tzdata -y + +# Set default timezone as America/Pacific +# In windows wsl/debain, the default timezone is etc/GMT+X +# The ETC timezone will causes installation error +export DEBIAN_FRONTEND=noninteractive +ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +apt-get install -y tzdata +dpkg-reconfigure --frontend noninteractive tzdata + apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y @@ -28,7 +39,7 @@ apt-get install xz-utils -y # Install python 3.9.6 # python3 support needed as of 4.2 -if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Python 3.9.6" ]; then +if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f2 -d.)" != "Python 3.9" ]; then echo "install python 3.9.6" cd /usr/local/src diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 4412b44e9..95e505337 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -3,7 +3,14 @@ # Install needed system tools # update first apt-get -q update -apt-get -q install tzdata -y + +# Set default timezone as America/Pacific +# In windows wsl/debain, the default timezone is etc/GMT+X +# The ETC timezone will causes installation error +export DEBIAN_FRONTEND=noninteractive +ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +apt-get install -y tzdata +dpkg-reconfigure --frontend noninteractive tzdata apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y @@ -28,7 +35,7 @@ apt-get install xz-utils -y # Install python 3.9.6 # python3 support needed as of 4.2 -if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version)" != "Python 3.9.6" ]; then +if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f2 -d.)" != "Python 3.9" ]; then echo "install python 3.9.6" cd /usr/local/src From 1b5c25d1498ff21feea180f2e110cde979b12951 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Tue, 18 Jan 2022 21:39:29 -0800 Subject: [PATCH 09/21] change debian 10 setup --- build-aux/setup-Linux-debian-10.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index b85a4e976..95e505337 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -3,6 +3,7 @@ # Install needed system tools # update first apt-get -q update + # Set default timezone as America/Pacific # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error From 67bbef5607eea66da81491aeeb86fa4ad9fe96a4 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Wed, 19 Jan 2022 00:20:02 -0800 Subject: [PATCH 10/21] change timezone los angeles --- build-aux/setup-Linux-debian-10.sh | 2 +- build-aux/setup-Linux-debian-11.sh | 2 +- build-aux/setup-Linux-debian-9.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 95e505337..7332c49d0 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -8,7 +8,7 @@ apt-get -q update # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime apt-get install -y tzdata dpkg-reconfigure --frontend noninteractive tzdata diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh index a1db530fb..660cb4bd2 100755 --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -11,7 +11,7 @@ apt-get -q update # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime apt-get install -y tzdata dpkg-reconfigure --frontend noninteractive tzdata diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 95e505337..7332c49d0 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -8,7 +8,7 @@ apt-get -q update # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Pacific /etc/localtime +ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime apt-get install -y tzdata dpkg-reconfigure --frontend noninteractive tzdata From b70805217b5fca03e2e361911386d8d5c679d279 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Wed, 19 Jan 2022 01:04:24 -0800 Subject: [PATCH 11/21] pass validataion on windows/wsl/debian:11,restore natural_docs , mono and doxgygen --- build-aux/setup-Linux-debian-11.sh | 82 +++++++++++++++--------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh index 660cb4bd2..1b8b54a34 100755 --- a/build-aux/setup-Linux-debian-11.sh +++ b/build-aux/setup-Linux-debian-11.sh @@ -62,45 +62,45 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f fi -# # install latex -# apt-get install texlive -y - - -# # doxgygen -# apt-get -q install gawk -y -# if [ ! -x /usr/bin/doxygen ]; then -# if [ ! -d /usr/local/src/doxygen ]; then -# git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen -# fi -# if [ ! -d /usr/local/src/doxygen/build ]; then -# mkdir /usr/local/src/doxygen/build -# fi -# cd /usr/local/src/doxygen/build -# cmake -G "Unix Makefiles" .. -# make -# make install -# fi - -# # # # mono - -# if [ ! -f /usr/bin/mono ]; then -# cd /tmp -# apt install apt-transport-https dirmngr gnupg ca-certificates -y -# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -# echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list -# apt-get -q update -y -# apt-get -q install mono-devel -y -# fi - -# # # natural_docs -# if [ ! -x /usr/local/bin/natural_docs ]; then -# cd /usr/local -# curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip -# unzip -qq natural_docs -# rm -f natural_docs.zip -# mv Natural\ Docs natural_docs -# echo '#!/bin/bash -# mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs -# chmod a+x /usr/local/bin/natural_docs -# fi +# install latex +apt-get install texlive -y + + +# doxgygen +apt-get -q install gawk -y +if [ ! -x /usr/bin/doxygen ]; then + if [ ! -d /usr/local/src/doxygen ]; then + git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen + fi + if [ ! -d /usr/local/src/doxygen/build ]; then + mkdir /usr/local/src/doxygen/build + fi + cd /usr/local/src/doxygen/build + cmake -G "Unix Makefiles" .. + make + make install +fi + +# # mono + +if [ ! -f /usr/bin/mono ]; then + cd /tmp + apt install apt-transport-https dirmngr gnupg ca-certificates -y + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + apt-get -q update -y + apt-get -q install mono-devel -y +fi + +# # natural_docs +if [ ! -x /usr/local/bin/natural_docs ]; then + cd /usr/local + curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip + unzip -qq natural_docs + rm -f natural_docs.zip + mv Natural\ Docs natural_docs + echo '#!/bin/bash +mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs + chmod a+x /usr/local/bin/natural_docs +fi From c0522c260ae530232193dfb672e3ac05c6c1d11b Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Wed, 19 Jan 2022 01:04:55 -0800 Subject: [PATCH 12/21] remove temporary Dockerfile --- Dockerfile | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9f406a6bf..000000000 --- a/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM debian:11 -RUN apt-get -q update -RUN apt-get -q install tzdata -y - -RUN apt-get -q install software-properties-common -y -RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y - -# install system build tools needed by gridlabd - -RUN apt-get -q install git -y -WORKDIR /usr/local/src -RUN git clone -b develop https://github.com/slacgismo/gridlabd.git -WORKDIR /usr/local/src/gridlabd -COPY ./build-aux/setup-Linux-debian-11.sh ./build-aux/setup-Linux-debian-11.sh -RUN chmod +rxw ./build-aux/setup-Linux-debian-11.sh -# RUN ./install.sh -v -t --parallel \ No newline at end of file From 7e9c6faf4787f2bcebabe37029f53fc544234e75 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Wed, 19 Jan 2022 09:13:05 -0800 Subject: [PATCH 13/21] delete setup-Linux-debian-11.sh in this PR and move to new PR --- build-aux/setup-Linux-debian-11.sh | 106 ----------------------------- 1 file changed, 106 deletions(-) delete mode 100755 build-aux/setup-Linux-debian-11.sh diff --git a/build-aux/setup-Linux-debian-11.sh b/build-aux/setup-Linux-debian-11.sh deleted file mode 100755 index 1b8b54a34..000000000 --- a/build-aux/setup-Linux-debian-11.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - - - -# Install needed system tools -# update first -apt-get -q update -# apt-get -q install tzdata -y - -# Set default timezone as America/Pacific -# In windows wsl/debain, the default timezone is etc/GMT+X -# The ETC timezone will causes installation error -export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime -apt-get install -y tzdata -dpkg-reconfigure --frontend noninteractive tzdata - - -apt-get -q install software-properties-common -y -apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y - -# install system build tools needed by gridlabd - -apt-get -q install git -y -apt-get -q install unzip -y -apt-get -q install autoconf -y -apt-get -q install libtool -y -apt-get -q install g++ -y -apt-get -q install cmake -y -apt-get -q install flex -y -apt-get -q install bison -y -apt-get -q install libcurl4-gnutls-dev -y -apt-get -q install subversion -y -apt-get -q install util-linux -y -apt-get install liblzma-dev -y -apt-get install libbz2-dev -y -apt-get install libncursesw5-dev -y -apt-get install xz-utils -y - -# Install python 3.9.6 -# python3 support needed as of 4.2 -if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f2 -d.)" != "Python 3.9" ]; then - echo "install python 3.9.6" - cd /usr/local/src - - curl https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz | tar xz - # tar xzf Python-3.9.6.tgz - cd Python-3.9.6 - - ./configure --prefix=/usr/local --enable-shared --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC" - - make -j $(nproc) - make altinstall - /sbin/ldconfig /usr/local/lib - ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 - ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config - ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc - ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle - ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 - /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3 - /usr/local/bin/python3 -m pip install IPython censusdata -fi - - -# install latex -apt-get install texlive -y - - -# doxgygen -apt-get -q install gawk -y -if [ ! -x /usr/bin/doxygen ]; then - if [ ! -d /usr/local/src/doxygen ]; then - git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen - fi - if [ ! -d /usr/local/src/doxygen/build ]; then - mkdir /usr/local/src/doxygen/build - fi - cd /usr/local/src/doxygen/build - cmake -G "Unix Makefiles" .. - make - make install -fi - -# # mono - -if [ ! -f /usr/bin/mono ]; then - cd /tmp - apt install apt-transport-https dirmngr gnupg ca-certificates -y - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list - apt-get -q update -y - apt-get -q install mono-devel -y -fi - -# # natural_docs -if [ ! -x /usr/local/bin/natural_docs ]; then - cd /usr/local - curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip - unzip -qq natural_docs - rm -f natural_docs.zip - mv Natural\ Docs natural_docs - echo '#!/bin/bash -mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs - chmod a+x /usr/local/bin/natural_docs -fi - From f0806357abf961bc85cd1506205ae4e734dd429c Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Thu, 20 Jan 2022 10:09:44 -0800 Subject: [PATCH 14/21] update set local timezone from --- build-aux/setup-Linux-debian-10.sh | 2 +- build-aux/setup-Linux-debian-9.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 7332c49d0..e2ee18369 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -8,7 +8,7 @@ apt-get -q update # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime +ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime apt-get install -y tzdata dpkg-reconfigure --frontend noninteractive tzdata diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 7332c49d0..4ad35792f 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -8,7 +8,8 @@ apt-get -q update # In windows wsl/debain, the default timezone is etc/GMT+X # The ETC timezone will causes installation error export DEBIAN_FRONTEND=noninteractive -ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime +# set local timezone from web +ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime apt-get install -y tzdata dpkg-reconfigure --frontend noninteractive tzdata From 77c7ae4ce86a89414d112969ef76e76b29a06a95 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Thu, 20 Jan 2022 11:57:42 -0800 Subject: [PATCH 15/21] add condition to determine local timezone. If local timezone is Etc/..., enforcing user to set local time zone --- build-aux/setup-Linux-debian-10.sh | 12 ++++++------ build-aux/setup-Linux-debian-9.sh | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index e2ee18369..8c011553e 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -5,12 +5,12 @@ apt-get -q update # Set default timezone as America/Pacific -# In windows wsl/debain, the default timezone is etc/GMT+X -# The ETC timezone will causes installation error -export DEBIAN_FRONTEND=noninteractive -ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime -apt-get install -y tzdata -dpkg-reconfigure --frontend noninteractive tzdata +# In windows wsl/debain, the default timezone is Etc/GMT+X +# Enforce user to update local timezone +if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + dpkg-reconfigure tzdata +fi + apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 4ad35792f..8c011553e 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -5,13 +5,12 @@ apt-get -q update # Set default timezone as America/Pacific -# In windows wsl/debain, the default timezone is etc/GMT+X -# The ETC timezone will causes installation error -export DEBIAN_FRONTEND=noninteractive -# set local timezone from web -ln -snf /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime -apt-get install -y tzdata -dpkg-reconfigure --frontend noninteractive tzdata +# In windows wsl/debain, the default timezone is Etc/GMT+X +# Enforce user to update local timezone +if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + dpkg-reconfigure tzdata +fi + apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y From c2000da44a4756f4686847b06a3e5826c297a7b5 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Thu, 20 Jan 2022 11:59:44 -0800 Subject: [PATCH 16/21] update comments --- build-aux/setup-Linux-debian-10.sh | 2 +- build-aux/setup-Linux-debian-9.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 8c011553e..7eb28c6c2 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -4,7 +4,7 @@ # update first apt-get -q update -# Set default timezone as America/Pacific + # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 8c011553e..048155710 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -4,14 +4,12 @@ # update first apt-get -q update -# Set default timezone as America/Pacific # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then dpkg-reconfigure tzdata fi - apt-get -q install software-properties-common -y apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y From f328f914c91ab198260cdd34dfcf230c3bbfddac Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Fri, 21 Jan 2022 01:37:58 -0800 Subject: [PATCH 17/21] add install dialog --- build-aux/setup-Linux-debian-10.sh | 2 ++ build-aux/setup-Linux-debian-9.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 7eb28c6c2..b53481b4f 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -8,6 +8,8 @@ apt-get -q update # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + apt-get install dialog -y + export DEBIAN_FRONTEND=dialog dpkg-reconfigure tzdata fi diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 048155710..8891dbec6 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -7,6 +7,8 @@ apt-get -q update # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + apt-get install dialog -y + export DEBIAN_FRONTEND=dialog dpkg-reconfigure tzdata fi From 7f149b00bda8fd42c917a0c7bd4f5f7c84917e1b Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Fri, 21 Jan 2022 10:46:44 -0800 Subject: [PATCH 18/21] fix arrow key broken in shell dialog seleciton --- build-aux/setup-Linux-debian-10.sh | 3 ++- build-aux/setup-Linux-debian-9.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index b53481b4f..a7c88df84 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -7,7 +7,8 @@ apt-get -q update # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone -if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then +if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + chsh -s /bin/bash apt-get install dialog -y export DEBIAN_FRONTEND=dialog dpkg-reconfigure tzdata diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 8891dbec6..467f2c7af 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -7,6 +7,7 @@ apt-get -q update # In windows wsl/debain, the default timezone is Etc/GMT+X # Enforce user to update local timezone if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + chsh -s /bin/bash apt-get install dialog -y export DEBIAN_FRONTEND=dialog dpkg-reconfigure tzdata From 36db951a0435adac4d23bc9b2c950396b6dafe35 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Mon, 24 Jan 2022 00:00:27 -0800 Subject: [PATCH 19/21] add setup timezone from web, if httpcode is not 200, set as deault timezone as UTC/GMT --- build-aux/setup-Linux-debian-10.sh | 29 ++++++--- build-aux/setup-Linux-debian-9.sh | 99 +++++++++++++++++------------- 2 files changed, 76 insertions(+), 52 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index a7c88df84..32095d5b8 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -5,18 +5,29 @@ apt-get -q update -# In windows wsl/debain, the default timezone is Etc/GMT+X -# Enforce user to update local timezone -if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then - chsh -s /bin/bash - apt-get install dialog -y - export DEBIAN_FRONTEND=dialog - dpkg-reconfigure tzdata +apt-get install tzdata -y +apt-get install curl -y +apt-get install apt-utils -y + +# "Etc" will cause installation error +if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then + # get time zone from URL + URL="https://ipapi.co/timezone" + response=$(curl -s -w "%{http_code}" $URL) + http_code=$(tail -n1 <<< "${response: -3}") # get the last 3 digits + if [ $http_code == "200" ]; then + time_zone=$(sed 's/.\{3\}$//' <<< "${response}") # remove the last 3 digits + echo "successful get timezone from $URL , Set time zone as $time_zone" + ln -fs /usr/share/zoneinfo/$time_zone /etc/localtime + else + echo "Can not get timezone from $URL , http_code is $http_code " + echo "Set default time zone as UTC/GMT. " + ln -fs /usr/share/zoneinfo/UTC/GMT /etc/localtime + fi fi - apt-get -q install software-properties-common -y -apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y +apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev -y # install system build tools needed by gridlabd diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index 467f2c7af..fabde61d8 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -4,17 +4,29 @@ # update first apt-get -q update -# In windows wsl/debain, the default timezone is Etc/GMT+X -# Enforce user to update local timezone +apt-get install tzdata -y +apt-get install curl -y +apt-get install apt-utils -y + +# "Etc" will cause installation error if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then - chsh -s /bin/bash - apt-get install dialog -y - export DEBIAN_FRONTEND=dialog - dpkg-reconfigure tzdata + # get time zone from URL + URL="https://ipapi.co/timezone" + response=$(curl -s -w "%{http_code}" $URL) + http_code=$(tail -n1 <<< "${response: -3}") # get the last 3 digits + if [ $http_code == "200" ]; then + time_zone=$(sed 's/.\{3\}$//' <<< "${response}") # remove the last 3 digits + echo "successful get timezone from $URL , Set time zone as $time_zone" + ln -fs /usr/share/zoneinfo/$time_zone /etc/localtime + else + echo "Can not get timezone from $URL , http_code is $http_code " + echo "Set default time zone as UTC/GMT. " + ln -fs /usr/share/zoneinfo/UTC/GMT /etc/localtime + fi fi apt-get -q install software-properties-common -y -apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl -y +apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev -y # install system build tools needed by gridlabd @@ -54,48 +66,49 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 + /usr/local/bin/python3 -m pip install --upgrade pip /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3 /usr/local/bin/python3 -m pip install IPython censusdata fi -# install latex -apt-get install texlive -y +# # install latex +# apt-get install texlive -y -# doxgygen -apt-get -q install gawk -y -if [ ! -x /usr/bin/doxygen ]; then - if [ ! -d /usr/local/src/doxygen ]; then - git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen - fi - if [ ! -d /usr/local/src/doxygen/build ]; then - mkdir /usr/local/src/doxygen/build - fi - cd /usr/local/src/doxygen/build - cmake -G "Unix Makefiles" .. - make - make install -fi +# # doxgygen +# apt-get -q install gawk -y +# if [ ! -x /usr/bin/doxygen ]; then +# if [ ! -d /usr/local/src/doxygen ]; then +# git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen +# fi +# if [ ! -d /usr/local/src/doxygen/build ]; then +# mkdir /usr/local/src/doxygen/build +# fi +# cd /usr/local/src/doxygen/build +# cmake -G "Unix Makefiles" .. +# make +# make install +# fi -# # mono +# # # mono -if [ ! -f /usr/bin/mono ]; then - cd /tmp - apt install apt-transport-https dirmngr gnupg ca-certificates -y - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list - apt-get -q update -y - apt-get -q install mono-devel -y -fi +# if [ ! -f /usr/bin/mono ]; then +# cd /tmp +# apt install apt-transport-https dirmngr gnupg ca-certificates -y +# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +# echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list +# apt-get -q update -y +# apt-get -q install mono-devel -y +# fi -# natural_docs -if [ ! -x /usr/local/bin/natural_docs ]; then - cd /usr/local - curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip - unzip -qq natural_docs - rm -f natural_docs.zip - mv Natural\ Docs natural_docs - echo '#!/bin/bash -mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs - chmod a+x /usr/local/bin/natural_docs -fi +# # natural_docs +# if [ ! -x /usr/local/bin/natural_docs ]; then +# cd /usr/local +# curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip +# unzip -qq natural_docs +# rm -f natural_docs.zip +# mv Natural\ Docs natural_docs +# echo '#!/bin/bash +# mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs +# chmod a+x /usr/local/bin/natural_docs +# fi From 08ff871844778ed1fd54e59610f98e73ab29a77d Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Mon, 24 Jan 2022 00:12:15 -0800 Subject: [PATCH 20/21] pass installation docker/debian9 --- build-aux/setup-Linux-debian-9.sh | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index fabde61d8..dc1c4f1d0 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -72,43 +72,43 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f fi # # install latex -# apt-get install texlive -y - -# # doxgygen -# apt-get -q install gawk -y -# if [ ! -x /usr/bin/doxygen ]; then -# if [ ! -d /usr/local/src/doxygen ]; then -# git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen -# fi -# if [ ! -d /usr/local/src/doxygen/build ]; then -# mkdir /usr/local/src/doxygen/build -# fi -# cd /usr/local/src/doxygen/build -# cmake -G "Unix Makefiles" .. -# make -# make install -# fi - -# # # mono - -# if [ ! -f /usr/bin/mono ]; then -# cd /tmp -# apt install apt-transport-https dirmngr gnupg ca-certificates -y -# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -# echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list -# apt-get -q update -y -# apt-get -q install mono-devel -y -# fi - -# # natural_docs -# if [ ! -x /usr/local/bin/natural_docs ]; then -# cd /usr/local -# curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip -# unzip -qq natural_docs -# rm -f natural_docs.zip -# mv Natural\ Docs natural_docs -# echo '#!/bin/bash -# mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs -# chmod a+x /usr/local/bin/natural_docs -# fi +apt-get install texlive -y + +# doxgygen +apt-get -q install gawk -y +if [ ! -x /usr/bin/doxygen ]; then + if [ ! -d /usr/local/src/doxygen ]; then + git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen + fi + if [ ! -d /usr/local/src/doxygen/build ]; then + mkdir /usr/local/src/doxygen/build + fi + cd /usr/local/src/doxygen/build + cmake -G "Unix Makefiles" .. + make + make install +fi + +# # mono + +if [ ! -f /usr/bin/mono ]; then + cd /tmp + apt install apt-transport-https dirmngr gnupg ca-certificates -y + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + echo "deb https://download.mono-project.com/repo/debian stable-bustergrid main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + apt-get -q update -y + apt-get -q install mono-devel -y +fi + +# natural_docs +if [ ! -x /usr/local/bin/natural_docs ]; then + cd /usr/local + curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip + unzip -qq natural_docs + rm -f natural_docs.zip + mv Natural\ Docs natural_docs + echo '#!/bin/bash +mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs + chmod a+x /usr/local/bin/natural_docs +fi From 65f1ff455d6a98d70626a0016f4a8961cb0c5e38 Mon Sep 17 00:00:00 2001 From: JimmyLeu76 Date: Mon, 24 Jan 2022 01:05:41 -0800 Subject: [PATCH 21/21] update check if /etc/timezone exit --- build-aux/setup-Linux-debian-10.sh | 7 ++++++- build-aux/setup-Linux-debian-9.sh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build-aux/setup-Linux-debian-10.sh b/build-aux/setup-Linux-debian-10.sh index 32095d5b8..c3aed698c 100755 --- a/build-aux/setup-Linux-debian-10.sh +++ b/build-aux/setup-Linux-debian-10.sh @@ -10,7 +10,7 @@ apt-get install curl -y apt-get install apt-utils -y # "Etc" will cause installation error -if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then +if [ ! -f /etc/timezone -o "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then # get time zone from URL URL="https://ipapi.co/timezone" response=$(curl -s -w "%{http_code}" $URL) @@ -24,6 +24,10 @@ if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then echo "Set default time zone as UTC/GMT. " ln -fs /usr/share/zoneinfo/UTC/GMT /etc/localtime fi + + export DEBIAN_FRONTEND=noninteractive + apt-get install -y tzdata + dpkg-reconfigure --frontend noninteractive tzdata fi apt-get -q install software-properties-common -y @@ -67,6 +71,7 @@ if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3 + /usr/local/bin/python3 -m pip install --upgrade pip /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3 /usr/local/bin/python3 -m pip install IPython censusdata fi diff --git a/build-aux/setup-Linux-debian-9.sh b/build-aux/setup-Linux-debian-9.sh index dc1c4f1d0..40557d93e 100755 --- a/build-aux/setup-Linux-debian-9.sh +++ b/build-aux/setup-Linux-debian-9.sh @@ -8,8 +8,9 @@ apt-get install tzdata -y apt-get install curl -y apt-get install apt-utils -y + # "Etc" will cause installation error -if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then +if [ ! -f /etc/timezone -o "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then # get time zone from URL URL="https://ipapi.co/timezone" response=$(curl -s -w "%{http_code}" $URL) @@ -23,6 +24,10 @@ if [ "$(cat /etc/timezone | cut -f1 -d'/')" == "Etc" ]; then echo "Set default time zone as UTC/GMT. " ln -fs /usr/share/zoneinfo/UTC/GMT /etc/localtime fi + + export DEBIAN_FRONTEND=noninteractive + apt-get install -y tzdata + dpkg-reconfigure --frontend noninteractive tzdata fi apt-get -q install software-properties-common -y