Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jlab
hallc
analyzer_software
hcana
Commits
0c525926
Commit
0c525926
authored
11 years ago
by
Edward Brash
Browse files
Options
Downloads
Patches
Plain Diff
SConstruct type change ...
parent
3db32e62
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SConstruct
+1
-167
1 addition, 167 deletions
SConstruct
SConstruct
+1
-167
1 addition, 167 deletions
SConstruct
with
2 additions
and
334 deletions
SConstruct
deleted
100644 → 0
+
1
−
167
View file @
3db32e62
###### Hall C Software Main SConstruct Build File #####
###### Author: Edward Brash (brash@jlab.org) June 2013
import
os
import
sys
import
platform
import
commands
import
SCons
def
rootcint
(
target
,
source
,
env
):
"""
Executes the ROOT dictionary generator over a list of headers.
"""
dictname
=
target
[
0
]
headers
=
""
cpppath
=
env
.
subst
(
'
$_CCCOMCOM
'
)
ccflags
=
env
.
subst
(
'
$CCFLAGS
'
)
rootcint
=
env
.
subst
(
'
$ROOTCINT
'
)
print
"
Doing rootcint call now ...
"
for
f
in
source
:
headers
+=
str
(
f
)
+
"
"
command
=
rootcint
+
"
-f %s -c -pthread -fPIC %s %s
"
%
(
dictname
,
cpppath
,
headers
)
print
(
'
RootCint Command = %s
\n
'
%
command
)
ok
=
os
.
system
(
command
)
return
ok
baseenv
=
Environment
(
ENV
=
os
.
environ
)
#dict = baseenv.Dictionary()
#keys = dict.keys()
#keys.sort()
#for key in keys:
# print "Construction variable = '%s', value = '%s'" % (key, dict[key])
####### Check SCons version ##################
print
(
'
!!! Building the Hall C analyzer and libraries with SCons requires
'
)
print
(
'
!!! SCons version 2.1.0 or newer.
'
)
EnsureSConsVersion
(
2
,
1
,
0
)
####### Hall A Build Environment #############
#
baseenv
.
Append
(
MAIN_DIR
=
Dir
(
'
.
'
).
abspath
)
baseenv
.
Append
(
HC_DIR
=
baseenv
.
subst
(
'
$MAIN_DIR
'
))
baseenv
.
Append
(
HC_SRC
=
baseenv
.
subst
(
'
$HC_DIR
'
)
+
'
/src
'
)
baseenv
.
Append
(
HA_DIR
=
baseenv
.
subst
(
'
$HC_DIR
'
)
+
'
/podd
'
)
baseenv
.
Append
(
HA_SRC
=
baseenv
.
subst
(
'
$HA_DIR
'
)
+
'
/src
'
)
baseenv
.
Append
(
HA_DC
=
baseenv
.
subst
(
'
$HA_DIR
'
)
+
'
/hana_decode
'
)
baseenv
.
Append
(
HA_SCALER
=
baseenv
.
subst
(
'
$HA_DIR
'
)
+
'
/hana_scaler
'
)
baseenv
.
Append
(
MAJORVERSION
=
'
1
'
)
baseenv
.
Append
(
MINORVERSION
=
'
5
'
)
baseenv
.
Append
(
PATCH
=
'
25
'
)
baseenv
.
Append
(
SOVERSION
=
baseenv
.
subst
(
'
$MAJORVERSION
'
)
+
'
.
'
+
baseenv
.
subst
(
'
$MINORVERSION
'
))
baseenv
.
Append
(
VERSION
=
baseenv
.
subst
(
'
$SOVERSION
'
)
+
'
.
'
+
baseenv
.
subst
(
'
$PATCH
'
))
baseenv
.
Append
(
EXTVERS
=
''
)
baseenv
.
Append
(
HA_VERSION
=
baseenv
.
subst
(
'
$VERSION
'
)
+
baseenv
.
subst
(
'
$EXTVERS
'
))
print
"
Hall C Main Directory = %s
"
%
baseenv
.
subst
(
'
$HC_DIR
'
)
print
"
Hall C Source Directory = %s
"
%
baseenv
.
subst
(
'
$HC_SRC
'
)
print
"
Hall A Main Directory = %s
"
%
baseenv
.
subst
(
'
$HA_DIR
'
)
print
"
Software Version = %s
"
%
baseenv
.
subst
(
'
$VERSION
'
)
ivercode
=
65536
*
int
(
float
(
baseenv
.
subst
(
'
$SOVERSION
'
)))
+
256
*
int
(
10
*
(
float
(
baseenv
.
subst
(
'
$SOVERSION
'
))
-
int
(
float
(
baseenv
.
subst
(
'
$SOVERSION
'
)))))
+
int
(
float
(
baseenv
.
subst
(
'
$PATCH
'
)))
baseenv
.
Append
(
VERCODE
=
ivercode
)
baseenv
.
Append
(
CPPPATH
=
[
'
$HC_SRC
'
,
'
$HA_SRC
'
,
'
$HA_DC
'
,
'
$HA_SCALER
'
])
proceed
=
"
1
"
or
"
y
"
or
"
yes
"
or
"
Yes
"
or
"
Y
"
######## Configure Section #######
import
configure
configure
.
config
(
baseenv
,
ARGUMENTS
)
Export
(
'
baseenv
'
)
conf
=
Configure
(
baseenv
)
if
not
conf
.
CheckCXX
():
print
(
'
!!! Your compiler and/or environment is not correctly configured.
'
)
Exit
(
0
)
if
not
conf
.
CheckFunc
(
'
printf
'
):
print
(
'
!! Your compiler and/or environment is not correctly configured.
'
)
Exit
(
0
)
if
baseenv
.
subst
(
'
$CHECKHEADERS
'
)
==
proceed
:
system_header_list
=
[
'
arpa/inet.h
'
,
'
errno.h
'
,
'
assert.h
'
,
'
netdb.h
'
,
'
netinet/in.h
'
,
'
pthread.h
'
,
'
signal.h
'
,
'
stddef.h
'
,
'
stdio.h
'
,
'
stdlib.h
'
,
'
string.h
'
,
'
strings.h
'
,
'
sys/ioctl.h
'
,
'
sys/socket.h
'
,
'
sys/time.h
'
,
'
sys/types.h
'
,
'
time.h
'
,
'
unistd.h
'
,
'
memory.h
'
,
'
math.h
'
,
'
limits.h
'
]
for
header_file
in
system_header_list
:
if
not
conf
.
CheckHeader
(
header_file
):
print
(
'
!! Header file %s not found.
'
%
header_file
)
Exit
(
0
)
baseenv
=
conf
.
Finish
()
######## ROOT Dictionaries #########
baseenv
.
Append
(
ROOTCONFIG
=
'
root-config
'
)
baseenv
.
Append
(
ROOTCINT
=
'
rootcint
'
)
try
:
baseenv
.
ParseConfig
(
'
$ROOTCONFIG --cflags
'
)
baseenv
.
ParseConfig
(
'
$ROOTCONFIG --libs
'
)
baseenv
.
MergeFlags
(
'
-fPIC
'
)
except
OSError
:
try
:
baseenv
.
Replace
(
ROOTCONFIG
=
baseenv
[
'
ENV
'
][
'
ROOTSYS
'
]
+
'
/bin/root-config
'
)
baseenv
.
Replace
(
ROOTCINT
=
baseenv
[
'
ENV
'
][
'
ROOTSYS
'
]
+
'
/bin/rootcint
'
)
baseenv
.
ParseConfig
(
'
$ROOTCONFIG --cflags
'
)
baseenv
.
ParseConfig
(
'
$ROOTCONFIG --libs
'
)
baseenv
.
MergeFlags
(
'
-fPIC
'
)
except
KeyError
:
print
(
'
!!! Cannot find ROOT. Check if root-config is in your PATH.
'
)
Exit
(
1
)
bld
=
Builder
(
action
=
rootcint
)
baseenv
.
Append
(
BUILDERS
=
{
'
RootCint
'
:
bld
})
######## cppcheck ###########################
def
which
(
program
):
import
os
def
is_exe
(
fpath
):
return
os
.
path
.
isfile
(
fpath
)
and
os
.
access
(
fpath
,
os
.
X_OK
)
fpath
,
fname
=
os
.
path
.
split
(
program
)
if
fpath
:
if
is_exe
(
program
):
return
program
else
:
for
path
in
os
.
environ
[
"
PATH
"
].
split
(
os
.
pathsep
):
path
=
path
.
strip
(
'"'
)
exe_file
=
os
.
path
.
join
(
path
,
program
)
if
is_exe
(
exe_file
):
return
exe_file
return
None
if
baseenv
.
subst
(
'
$CPPCHECK
'
)
==
proceed
:
is_cppcheck
=
which
(
'
cppcheck
'
)
print
"
Path to cppcheck is %s
\n
"
%
is_cppcheck
if
(
is_cppcheck
==
None
):
print
(
'
!!! cppcheck not found on this system. Check if cppcheck is installed and in your PATH.
'
)
Exit
(
1
)
else
:
cppcheck_command
=
baseenv
.
Command
(
'
cppcheck_report.txt
'
,[],
"
cppcheck --quiet --enable=all src/ 2> $TARGET
"
)
baseenv
.
AlwaysBuild
(
cppcheck_command
)
####### Start of main SConstruct ############
hallclib
=
'
HallC
'
hallalib
=
'
HallA
'
dclib
=
'
dc
'
scalerlib
=
'
scaler
'
baseenv
.
Append
(
LIBPATH
=
[
'
$HC_DIR
'
,
'
$HA_DIR
'
,
'
$HC_SRC
'
,
'
$HA_SRC
'
,
'
$HA_DC
'
,
'
$HA_SCALER
'
])
baseenv
.
Replace
(
SHLIBSUFFIX
=
'
.so
'
)
baseenv
.
Append
(
CPPDEFINES
=
'
-DHALLC_MODS
'
)
directorylist
=
[
'
./
'
,
'
src
'
,
'
podd
'
,
'
podd/src
'
,
'
podd/hana_decode
'
,
'
podd/hana_scaler
'
]
baseenv
.
Append
(
SHLIBSUFFIX
=
'
.
'
+
baseenv
.
subst
(
'
$VERSION
'
))
pbaseenv
=
baseenv
.
Clone
()
pbaseenv
.
Append
(
LIBS
=
[
hallclib
,
hallalib
,
dclib
,
scalerlib
])
baseenv
.
Append
(
LIBS
=
[
hallalib
,
dclib
,
scalerlib
])
Export
(
'
pbaseenv
'
)
#SConscript('podd/SConscript.py',exports='baseenv')
#SConscript('podd/hana_scaler/SConscript.py',exports='baseenv')
#SConscript('podd/hana_decode/SConscript.py',exports='baseenv')
#SConscript('src/SConscript.py',exports='baseenv')
#SConscript('./SConscript.py',exports='baseenv')
SConscript
(
dirs
=
directorylist
,
name
=
'
SConscript.py
'
,
exports
=
'
baseenv
'
)
####### End of SConstruct #########
This diff is collapsed.
Click to expand it.
SConstruct
0 → 120000
+
1
−
167
View file @
0c525926
SConstruct
.
py
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment