Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Update setup-Linux-centos-8.sh #1048

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5da89a5
modify line 15 typo, and update Python 3.9.0 to 3.9.6
JimmyLeu76 Dec 29, 2021
d9a8524
remove python3.9.6.tgz
JimmyLeu76 Dec 29, 2021
d2f9c37
add IPython package and censusdata
JimmyLeu76 Dec 29, 2021
94c3d2c
fix python 3.9.6 path
JimmyLeu76 Dec 29, 2021
aeeab31
fix installation error of mono and python3.9.6
JimmyLeu76 Dec 29, 2021
110aca1
remote temporary files
JimmyLeu76 Dec 29, 2021
27ffdfe
modify setup-Linux-centos-8.sh
JimmyLeu76 Dec 29, 2021
e6cf123
modify setup-Linux-centos-8.sh
JimmyLeu76 Dec 30, 2021
fb5ec91
add temporary Dockerfile to simulate the centos8
JimmyLeu76 Dec 30, 2021
21efff5
try to fix a bug when perform a validation . Numpy need to be upgrade…
JimmyLeu76 Dec 31, 2021
986fb90
change numpy verion to 1.19.4
JimmyLeu76 Dec 31, 2021
63cbed3
fix a bug of validatin. numpy need to be upgrade after make install
JimmyLeu76 Dec 31, 2021
a902193
add test code to speed up debug
JimmyLeu76 Dec 31, 2021
35d5222
finalize fix setup-Linux-centos-8.sh
JimmyLeu76 Dec 31, 2021
201568f
fix missing
JimmyLeu76 Dec 31, 2021
ec49c67
add temporary Dockerfile to test
JimmyLeu76 Dec 31, 2021
b99f497
move yum install outside python3 installation
JimmyLeu76 Jan 3, 2022
03e072e
upgrade numpy after make system #951
JimmyLeu76 Jan 3, 2022
ddddec3
fix missing when running .install.sh with --parallel option #1044
JimmyLeu76 Jan 3, 2022
86f1bed
merge develop-fix-install-sh
JimmyLeu76 Jan 3, 2022
3c6722d
test intallation in centos and remove tempoaray Dockerfile
JimmyLeu76 Jan 3, 2022
dcaeaa0
remove numpy udate after make install
JimmyLeu76 Jan 3, 2022
a15a985
add temporary Dockerfile , numpy version has bug
JimmyLeu76 Jan 4, 2022
5942e37
modify temporary Dockerfile
JimmyLeu76 Jan 5, 2022
9b18779
modify assert assert >= '1.21.4'
JimmyLeu76 Jan 5, 2022
34e1665
change make install to make system, CDPATH="${ZSH_VERSION+.}:" && cd …
JimmyLeu76 Jan 5, 2022
99a30d6
add tempoaray Dockerfile with copy change files
JimmyLeu76 Jan 5, 2022
a0fe577
modify setup-Linux-centos-8.sh
JimmyLeu76 Jan 5, 2022
a008ddb
update matrix==1.22.0
JimmyLeu76 Jan 5, 2022
56238a1
test the setup-Linux-centos-8.sh and pass
JimmyLeu76 Jan 5, 2022
b9e5903
add test Dockerfile to test centos 8 installation
JimmyLeu76 Jan 5, 2022
3969d52
Merge branch 'develop' of https://github.com/slacgismo/gridlabd into …
JimmyLeu76 Jan 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM centos:8
# Install needed system tools
RUN yum install git -y
# RUN yum clean all
# RUN yum groupinstall "Development Tools" -y
# RUN yum install cmake -y
# RUN yum install ncurses-devel -y
# RUN yum install epel-release -y
# RUN yum install curl-devel -y
# RUN yum install which -y
# RUN yum install svn -y





# RUN yum install 'dnf-command(config-manager)' -y

# #RUN yum config-manager --set-enabled PowerTools # error
# #RUN yum install armadillo-devel -y #error

# # change directory
# WORKDIR "/usr/local/src"
# RUN yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel -y

# Install python 3.9.6
# RUN curl https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz > Python-3.9.6.tgz
# RUN tar xzf Python-3.9.6.tgz
# WORKDIR "/usr/local/src/Python-3.9.6"
# RUN ./configure --prefix=/usr/local --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions CFLAGS="-fPIC"
# RUN make -j 10
# RUN make altinstall
# RUN /sbin/ldconfig /usr/local/lib
# RUN ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3
# RUN ln -sf /usr/local/bin/python3.9-config /usr/local/bin/python3-config
# RUN ln -sf /usr/local/bin/pydoc3.9 /usr/local/bin/pydoc
# RUN ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle
# RUN ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3
# RUN pip3 install --upgrade pip

# RUN /usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3
# RUN /usr/local/bin/python3 -m pip install IPython censusdata
# # mac m1
# # RUN /usr/local/bin/python3 -m pip install shapely
# WORKDIR /usr/local/src
# RUN rm -f Python-3.9.6.tgz

# RUN export PYTHONPATH="."
# RUN export PATH=/usr/local/bin:$PATH
# RUN export MAKEFLAGS=-j20
# RUN export PYTHONSETUPFLAGS="-j 20"
# clone gridlabd
WORKDIR /usr/local/src
RUN git clone https://github.com/slacgismo/gridlabd
WORKDIR /usr/local/src/gridlabd
RUN rm -rf ./build-aux/setup-Linux-centos-8.sh
COPY ./build-aux/setup-Linux-centos-8.sh ./build-aux/setup-Linux-centos-8.sh
COPY ./requirements.txt ./requirements.txt
COPY ./gldcore/scripts/autotest/test_matrix.glm ./gldcore/scripts/autotest/test_matrix.glm
RUN chmod +rxw ./gldcore/scripts/autotest/test_matrix.glm
COPY ./gldcore/scripts/autotest/test_matrix_linalg.glm ./gldcore/scripts/autotest/test_matrix_linalg.glm
RUN chmod +rxw ./gldcore/scripts/autotest/test_matrix_linalg.glm
COPY ./gldcore/scripts/autotest/test_matrix_matlib.glm ./gldcore/scripts/autotest/test_matrix_matlib.glm
RUN chmod +rxw ./gldcore/scripts/autotest/test_matrix_matlib.glm
COPY ./gldcore/scripts/autotest/test_matrix_matrix.glm ./gldcore/scripts/autotest/test_matrix_matrix.glm
RUN chmod +rxw ./gldcore/scripts/autotest/test_matrix_matrix.glm
COPY ./gldcore/scripts/autotest/test_matrix_random.glm ./gldcore/scripts/autotest/test_matrix_random.glm
RUN chmod +rxw ./gldcore/scripts/autotest/test_matrix_random.glm
RUN chmod +rxw ./requirements.txt
RUN chmod +rxw ./build-aux/setup-Linux-centos-8.sh


COPY ./install.sh ./install.sh

# test install.sh
# RUN ./install.sh -v -t --parallel

# WORKDIR "/usr/local/src/gridlabd"
# RUN autoreconf -isf && ./configure
# RUN make -j6 system
63 changes: 44 additions & 19 deletions build-aux/setup-Linux-centos-8.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1,69 @@
#!/bin/bash

# Install needed system tools
yum -q update -y ;
yum -q clean all
yum -q groupinstall "Development Tools" -y
yum -q install cmake -y
yum -q install ncurses-devel -y
yum -q install epel-release -y
yum -q install curl-devel -y
yum -q install which -y
yum -q install svn -y
# chmod -R 775 /usr/local
# chown -R root:adm /usr/local

#Install needed system tools
yum clean all
yum groupinstall "Development Tools" -y
yum install cmake -y
yum install ncurses-devel -y
yum install epel-release -y
yum install curl-devel -y
yum install which -y
yum install svn -y

yum install 'dnf-command(config-manager)' -y




# change directory
# cd /usr/local/src
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel -y


# python3 support needed as of 4.2
if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version) != "Python 3.9.0" ]; then
yum -q install openssl-devel bzip2-devel libffi-devel zlib-devel -y
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.0/Python-3.9.0.tgz | tar xz
cd Python-3.9.0
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel -y
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
/usr/local/bin/python3 pip -m install mysql-connector matplotlib numpy pandas Pillow
# install python packages
/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
/usr/local/bin/python3 -m pip install IPython censusdata


fi

# latex
if [ ! -x /usr/bin/tex ]; then
yum -q install tex -y
fi

# doxygen
# # doxygen

if [ ! -x /usr/bin/doxygen ]; then
echo "install doxygen"
if [ ! -d /usr/local/src/doxygen ]; then
git clone https://github.com/doxygen/doxygen.git /usr/local/src/doxygen --depth 1
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
Expand All @@ -49,13 +72,15 @@ fi

# mono
if [ ! -f /usr/bin/mono ]; then
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
curl -s https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo

rpmkeys --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
yum -q install mono-devel -y
fi

# natural_docs
# # # natural_docs
if [ ! -x /usr/local/bin/natural_docs ]; then

cd /usr/local
curl -s https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip
unzip -qq natural_docs
Expand Down
2 changes: 1 addition & 1 deletion gldcore/scripts/autotest/test_matrix.glm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check numpy version (must be exactly the same to pass these tests)
#assert $(gridlabd matrix version) == '1.21.4'
#assert $(gridlabd matrix version) == '1.22.0'

// matrix operations test
#assert $(gridlabd matrix -f copy "1,2;3,4") == '1,2;3,4'
Expand Down
2 changes: 1 addition & 1 deletion gldcore/scripts/autotest/test_matrix_linalg.glm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check numpy version (must be exactly the same to pass these tests)
#assert $(gridlabd matrix version) == '1.21.4'
#assert $(gridlabd matrix version) == '1.22.0'

// linalg.cholesky <matrix>
#assert $(gridlabd matrix -f linalg.cholesky "1,2;-2,5") == '1,0;-2,1'
Expand Down
2 changes: 1 addition & 1 deletion gldcore/scripts/autotest/test_matrix_matlib.glm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#assert $(gridlabd matrix version) == '1.21.4'
#assert $(gridlabd matrix version) == '1.22.0'

// matlib.rand <intlist_args>
#assert ! -z "$(gridlabd matrix -f matlib.rand 1)"
Expand Down
2 changes: 1 addition & 1 deletion gldcore/scripts/autotest/test_matrix_matrix.glm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#assert $(gridlabd matrix version) == '1.21.4'
#assert $(gridlabd matrix version) == '1.22.0'

// matrix.all <matrix> axis=<int>
#assert $(gridlabd matrix -f matrix.all "1,2,3;4,5,6;") == '1'
Expand Down
2 changes: 1 addition & 1 deletion gldcore/scripts/autotest/test_matrix_random.glm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#assert $(gridlabd matrix version) == '1.21.4'
#assert $(gridlabd matrix version) == '1.22.0'

// random.choice <arrayorint> size=<intlist> replace=<boolstr> p=<array>
#assert ! -z $(gridlabd matrix -f random.choice "1,2,3,4,5")
Expand Down
6 changes: 4 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ if [ ! -f "configure" -o "$QUICK" == "no" ]; then
fi

NPROC=1
SYSTEM=$(uname -s)
if [ "$PARALLEL" == "yes" ]; then
if [ "$SYSTEM" == "Linux" ]; then
NPROC=$(lscpu | grep '^CPU(s):' | cut -f2- -d' ')
Expand All @@ -325,8 +326,9 @@ fi

# build everything
export PATH=/usr/local/bin:/usr/bin:/bin
run make -j$((3*$NPROC))
run make install
run make -j$((3*$NPROC)) system
# run make install

if [ "$DOCS" == "yes" ]; then
run make html
run cp -r "documents/html" "$INSTALL"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==3.3.3
numpy==1.21.4
numpy>=1.21.4
pytz==2020.4
PyGithub==1.54.1
docker==4.4.4
Expand Down