@@ -22,7 +22,7 @@ _equivalenceDeps() {
2222 cd yosys
2323 # use of no-register flag is required for some compilers,
2424 # e.g., gcc and clang from RHEL8
25- make -j $( nproc ) PREFIX=" ${yosysPrefix} " ABC_ARCHFLAGS=-Wno-register
25+ make -j ${numThreads} PREFIX=" ${yosysPrefix} " ABC_ARCHFLAGS=-Wno-register
2626 make install
2727 ) fi
2828
@@ -33,7 +33,7 @@ _equivalenceDeps() {
3333 git clone --depth=1 -b " ${yosysVersion} " https://github.com/YosysHQ/eqy
3434 cd eqy
3535 export PATH=" ${yosysPrefix} /bin:${PATH} "
36- make -j $( nproc ) PREFIX=" ${eqyPrefix} "
36+ make -j ${numThreads} PREFIX=" ${eqyPrefix} "
3737 make install PREFIX=" ${eqyPrefix} "
3838 )
3939 fi
@@ -45,7 +45,7 @@ _equivalenceDeps() {
4545 git clone --depth=1 -b " ${yosysVersion} " --recursive https://github.com/YosysHQ/sby
4646 cd sby
4747 export PATH=" ${eqyPrefix} /bin:${PATH} "
48- make -j $( nproc ) PREFIX=" ${sbyPrefix} " install
48+ make -j ${numThreads} PREFIX=" ${sbyPrefix} " install
4949 )
5050 fi
5151}
@@ -64,8 +64,8 @@ _installCommonDev() {
6464 cmakeVersionSmall=${cmakeVersionBig} .6
6565 pcreVersion=10.42
6666 pcreChecksum=" 37d2f77cfd411a3ddf1c64e1d72e43f7"
67- swigVersion=4.1 .0
68- swigChecksum=" 794433378154eb61270a3ac127d9c5f3 "
67+ swigVersion=4.3 .0
68+ swigChecksum=" 9f74c7f402aa28d9f75e67d1990ee6fb "
6969 boostVersionBig=1.86
7070 boostVersionSmall=${boostVersionBig} .0
7171 boostChecksum=" ac857d73bb754b718a039830b07b9624"
@@ -112,7 +112,7 @@ _installCommonDev() {
112112 tar xf bison-${bisonVersion} .tar.gz
113113 cd bison-${bisonVersion}
114114 ./configure --prefix=${bisonPrefix}
115- make -j install
115+ make -j ${numThreads} install
116116 echo " bison ${bisonVersion} installed (from ${bisonInstalledVersion} )."
117117 else
118118 echo " bison ${bisonVersion} already installed."
@@ -128,8 +128,8 @@ _installCommonDev() {
128128 tar xf flex-${flexVersion} .tar.gz
129129 cd flex-${flexVersion}
130130 ./configure --prefix=${flexPrefix}
131- make -j $( nproc )
132- make -j $( nproc ) install
131+ make -j ${numThreads}
132+ make -j ${numThreads} install
133133 else
134134 echo " Flex already installed."
135135 fi
@@ -154,8 +154,8 @@ _installCommonDev() {
154154 fi
155155 ./autogen.sh
156156 ./configure --prefix=${swigPrefix}
157- make -j $( nproc )
158- make -j $( nproc ) install
157+ make -j ${numThreads}
158+ make -j ${numThreads} install
159159 else
160160 echo " Swig already installed."
161161 fi
@@ -171,7 +171,7 @@ _installCommonDev() {
171171 tar -xf boost_${boostVersionUnderscore} .tar.gz
172172 cd boost_${boostVersionUnderscore}
173173 ./bootstrap.sh --prefix=" ${boostPrefix} "
174- ./b2 install --with-iostreams --with-test --with-serialization --with-system --with-thread -j $( nproc )
174+ ./b2 install --with-iostreams --with-test --with-serialization --with-system --with-thread -j ${numThreads}
175175 else
176176 echo " Boost already installed."
177177 fi
@@ -184,7 +184,7 @@ _installCommonDev() {
184184 git clone --depth=1 -b ${eigenVersion} https://gitlab.com/libeigen/eigen.git
185185 cd eigen
186186 ${cmakePrefix} /bin/cmake -DCMAKE_INSTALL_PREFIX=" ${eigenPrefix} " -B build .
187- ${cmakePrefix} /bin/cmake --build build -j $( nproc ) --target install
187+ ${cmakePrefix} /bin/cmake --build build -j ${numThreads} --target install
188188 else
189189 echo " Eigen already installed."
190190 fi
@@ -198,7 +198,7 @@ _installCommonDev() {
198198 cd cudd
199199 autoreconf
200200 ./configure --prefix=${cuddPrefix}
201- make -j $( nproc ) install
201+ make -j ${numThreads} install
202202 else
203203 echo " Cudd already installed."
204204 fi
@@ -223,7 +223,7 @@ _installCommonDev() {
223223 git clone --depth=1 -b ${lemonVersion} https://github.com/The-OpenROAD-Project/lemon-graph.git
224224 cd lemon-graph
225225 ${cmakePrefix} /bin/cmake -DCMAKE_INSTALL_PREFIX=" ${lemonPrefix} " -B build .
226- ${cmakePrefix} /bin/cmake --build build -j $( nproc ) --target install
226+ ${cmakePrefix} /bin/cmake --build build -j ${numThreads} --target install
227227 else
228228 echo " Lemon already installed."
229229 fi
@@ -240,7 +240,7 @@ _installCommonDev() {
240240 git clone --depth=1 -b " v${spdlogVersion} " https://github.com/gabime/spdlog.git
241241 cd spdlog
242242 ${cmakePrefix} /bin/cmake -DCMAKE_INSTALL_PREFIX=" ${spdlogPrefix} " -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSPDLOG_BUILD_EXAMPLE=OFF -B build .
243- ${cmakePrefix} /bin/cmake --build build -j $( nproc ) --target install
243+ ${cmakePrefix} /bin/cmake --build build -j ${numThreads} --target install
244244 echo " spdlog ${spdlogVersion} installed (from ${spdlogInstalledVersion} )."
245245 else
246246 echo " spdlog ${spdlogVersion} already installed."
@@ -329,7 +329,7 @@ _installOrTools() {
329329 git clone --depth=1 -b " v${orToolsVersionBig} " https://github.com/google/or-tools.git
330330 cd or-tools
331331 ${cmakePrefix} /bin/cmake -S. -Bbuild -DBUILD_DEPS:BOOL=ON -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_SAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${orToolsPath} -DCMAKE_CXX_FLAGS=" -w" -DCMAKE_C_FLAGS=" -w"
332- ${cmakePrefix} /bin/cmake --build build --config Release --target install -v -j $( nproc )
332+ ${cmakePrefix} /bin/cmake --build build --config Release --target install -v -j ${numThreads}
333333 else
334334 if [[ $osVersion == rodete ]]; then
335335 osVersion=11
@@ -587,16 +587,13 @@ Then, rerun this script.
587587EOF
588588 exit 1
589589 fi
590- brew install bison boost cmake eigen flex fmt groff libomp or-tools pandoc pyqt5 python spdlog tcl-tk zlib
590+ brew install bison boost cmake eigen flex fmt groff libomp or-tools pandoc pyqt5 python spdlog tcl-tk zlib swig
591591
592592 # Some systems need this to correctly find OpenMP package during build
593593 brew link --force libomp
594594
595595 # Lemon is not in the homebrew-core repo
596596 brew install The-OpenROAD-Project/lemon-graph/lemon-graph
597-
598- # Install swig 4.1.1
599- _installHomebrewPackage " swig" " c83c8aaa6505c3ea28c35bc45a54234f79e46c5d" " s/"
600597}
601598
602599_installDebianCleanUp () {
@@ -774,6 +771,9 @@ Usage: $0 -all
774771 $0 -constant-build-dir
775772 # Use constant build directory, instead of
776773 # random one.
774+ $0 -threads=<N> #
775+ # Limit number of compiling threads. Default is
776+ # all available numThreads.
777777
778778EOF
779779 exit " ${1:- 1} "
@@ -786,6 +786,7 @@ isLocal="false"
786786equivalenceDeps=" no"
787787CI=" no"
788788saveDepsPrefixes=" "
789+ numThreads=$( nproc)
789790# temp dir to download and compile
790791baseDir=$( mktemp -d /tmp/DependencyInstaller-XXXXXX)
791792
@@ -862,6 +863,9 @@ while [ "$#" -gt 0 ]; do
862863 -save-deps-prefixes=* )
863864 saveDepsPrefixes=$( realpath ${1# -save-deps-prefixes=} )
864865 ;;
866+ -threads=* )
867+ numThreads=${1}
868+ ;;
865869 * )
866870 echo " unknown option: ${1} " >&2
867871 _help
0 commit comments