From db923f4ced83770459a7ce8c20dcccca54e7fe2b Mon Sep 17 00:00:00 2001 From: Yilin Li <14196547+Lee2655@user.noreply.gitee.com> Date: Wed, 20 Mar 2024 08:48:06 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20build=5Fiflow.sh.=20=E9=92=88?= =?UTF-8?q?=E5=AF=B9build=5Fiflow.sh=E7=9A=84=E4=BF=AE=E6=94=B9=E5=A6=82?= =?UTF-8?q?=E4=B8=8B=EF=BC=9A=20=20=20=20=201.=20=E5=AF=B9=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81sudo=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=8A=A0=E5=85=A5=E4=BA=86if=E5=88=A4=E6=96=AD=20=20?= =?UTF-8?q?=20=20=202.=20=E5=A2=9E=E5=8A=A0=E4=BA=86wget=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20=20=20=20=203.=20=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E5=AF=B9`mkdir`=E5=91=BD=E4=BB=A4=E6=98=AF=E5=90=A6=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=89=A7=E8=A1=8C=E7=9A=84=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yilin Li <14196547+Lee2655@user.noreply.gitee.com> --- build_iflow.sh | 63 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/build_iflow.sh b/build_iflow.sh index 2f27f25..63835b9 100755 --- a/build_iflow.sh +++ b/build_iflow.sh @@ -39,27 +39,52 @@ export IFLOW_MIRROR_URL source $IFLOW_SHELL_DIR/common.sh # essential package -RUN sudo apt install build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y - +if [ `whoami` = "root" ]; then + RUN apt install wget build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y +else + RUN sudo apt install wget build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y +fi # tcl -RUN sudo apt install tcl-dev -y -RUN sudo cp -f /usr/include/tcl8.6/*.h /usr/include/ -RUN sudo ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so +if [ `whoami` = "root" ]; then + apt install tcl-dev -y + cp -f /usr/include/tcl8.6/*.h /usr/include/ + ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so +else + RUN sudo apt install tcl-dev -y + RUN sudo cp -f /usr/include/tcl8.6/*.h /usr/include/ + RUN sudo ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so +fi # lemon -CHECK_DIR /usr/local/include/lemon ||\ -{ - RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz - RUN tar zxvf lemon-1.3.1.tar.gz - RUN cd lemon-1.3.1 - RUN mkdir build - RUN cd build - RUN cmake .. - RUN make -j$IFLOW_BUILD_THREAD_NUM - RUN sudo make install - RUN cd ../../ - RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz -} +if [ `whoami` = "root" ]; then + CHECK_DIR /usr/local/include/lemon ||\ + { + RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz + RUN tar zxvf lemon-1.3.1.tar.gz + RUN cd lemon-1.3.1 + CHECK_DIR build || RUN mkdir build + RUN cd build + RUN cmake .. + RUN make -j$IFLOW_BUILD_THREAD_NUM + RUN make install + RUN cd ../../ + RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz + } +else + CHECK_DIR /usr/local/include/lemon ||\ + { + RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz + RUN tar zxvf lemon-1.3.1.tar.gz + RUN cd lemon-1.3.1 + CHECK_DIR build || RUN mkdir build + RUN cd build + RUN cmake .. + RUN make -j$IFLOW_BUILD_THREAD_NUM + RUN sudo make install + RUN cd ../../ + RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz + } +fi # update iFlow RUN cd $IFLOW_ROOT_DIR @@ -69,4 +94,4 @@ RUN git pull origin master RUN $IFLOW_SHELL_DIR/install_tools.sh # link iEDA lib -echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:'$IFLOW_TOOLS_DIR'/iEDA_0.1/lib' >> ~/.bashrc +echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:'$IFLOW_TOOLS_DIR'/iEDA_0.1/lib' >> ~/.bashrc \ No newline at end of file -- Gitee From ba5caceb8c16e29a5152463b39e3ac91d60fbe2c Mon Sep 17 00:00:00 2001 From: Yilin Li Date: Wed, 20 Mar 2024 14:26:51 +0000 Subject: [PATCH 2/3] =?UTF-8?q?update=20scripts/shell/common.sh.=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0RUN=5FROOT()=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=89=B9=E6=AE=8A=E6=9D=83=E9=99=90=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8C=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=B9=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/shell/common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/shell/common.sh b/scripts/shell/common.sh index a63cf1d..2a86e13 100755 --- a/scripts/shell/common.sh +++ b/scripts/shell/common.sh @@ -31,4 +31,13 @@ function RUN() echo "[iFlow Warning] Exec '$*' failed, retry..." && sleep 1 fi done +} + +function RUN_ROOT() +{ + if [ `whoami` = "root" ]; then + RUN $* + else + RUN sudo $* + fi } \ No newline at end of file -- Gitee From 427114c39bbe5de1d65cdf1cf81308fcb27a278d Mon Sep 17 00:00:00 2001 From: Yilin Li Date: Wed, 20 Mar 2024 14:29:29 +0000 Subject: [PATCH 3/3] =?UTF-8?q?update=20build=5Fiflow.sh.=20=E5=88=A0?= =?UTF-8?q?=E6=8E=89=E4=BA=86=E7=94=A8=E4=BA=8E=E5=88=A4=E6=96=AD=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9D=83=E9=99=90=E7=9A=84=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yilin Li --- build_iflow.sh | 60 ++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/build_iflow.sh b/build_iflow.sh index 63835b9..0a2abab 100755 --- a/build_iflow.sh +++ b/build_iflow.sh @@ -39,52 +39,26 @@ export IFLOW_MIRROR_URL source $IFLOW_SHELL_DIR/common.sh # essential package -if [ `whoami` = "root" ]; then - RUN apt install wget build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y -else - RUN sudo apt install wget build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y -fi +RUN_ROOT apt install wget build-essential clang libreadline-dev bison flex libffi-dev cmake libboost-all-dev swig klayout libeigen3-dev libspdlog-dev -y # tcl -if [ `whoami` = "root" ]; then - apt install tcl-dev -y - cp -f /usr/include/tcl8.6/*.h /usr/include/ - ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so -else - RUN sudo apt install tcl-dev -y - RUN sudo cp -f /usr/include/tcl8.6/*.h /usr/include/ - RUN sudo ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so -fi +RUN_ROOT apt install tcl-dev -y +RUN_ROOT cp -f /usr/include/tcl8.6/*.h /usr/include/ +RUN_ROOT ln -s -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/x86_64-linux-gnu/libtcl8.5.so # lemon -if [ `whoami` = "root" ]; then - CHECK_DIR /usr/local/include/lemon ||\ - { - RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz - RUN tar zxvf lemon-1.3.1.tar.gz - RUN cd lemon-1.3.1 - CHECK_DIR build || RUN mkdir build - RUN cd build - RUN cmake .. - RUN make -j$IFLOW_BUILD_THREAD_NUM - RUN make install - RUN cd ../../ - RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz - } -else - CHECK_DIR /usr/local/include/lemon ||\ - { - RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz - RUN tar zxvf lemon-1.3.1.tar.gz - RUN cd lemon-1.3.1 - CHECK_DIR build || RUN mkdir build - RUN cd build - RUN cmake .. - RUN make -j$IFLOW_BUILD_THREAD_NUM - RUN sudo make install - RUN cd ../../ - RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz - } -fi +CHECK_DIR /usr/local/include/lemon ||\ +{ + RUN wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz + RUN tar zxvf lemon-1.3.1.tar.gz + RUN cd lemon-1.3.1 + CHECK_DIR build || RUN mkdir build + RUN cd build + RUN cmake .. + RUN make -j$IFLOW_BUILD_THREAD_NUM + RUN_ROOT make install + RUN cd ../../ + RUN rm -rf lemon-1.3.1 lemon-1.3.1.tar.gz +} # update iFlow RUN cd $IFLOW_ROOT_DIR -- Gitee