@@ -11,17 +11,29 @@ function enable_git_describe {
1111}
1212
1313function show_gemc_installation {
14- echo
15- echo " - Content of \$ GEMC=$GEMC "
16- ls -lrt $GEMC
1714
18- echo " - Content of \$ GEMC/bin=$GEMC /bin"
19- ls -lrt $GEMC /bin
15+ echo " - Content of \$ GEMC=$GEMC " >> $gemc_install_show
16+ ls -lrt $GEMC >> $gemc_install_show
17+
18+ echo " - Content of \$ GEMC/bin=$GEMC /bin" >> $gemc_install_show
19+ ls -lrt $GEMC /bin >> $gemc_install_show
2020
2121 if [ -d $GEMC /lib ]; then
22- echo " - Content of \$ GEMC/lib=$GEMC /lib"
23- ls -lrt $GEMC /lib
22+ echo " - Content of \$ GEMC/lib=$GEMC /lib" >> $gemc_install_show
23+ ls -lrt $GEMC /lib >> $gemc_install_show
2424 fi
25+
26+ echo " ldd of $GEMC /bin/gemc:" >> $gemc_install_show
27+
28+ # if on unix, use ldd , if on mac, use otool -L
29+ if [[ " $( uname) " == " Darwin" ]]; then
30+ otool -L $GEMC /bin/gemc >> $gemc_install_show
31+ else
32+ ldd $GEMC /bin/gemc >> $gemc_install_show
33+ fi
34+
35+ echo " > To check gemc installation: cat $gemc_install_show "
36+
2537}
2638
2739function meson_setup_options {
@@ -30,6 +42,7 @@ function meson_setup_options {
3042
3143 meson_options=" "
3244 buildtype=" -Dbuildtype=debug "
45+ interactive_option=" "
3346
3447 case $1 in
3548 " address" )
@@ -60,45 +73,49 @@ function meson_setup_options {
6073 ;;
6174 esac
6275
63- additional_args=(
64- " --native-file=core.ini"
65- " -Di_test=true"
66- " -Droot=enabled"
67- " -Dprefix=${install_dir} "
68- " -Dpkg_config_path=$PKG_CONFIG_PATH :${install_dir} /lib/pkgconfig"
69- )
70-
71- echo $meson_options $buildtype " ${additional_args[@]} "
76+ args=(
77+ $meson_options
78+ $test_interactive_option
79+ " --native-file=core.ini"
80+ " -Droot=enabled"
81+ " -Dprefix=${install_dir} "
82+ " -Dpkg_config_path=$PKG_CONFIG_PATH :${install_dir} /lib/pkgconfig"
83+ $buildtype
84+ )
85+
86+ echo " ${args[@]} "
7287}
7388
74-
75- # recent versions of Git refuse to touch a repository whose on-disk owner
76- # doesn’t match the UID that is running the command
77- # mark the workspace (and any nested path) as safe
78- echo " Marking workspace as safe for Git"
79- git config --global --add safe.directory ' *'
80-
81- enable_git_describe
8289log_dir=$SIM_HOME /logs
90+ test_interactive_option=" "
8391
8492# if we are in the docker container, we need to load the modules
8593if [[ -z " ${AUTOBUILD} " ]]; then
8694 echo " \nNot in container"
95+ test_interactive_option=" -Di_test=true"
8796else
8897 echo " \nIn docker container."
98+ # recent versions of Git refuse to touch a repository whose on-disk owner
99+ # doesn’t match the UID that is running the command
100+ # mark the workspace (and any nested path) as safe
101+ echo " Marking workspace as safe for Git"
102+ git config --global --add safe.directory ' *'
103+ enable_git_describe
89104 log_dir=/root/src/logs
90105fi
91106
92- export $GEMC =$SIM_HOME /gemc/dev
93-
94- setup_log=/root/src/logs/setup.log
95- compile_log=/root/src/logs/build.log
96- test_log=/root/src/logs/test.log
97107
98- touch $setup_log $compile_log $test_log
108+ export GEMC=${SIM_HOME} /gemc/dev
109+ # detect cores and cap at 16
110+ cores=$( getconf _NPROCESSORS_ONLN 2> /dev/null || nproc)
111+ jobs=$(( cores < 16 ? cores : 16 ))
99112
100- echo Logs:
113+ mkdir -p $log_dir
114+ setup_log=$log_dir /setup.log
115+ compile_log=$log_dir /build.log
116+ install_log=$log_dir /install.log
117+ test_log=$log_dir /test.log
118+ gemc_install_show=$log_dir /gemc.log
101119
102- ls -l $setup_log
103- ls -l $compile_log
104- ls -l $test_log
120+ touch $setup_log $compile_log $install_log $test_log
121+ echo
0 commit comments