-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master: Extend dev_tools and get_package routines to work on MacOS+Ho…
…mebrew. configure: add --with-verbose-make option, fix the colpack_prefix setting.
- Loading branch information
Showing
19 changed files
with
227 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#! /bin/bash -e | ||
#! /usr/bin/env bash | ||
set -e -u | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2003-24 Bradley M. Bell | ||
|
@@ -8,22 +9,27 @@ then | |
echo "bin/check_all.sh: must be executed from its parent directory" | ||
exit 1 | ||
fi | ||
if [ "$1" != 'mixed' ] && [ "$1" != 'debug' ] && [ "$1" != 'release' ] | ||
if [ "$#" != 1 ] && [ "$#" != 2 ] | ||
then | ||
echo 'bin/check_all.sh: (mixed|debug|release) [verbose_make]' | ||
exit 1 | ||
fi | ||
if [ "$2" != '' ] && [ "$2" != 'verbose_make' ] | ||
if [ "$1" != 'mixed' ] && [ "$1" != 'debug' ] && [ "$1" != 'release' ] | ||
then | ||
echo 'bin/check_all.sh: (mixed|debug|release) [verbose_make]' | ||
exit 1 | ||
fi | ||
build_type="$1" | ||
if [ "$2" == 'verbose_make' ] | ||
verbose_make='no' | ||
if [ "$#" == 2 ] | ||
then | ||
verbose_make='--verbose_make' | ||
else | ||
verbose_make='' | ||
if [ "$2" != '' ] && [ "$2" != 'verbose_make' ] | ||
then | ||
echo 'bin/check_all.sh: (mixed|debug|release) [verbose_make]' | ||
exit 1 | ||
else | ||
verbose_make='yes' | ||
fi | ||
fi | ||
# ----------------------------------------------------------------------------- | ||
# bash function that echos and executes a command | ||
|
@@ -184,6 +190,10 @@ then | |
else | ||
exclude_package='--no_eigen --no_sacado' | ||
fi | ||
if [ "$(uname)" == 'Darwin' ] | ||
then | ||
exclude_package+=' --no_colpack' | ||
fi | ||
# --------------------------------------------------------------------------- | ||
# absoute prefix where optional packages are installed | ||
eval `grep '^prefix=' bin/get_optional.sh` | ||
|
@@ -245,21 +255,27 @@ echo_log_eval cp -r ../prefix build/prefix | |
if [ "$use_configure" == 'yes' ] | ||
then | ||
builder='make' | ||
configure_cmd="bin/run_configure.sh $standard" | ||
if [ "$compiler" == 'clang' ] | ||
then | ||
echo_log_eval bin/run_configure.sh $standard --with_clang | ||
else | ||
echo_log_eval bin/run_configure.sh $standard | ||
configure_cmd+=' --with-clang' | ||
fi | ||
if [ "verbose_make" == 'yes' ] | ||
then | ||
conigure_cmd+=' --with-verbose-make' | ||
fi | ||
echo_log_eval $configure_cmd | ||
else | ||
if [ "$verbose_name" != '' ] | ||
if [ "$verbose_make" == 'yes' ] | ||
then | ||
builder='make' | ||
verbose_flag='--verbose' | ||
else | ||
builder='ninja' | ||
verbose_flag='' | ||
fi | ||
echo_log_eval bin/run_cmake.sh \ | ||
$verbose_make \ | ||
$verbose_flag \ | ||
--profile_speed \ | ||
$compiler \ | ||
$standard \ | ||
|
@@ -270,7 +286,12 @@ fi | |
echo_log_eval cd build | ||
# | ||
# n_job | ||
n_job=$(nproc) | ||
if which nproc >& /dev/null | ||
then | ||
n_job=$(nproc) | ||
else | ||
n_job=$(sysctl -n hw.ncpu) | ||
fi | ||
# ----------------------------------------------------------------------------- | ||
# | ||
# build: example_jit | ||
|
@@ -317,16 +338,16 @@ fi | |
# | ||
# bin/test_install.sh | ||
echo_log_eval cd .. | ||
echo_log_eval bin/test_install.sh $builder | ||
if [ "$standard" == '' ] | ||
then | ||
echo_log_eval bin/test_install.sh $builder --c++17 | ||
else | ||
echo_log_eval bin/test_install.sh $builder $standard | ||
fi | ||
# | ||
# | ||
echo "date >> check_all.log" | ||
date | sed -e 's|^|date: |' >> $top_srcdir/check_all.log | ||
if [ "$skip" != '' ] | ||
then | ||
echo_log_eval echo "check_all.sh: skip = $skip" | ||
exit 1 | ||
fi | ||
# ---------------------------------------------------------------------------- | ||
echo "$0: OK" >> $top_srcdir/check_all.log | ||
echo "$0: OK" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
#! /bin/bash -e | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2003-22 Bradley M. Bell | ||
# SPDX-FileContributor: 2003-24 Bradley M. Bell | ||
# ---------------------------------------------------------------------------- | ||
if [ ! -e "bin/check_example.sh" ] | ||
then | ||
echo "bin/check_example.sh: must be executed from its parent directory" | ||
exit 1 | ||
fi | ||
# | ||
# grep, sed | ||
source bin/grep_and_sed.sh | ||
# ----------------------------------------------------------------------------- | ||
echo "Checking that all examples are in xrst/example_list.xrst" | ||
echo "-------------------------------------------------------" | ||
file_list=`git ls-files | sed -n \ | ||
file_list=`git ls-files | $sed -n \ | ||
-e '/^example\/deprecated\//d' \ | ||
-e '/^example\//p'` | ||
# | ||
sed < xrst/example_list.xrst > check_example.$$ \ | ||
$sed < xrst/example_list.xrst > check_example.$$ \ | ||
-n -e '/[$]begin list_all_examples\$\$/,/\$end/p' | ||
# | ||
# Make sure all example names are of the form *.cpp or *.hpp | ||
check=`sed -n -e '/$rref [0-9a-zA-Z_]*\.[hc]pp/d' \ | ||
check=`$sed -n -e '/$rref [0-9a-zA-Z_]*\.[hc]pp/d' \ | ||
-e '/$rref/p' check_example.$$` | ||
if [ "$check" != '' ] | ||
then | ||
|
@@ -32,11 +35,11 @@ for file in $file_list | |
do | ||
# only files in example directory with [$]begin *.cpp or *.hpp | ||
# e.g., example/multi_thread/harmonic.xrst has [$]begin harmonic.cpp$$ in it | ||
name=`grep '[$]begin *[0-9a-zA-Z_]*\.[hc]pp' $file | | ||
sed -e 's/.*[$]begin *//' -e 's/ *$$.*//'` | ||
name=`$grep '[$]begin *[0-9a-zA-Z_]*\.[hc]pp' $file | | ||
$sed -e 's/.*[$]begin *//' -e 's/ *$$.*//'` | ||
if [ "$name" != "" ] | ||
then | ||
if ! grep "$name" check_example.$$ > /dev/null | ||
if ! $grep "$name" check_example.$$ > /dev/null | ||
then | ||
echo "$name is missing from xrst/example_list.xrst" | ||
ok="no" | ||
|
@@ -63,22 +66,22 @@ dir_list=' | |
for dir in $dir_list | ||
do | ||
echo "Checking $dir file versus example names" | ||
name=`echo $dir | sed -e 's|.*/||'` | ||
name=`echo $dir | $sed -e 's|.*/||'` | ||
# | ||
ls $dir/*.cpp | sed \ | ||
ls $dir/*.cpp | $sed \ | ||
-e "s|$dir/||" -e "/^$name\\.cpp/d" -e 's|\.cpp||' > check_example.1.$$ | ||
if [ "$name" == 'general' ] | ||
then | ||
list=`ls $dir/*.hpp \ | ||
| sed -e "s|$dir/||" -e 's|\.hpp$||' -e '/^general$/d'` | ||
| $sed -e "s|$dir/||" -e 's|\.hpp$||' -e '/^general$/d'` | ||
for file in $list | ||
do | ||
sed -i check_example.1.$$ -e "/^$file\$/d" | ||
$sed -i check_example.1.$$ -e "/^$file\$/d" | ||
done | ||
fi | ||
sed -n -e '/^extern bool [a-z0-9A-Z_]*(void);/p' $dir/$name.cpp \ | ||
| sed -e 's/extern bool \([a-z0-9A-Z_]*\)(void);/\1/' \ | ||
| sed -e 's/\([a-z]\)\([A-Z]\)/\1_\2/g' \ | ||
$sed -n -e '/^extern bool [a-z0-9A-Z_]*(void);/p' $dir/$name.cpp \ | ||
| $sed -e 's/extern bool \([a-z0-9A-Z_]*\)(void);/\1/' \ | ||
| $sed -e 's/\([a-z]\)\([A-Z]\)/\1_\2/g' \ | ||
| tr '[A-Z]' '[a-z]' \ | ||
| sort > check_example.2.$$ | ||
if ! diff check_example.1.$$ check_example.2.$$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
#! /bin/bash -e | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2003-22 Bradley M. Bell | ||
# SPDX-FileContributor: 2003-24 Bradley M. Bell | ||
# ---------------------------------------------------------------------------- | ||
if [ ! -e "bin/check_include_file.sh" ] | ||
then | ||
msg="must be executed from its parent directory" | ||
echo "bin/check_include_file.sh: $msg" | ||
exit 1 | ||
fi | ||
# | ||
# $grep, sed | ||
source bin/grep_and_sed.sh | ||
# ----------------------------------------------------------------------------- | ||
# | ||
echo "Checking difference between C++ include directives and file names." | ||
|
@@ -18,19 +21,19 @@ then | |
echo "bin/check_include_file.sh: unexpected check_include_file.1.$$" | ||
exit 1 | ||
fi | ||
list=`git ls-files | sed -n \ | ||
list=`git ls-files | $sed -n \ | ||
-e '/\.cpp$/p' \ | ||
-e '/\.hpp$/p'` | ||
for file in $list | ||
do | ||
sed -n $file \ | ||
$sed -n $file \ | ||
-e '/^# *include *<cppad\/cg\//d' \ | ||
-e '/^# *include *<cppad\//p' \ | ||
>> check_include_file.1.$$ | ||
done | ||
# | ||
cat check_include_file.1.$$ | \ | ||
sed -e 's%[^<]*<%%' -e 's%>.*$%%' | \ | ||
$sed -e 's%[^<]*<%%' -e 's%>.*$%%' | \ | ||
sort -u > check_include_file.2.$$ | ||
# | ||
# The following files should never be included: | ||
|
@@ -40,13 +43,13 @@ cat check_include_file.1.$$ | \ | |
# | ||
# The files cppad/configure.hpp and cppad/local/is_pod.hpp | ||
# are not in git repository (they are built during configuration) | ||
git ls-files | sed -n -e '/include\/cppad\/.*\.hpp$/p' | \ | ||
sed \ | ||
git ls-files | $sed -n -e '/include\/cppad\/.*\.hpp$/p' | \ | ||
$sed \ | ||
-e '1,1s|^|include/cppad/configure.hpp\n|' \ | ||
-e '1,1s|^|include/cppad/local/is_pod.hpp\n|' \ | ||
-e '/include\/cppad\/local\/op\/prototype_op.hpp/d' \ | ||
-e '/include\/cppad\/example\/eigen_plugin.hpp/d' | \ | ||
sed -e 's|^include/||' | \ | ||
$sed -e 's|^include/||' | \ | ||
sort -u > check_include_file.3.$$ | ||
# | ||
different='no' | ||
|
@@ -56,7 +59,7 @@ then | |
different='yes' | ||
for file in `cat check_include_file.2.$$` | ||
do | ||
if ! grep "$file" check_include_file.3.$$ > /dev/null | ||
if ! $grep "$file" check_include_file.3.$$ > /dev/null | ||
then | ||
found='yes' | ||
echo "The file include/$file is unknown to git." | ||
|
@@ -66,7 +69,7 @@ then | |
done | ||
for file in `cat check_include_file.3.$$` | ||
do | ||
if ! grep "$file" check_include_file.2.$$ > /dev/null | ||
if ! $grep "$file" check_include_file.2.$$ > /dev/null | ||
then | ||
found='yes' | ||
echo "The included $file is no longer included." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#! /bin/bash -e | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2003-22 Bradley M. Bell | ||
# SPDX-FileContributor: 2003-24 Bradley M. Bell | ||
# ---------------------------------------------------------------------------- | ||
if [ ! -e "bin/check_include_xrst.sh" ] | ||
then | ||
|
@@ -10,7 +10,7 @@ then | |
fi | ||
# ----------------------------------------------------------------------------- | ||
count=`git ls-files include/cppad | grep '/xrst/.*\.hpp' | wc -l` | ||
if [ "$count" != '0' ] | ||
if [ $count != '0' ] | ||
then | ||
git ls-files include/cppad | grep '/xrst/.*\.hpp' | ||
echo 'Cannot put *.hpp files below xrst in include directory' | ||
|
Oops, something went wrong.