Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:55

0001 ##
0002 ## Copyright (c) 2019 Opticks Team. All Rights Reserved.
0003 ##
0004 ## This file is part of Opticks
0005 ## (see https://bitbucket.org/simoncblyth/opticks).
0006 ##
0007 ## Licensed under the Apache License, Version 2.0 (the "License"); 
0008 ## you may not use this file except in compliance with the License.  
0009 ## You may obtain a copy of the License at
0010 ##
0011 ##   http://www.apache.org/licenses/LICENSE-2.0
0012 ##
0013 ## Unless required by applicable law or agreed to in writing, software 
0014 ## distributed under the License is distributed on an "AS IS" BASIS, 
0015 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0016 ## See the License for the specific language governing permissions and 
0017 ## limitations under the License.
0018 ##
0019 
0020 sysrap-src(){      echo sysrap/sysrap.bash ; }
0021 sysrap-source(){   echo $BASH_SOURCE ; }
0022 sysrap-vi(){       vi $BASH_SOURCE ; }
0023 sysrap-usage(){ cat << \EOU
0024 
0025 System Rap
0026 ============
0027 
0028 Lowest level package, beneath BoostRap and 
0029 **explicitly not using Boost**. 
0030 
0031 A lower level pkg that BoostRap is required 
0032 as nvcc, the CUDA compiler, has trouble compiling 
0033 some Boost headers.
0034 
0035 Linux
0036 -------
0037 
0038 ::
0039 
0040     yum install openssl-devel   # for openssl/md5.h 
0041 
0042 
0043 
0044 EOU
0045 }
0046 
0047 sysrap-env(){      olocal- ; opticks- ;  }
0048 
0049 sysrap-dir(){  echo $(sysrap-sdir) ; }
0050 sysrap-sdir(){ echo $(opticks-home)/sysrap ; }
0051 sysrap-tdir(){ echo $(opticks-home)/sysrap/tests ; }
0052 sysrap-idir(){ echo $(opticks-idir); }
0053 sysrap-bdir(){ echo $(opticks-bdir)/sysrap ; }
0054 
0055 sysrap-c(){    cd $(sysrap-sdir)/$1 ; }
0056 sysrap-cd(){   cd $(sysrap-sdir)/$1 ; }
0057 sysrap-scd(){  cd $(sysrap-sdir); }
0058 sysrap-tcd(){  cd $(sysrap-tdir); }
0059 sysrap-icd(){  cd $(sysrap-idir); }
0060 sysrap-bcd(){  cd $(sysrap-bdir); }
0061 
0062 sysrap-name(){ echo SysRap ; }
0063 sysrap-tag(){  echo SYSRAP ; }
0064 
0065 sysrap-apihh(){  echo $(sysrap-sdir)/$(sysrap-tag)_API_EXPORT.hh ; }
0066 sysrap---(){     touch $(sysrap-apihh) ; sysrap--  ; }
0067 
0068 
0069 sysrap-wipe(){    local bdir=$(sysrap-bdir) ; rm -rf $bdir ; }
0070 
0071 #sysrap--(){       opticks-- $(sysrap-bdir) ; } 
0072 #sysrap-t(){       opticks-t $(sysrap-bdir) $* ; } 
0073 sysrap--(){       sysrap-scd ; om- ; om-make ;  } 
0074 sysrap-t(){       sysrap-scd ; om- ; om-test ;  } 
0075 
0076 
0077 
0078 
0079 sysrap-ts(){      opticks-ts $(sysrap-bdir) $* ; } 
0080 sysrap-genproj(){ sysrap-scd ; opticks-genproj $(sysrap-name) $(sysrap-tag) ; } 
0081 sysrap-gentest(){ sysrap-tcd ; opticks-gentest ${1:-SCheck} $(sysrap-tag) ; } 
0082 sysrap-txt(){     vi $(sysrap-sdir)/CMakeLists.txt $(sysrap-tdir)/CMakeLists.txt ; } 
0083 
0084 sysrap-csg(){ head -20 $(sysrap-dir)/OpticksCSG.h ; }
0085 
0086 
0087 sysrap-SDigestTest-(){ cat << EOF
0088 0123456789abcdef0123456789abcdef
0089 EOF
0090 }
0091 
0092 sysrap-SDigestTest()
0093 {
0094     local path=/tmp/$FUNCNAME.txt
0095     $FUNCNAME- > $path
0096     echo $path 
0097     ls -l $path
0098 
0099     SDigestTest $path 0  16
0100     SDigestTest $path 16 32
0101 
0102 }
0103 
0104 
0105 
0106 sysrap-csg-generate()
0107 {
0108     local msg="$FUNCNAME : " 
0109     local iwd=$PWD
0110     sysrap-cd
0111   
0112     local script=$(opticks-home)/bin/c_enums_to_python.py
0113     $script OpticksCSG.h 
0114 
0115 
0116     echo $msg To write above generated python to OpticksCSG.py ..
0117     local ans
0118     read -p "Enter YES ... " ans
0119 
0120     if [  "$ans" == "YES" ]; then 
0121        $script OpticksCSG.h > OpticksCSG.py 
0122 
0123        echo $msg checking the generated python is valid 
0124        python  OpticksCSG.py
0125 
0126     else
0127        echo $msg SKIP
0128     fi 
0129 
0130     cd $iwd
0131 }
0132 
0133 
0134 
0135 
0136 
0137 
0138 
0139 sysrap-tags-alphabetical()
0140 {
0141     local iwd=$(pwd)
0142     local expo
0143     cd $(opticks-home) ; ls -1 */*_API_EXPORT.hh  | while read expo ; do 
0144         local subtag=${expo/_API_EXPORT.hh}
0145         local sub=$(dirname $subtag)
0146         local tag=$(basename $subtag)
0147         #printf "%-20s : %s \n" $sub $tag 
0148         echo $tag 
0149     done
0150     cd $iwd
0151 }
0152 
0153 sysrap-tags-ordered()  
0154 {
0155    opticks-deps --tags 
0156 }
0157 
0158 sysrap-tags-foreach()
0159 {
0160     local func=${1:-echo}
0161     local tag
0162     sysrap-tags-ordered | while read tag 
0163     do
0164         [ "$tag" == "OKCONF" ] && continue    ## OKCONF is beneath SYSRAP so it has no logging 
0165         $func $tag
0166     done
0167 }
0168 sysrap-genlog()
0169 {
0170    sysrap-cd
0171    sysrap-genlog-hh > OPTICKS_LOG.hh
0172 }
0173 
0174 sysrap-genlog-includes-(){ cat << EOH
0175 #ifdef OPTICKS_$1
0176 #include "$1_LOG.hh"
0177 #endif
0178 EOH
0179 }
0180 sysrap-genlog-initialize-(){ cat << EOI
0181 #ifdef OPTICKS_$1
0182     $1_LOG::Initialize(instance->prefixlevel_parse( max_level, "$1"), app1, NULL );
0183 #endif
0184 EOI
0185 }
0186 sysrap-genlog-check-(){ cat << EOC
0187 #ifdef OPTICKS_$1
0188     $1_LOG::Check("$1");
0189 #endif
0190 EOC
0191 }
0192 
0193 sysrap-genlog-hh(){ cat << EOI
0194 #pragma once
0195 
0196 /**
0197 
0198 OPTICKS_LOG
0199 ===============
0200 
0201 Umbrella logging header bringing in logging headers from all linked Opticks subprojects 
0202 allowing the logging of each subproject to be individually controlled.
0203 
0204 The header was generated by $FUNCNAME $(date)
0205 
0206 To regenerate the sysrap/OPTICKS_LOG.hh header use commandline::
0207 
0208      sysrap-;sysrap-genlog
0209 
0210 **/
0211 
0212 $(sysrap-tags-foreach sysrap-genlog-includes-)
0213 
0214 #include "SYSRAP_API_EXPORT.hh"
0215 
0216 #include "SLOG.hh"
0217 // NB must implement in header as this code is required to live in the main, not in a lib
0218 
0219 class SYSRAP_API OPTICKS_LOG_ {
0220    public:
0221        // initialize all linked loggers and hookup the main logger
0222        static void Initialize(SLOG* instance, void* app1, void* app2 )
0223        {
0224            int max_level = instance->parse("info") ;  
0225            // note : can decrease verbosity from the max_level in the subproj, but not increase
0226 
0227 $(sysrap-tags-foreach sysrap-genlog-initialize-)
0228        }
0229        // checking the loggers in each subproj by emitting message at all loglevels
0230        static void Check()
0231        {
0232 $(sysrap-tags-foreach sysrap-genlog-check-)
0233        }
0234 };
0235 
0236 #define OPTICKS_LOG_COLOR__(argc, argv) \
0237 {  \
0238     SLOG_COLOR(argc, argv); \
0239     OPTICKS_LOG_::Initialize(SLOG::instance, plog::get(), NULL );  \
0240 }  \
0241 
0242 #define OPTICKS_LOG__(argc, argv) \
0243 {  \
0244     SLOG_(argc, argv); \
0245     OPTICKS_LOG_::Initialize(SLOG::instance, plog::get(), NULL ); \
0246 } \
0247 
0248 #define OPTICKS_LOG(argc, argv) \
0249 {  \
0250     SLOG_COLOR(argc, argv); \
0251     OPTICKS_LOG_::Initialize(SLOG::instance, plog::get(), NULL ); \
0252 } \
0253 
0254 
0255 EOI
0256 }