Skip to content
Snippets Groups Projects
Commit de68f2e1 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'rf/copyrights' into 'master'

Rf/copyrights

See merge request !3
parents 270e5b80 9fd24d88
No related branches found
No related tags found
1 merge request!3Rf/copyrights
Pipeline #6725 failed
# FSL base project changelog # FSL base project changelog
## 2101.0 (Monday 4th January 2020)
- Moved the copyright insertion machinery (script and templates) from
`config/common/` into `share/fsl/`.
- Unify `fsl.sh` and `fsl-devel.sh` so the latter simply invokes the former.
- Fix an issue with argument pass-through in the `fslpython[w]` wrapper
scripts.
- Removed the `etc/fslconf/fslmachtype.sh` script, as neither it, nor the
`FSLMACHTYPE` environment variable, are used by anything.
## 2012.0 (Wednesday 2nd December 2020) ## 2012.0 (Wednesday 2nd December 2020)
- Added `creeateFSLWrapper` and `removeFSLWrapper`, utility commands, which - Added `creeateFSLWrapper` and `removeFSLWrapper`, utility commands, which
......
...@@ -4,9 +4,9 @@ This project contains the "base" of an FSL installation. It includes: ...@@ -4,9 +4,9 @@ This project contains the "base" of an FSL installation. It includes:
- Configuration scripts for setting up an environment to use FSL - Configuration scripts for setting up an environment to use FSL
- Makefile infrastructure used to compile and install FSL projects - Makefile infrastructure used to compile and install FSL projects
- Various other small configuration and auxillary files - Various other small configuration, data, and auxillary files
Prior to FSL 6.0.X, the contents of this project were provided by the Prior to FSL 6.1.X, the contents of this project were provided by the
[etc](https://git.fmrib.ox.ac.uk/fsl/etc) and [etc](https://git.fmrib.ox.ac.uk/fsl/etc) and
[config](https://git.fmrib.ox.ac.uk/fsl/config) projects. [config](https://git.fmrib.ox.ac.uk/fsl/config) projects.
......
bin/fslpython 100644 → 100755
...@@ -5,4 +5,4 @@ if [ "$FSLDIR" = "" ] ; then ...@@ -5,4 +5,4 @@ if [ "$FSLDIR" = "" ] ; then
exit 1 exit 1
fi fi
exec ${FSLDIR}/bin/python $* exec ${FSLDIR}/bin/python "$@"
bin/fslpythonw 100644 → 100755
...@@ -6,7 +6,7 @@ if [ "$FSLDIR" = "" ] ; then ...@@ -6,7 +6,7 @@ if [ "$FSLDIR" = "" ] ; then
fi fi
if [ -e ${FSLDIR}/bin/pythonw ]; then if [ -e ${FSLDIR}/bin/pythonw ]; then
exec ${FSLDIR}/bin/pythonw $* exec ${FSLDIR}/bin/pythonw "$@"
else else
exec ${FSLDIR}/bin/pythonw $* exec ${FSLDIR}/bin/python "$@"
fi fi
...@@ -14,7 +14,7 @@ clean: ...@@ -14,7 +14,7 @@ clean:
${XFILES} ${FXFILES} ${SOFILES} ${AFILES} ${TESTXFILES} ${XFILES} ${FXFILES} ${SOFILES} ${AFILES} ${TESTXFILES}
insertcopyright: insertcopyright:
${FSLCONFDIR}/common/insertcopyright * */* ${FSLDIR}/share/fsl/sbin/insertcopyright * */*
depend: depend:
${RM} -f depend.mk ${RM} -f depend.mk
......
# FSL configuration file # FSL configuration file for developers
# - to be sourced by the user, typically in .bashrc or equivalent # - to be sourced by the user, typically in .bashrc or equivalent
# - note that the user should set #
# Written by Mark Jenkinson # Written by Mark Jenkinson
# FMRIB Analysis Group, University of Oxford # FMRIB Analysis Group, University of Oxford
# SHBASECOPYRIGHT # SHBASECOPYRIGHT
#### Set up standard FSL user environment variables ####
# The following variable selects the default output image type
# Legal values are: ANALYZE NIFTI NIFTI_PAIR ANALYZE_GZ NIFTI_GZ NIFTI_PAIR_GZ
# This would typically be overwritten in ${HOME}/.fslconf/fsl.sh if the user wished
# to write files with a different format
FSLOUTPUTTYPE=NIFTI_GZ
export FSLOUTPUTTYPE
# Comment out the definition of FSLMULTIFILEQUIT to enable
# FSL programs to soldier on after detecting multiple image
# files with the same basename ( e.g. epi.hdr and epi.nii )
FSLMULTIFILEQUIT=TRUE ; export FSLMULTIFILEQUIT
# The following variables specify paths for programs and can be changed
# or replaced by different programs ( e.g. FSLDISPLAY=open for MacOSX)
FSLTCLSH=$FSLDIR/bin/fsltclsh
FSLWISH=$FSLDIR/bin/fslwish
export FSLTCLSH FSLWISH
# The following variables are used for running code in parallel across
# several machines ( i.e. for FDT )
FSLLOCKDIR=
FSLMACHINELIST=
FSLREMOTECALL=
export FSLLOCKDIR FSLMACHINELIST FSLREMOTECALL
# The following variables are used to configure CUDA capable queues - if you
# are using Grid Engine then this queue will be used to enqueue tasks that
# support execution on NVIDIA CUDA hardware.
FSLGECUDAQ=cuda.q
export FSLGECUDAQ
# Set up development variables (not for the faint-hearted)
FSLCONFDIR=$FSLDIR/config FSLCONFDIR=$FSLDIR/config
FSLMACHTYPE=`$FSLDIR/etc/fslconf/fslmachtype.sh`
export FSLCONFDIR FSLMACHTYPE
###################################################
### Add other global environment variables here ###
### or change the definitions above ###
###################################################
# USER VARIABLES HERE
###################################################
#### DO NOT ADD ANYTHING BELOW THIS LINE ####
###################################################
if [ -f /usr/local/etc/fslconf/fsl.sh ] ; then
. /usr/local/etc/fslconf/fsl.sh ;
fi
if [ -f /etc/fslconf/fsl.sh ] ; then
. /etc/fslconf/fsl.sh ;
fi
export FSLCONFDIR
if [ -f "${HOME}/.fslconf/fsl.sh" ] ; then source $FSLDIR/etc/fslconf/fsl.sh
. "${HOME}/.fslconf/fsl.sh" ;
fi
# FSL configuration file # FSL configuration file
# - to be sourced by the user, typically in .bashrc or equivalent # - to be sourced by the user, typically in .bashrc or equivalent
# - note that the user should set # - note that the user should set
# Written by Mark Jenkinson # Written by Mark Jenkinson
# FMRIB Analysis Group, University of Oxford # FMRIB Analysis Group, University of Oxford
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# to write files with a different format # to write files with a different format
setenv FSLOUTPUTTYPE NIFTI_GZ setenv FSLOUTPUTTYPE NIFTI_GZ
# Comment out the definition of FSLMULTIFILEQUIT to enable # Comment out the definition of FSLMULTIFILEQUIT to enable
# FSL programs to soldier on after detecting multiple image # FSL programs to soldier on after detecting multiple image
# files with the same basename ( e.g. epi.hdr and epi.nii ) # files with the same basename ( e.g. epi.hdr and epi.nii )
setenv FSLMULTIFILEQUIT TRUE setenv FSLMULTIFILEQUIT TRUE
...@@ -31,9 +31,9 @@ setenv FSLWISH $FSLDIR/bin/fslwish ...@@ -31,9 +31,9 @@ setenv FSLWISH $FSLDIR/bin/fslwish
# The following variables are used for running code in parallel across # The following variables are used for running code in parallel across
# several machines ( i.e. for FDT ) # several machines ( i.e. for FDT )
setenv FSLLOCKDIR setenv FSLLOCKDIR
setenv FSLMACHINELIST setenv FSLMACHINELIST
setenv FSLREMOTECALL setenv FSLREMOTECALL
# The following variables are used to configure CUDA capable queues - if you # The following variables are used to configure CUDA capable queues - if you
# are using Grid Engine then this queue will be used to enqueue tasks that # are using Grid Engine then this queue will be used to enqueue tasks that
...@@ -43,8 +43,6 @@ setenv FSLGECUDAQ cuda.q ...@@ -43,8 +43,6 @@ setenv FSLGECUDAQ cuda.q
# Set up development variables (not for the faint-hearted) # Set up development variables (not for the faint-hearted)
# Uncomment the following if you wish to compile FSL source code # Uncomment the following if you wish to compile FSL source code
#setenv FSLCONFDIR $FSLDIR/config #setenv FSLCONFDIR $FSLDIR/config
#setenv FSLMACHTYPE `$FSLDIR/etc/fslconf/fslmachtype.sh`
################################################### ###################################################
### Add other global environment variables here ### ### Add other global environment variables here ###
......
# FSL configuration file # FSL configuration file
# - to be sourced by the user, typically in .bashrc or equivalent # - to be sourced by the user, typically in .bashrc or equivalent
# - note that the user should set #
# Written by Mark Jenkinson # Written by Mark Jenkinson
# FMRIB Analysis Group, University of Oxford # FMRIB Analysis Group, University of Oxford
...@@ -17,7 +16,7 @@ ...@@ -17,7 +16,7 @@
FSLOUTPUTTYPE=NIFTI_GZ FSLOUTPUTTYPE=NIFTI_GZ
export FSLOUTPUTTYPE export FSLOUTPUTTYPE
# Comment out the definition of FSLMULTIFILEQUIT to enable # Comment out the definition of FSLMULTIFILEQUIT to enable
# FSL programs to soldier on after detecting multiple image # FSL programs to soldier on after detecting multiple image
# files with the same basename ( e.g. epi.hdr and epi.nii ) # files with the same basename ( e.g. epi.hdr and epi.nii )
FSLMULTIFILEQUIT=TRUE ; export FSLMULTIFILEQUIT FSLMULTIFILEQUIT=TRUE ; export FSLMULTIFILEQUIT
...@@ -29,7 +28,7 @@ FSLMULTIFILEQUIT=TRUE ; export FSLMULTIFILEQUIT ...@@ -29,7 +28,7 @@ FSLMULTIFILEQUIT=TRUE ; export FSLMULTIFILEQUIT
FSLTCLSH=$FSLDIR/bin/fsltclsh FSLTCLSH=$FSLDIR/bin/fsltclsh
FSLWISH=$FSLDIR/bin/fslwish FSLWISH=$FSLDIR/bin/fslwish
export FSLTCLSH FSLWISH export FSLTCLSH FSLWISH
# The following variables are used for running code in parallel across # The following variables are used for running code in parallel across
# several machines ( i.e. for FDT ) # several machines ( i.e. for FDT )
...@@ -47,13 +46,6 @@ FSLGECUDAQ=cuda.q ...@@ -47,13 +46,6 @@ FSLGECUDAQ=cuda.q
export FSLGECUDAQ export FSLGECUDAQ
# Set up development variables (not for the faint-hearted)
# Uncomment the following if you wish to compile FSL source code
#FSLCONFDIR=$FSLDIR/config
#FSLMACHTYPE=`$FSLDIR/etc/fslconf/fslmachtype.sh`
#export FSLCONFDIR FSLMACHTYPE
################################################### ###################################################
### Add other global environment variables here ### ### Add other global environment variables here ###
......
#!/bin/sh
# FSL Host type identifier
# - Used by several scripts to identify the host type for build environment
# Written by Duncan Mortimer
# FMRIB Analysis Group, University of Oxford
# SHCOPYRIGHT
#### Identify machine ####
machtype=""
system_type=`uname -s`
case ${system_type} in
SunOS)
AWK=nawk
;;
*)
AWK=awk
;;
esac
gcc_version=`gcc -dumpversion 2> /dev/null`
if [ $? -eq 0 ]; then
# GCC is installed
gcc_version=`echo $gcc_version | $AWK -F . '{ printf "%s.%s", $1,$2 }'`
gcc_host=`gcc -dumpmachine`
gcc_cpu_type=`echo $gcc_host | $AWK -F - '{ printf "%s", $1; }'`
gcc_os_vendor=`echo $gcc_host | $AWK -F - '{ printf "%s", $2; }'`
gcc_os_name=`echo $gcc_host | $AWK -F - '{ printf "%s", $3; }'`
case ${system_type} in
Darwin)
# We are going to build a universal (ppc32, ppc64, x86_32, x86_64)
# combined binary, so we only need 1 host type
os_release=`uname -r | $AWK -F . '{ printf "%s", $1 }'`
if [ $os_release -ge 12 ]; then
# Using LLVM/clang from now on
llvm_vstr=`cc -v 2>&1`
# Find the LLVM version and reduce to major.minor version number
llvm_v=`echo ${llvm_vstr} | awk '{ print $4 }' | cut -d . -f 1,2`
# Find the LLVM major version number
llvm_maj=`echo ${llvm_v} | cut -d . -f 1`
if [ ${llvm_maj} -ge 7 ]; then
os_v=`echo ${llvm_vstr} | awk '{ print $7 }' | awk -F. '{ print $1 }' | sed 's/x86_64-//'`
else
os_v=`echo ${llvm_vstr} | awk '{ print $11 }' | awk -F. '{ print $1 }' | sed 's/x86_64-//'`
fi
machtype=${os_v}-llvm${llvm_v}
elif [ $os_release -ge 8 ]; then
# This is 10.4 so Universal builds possible
gcc_host="${gcc_os_vendor}-${gcc_os_name}"
# Note, for BSDish platforms, gcc_os_name includes a version
machtype=${gcc_host}-gcc${gcc_version}
else
# Prior to Tiger and gcc4, things were a mess...
gcc_host="${gcc_cpu_type}-${gcc_os_vendor}"
machtype=${gcc_host}-gcc${gcc_version}
# Note, gcc_os_vendor in this case is actually gcc_os_name above
fi
;;
Linux)
if [ "${gcc_cpu_type}" = "x86_64" -o "${gcc_cpu_type}" = "x86-64" ]; then
gcc_host="${gcc_os_name}_64"
elif [ `echo ${gcc_cpu_type} | grep i.86` ]; then
gcc_host="${gcc_os_name}_32"
else
gcc_host="${gcc_cpu_type}-${gcc_os_vendor}-${gcc_os_name}"
fi
machtype=${gcc_host}-gcc${gcc_version}
;;
*)
gcc_host="${gcc_cpu_type}-${gcc_os_vendor}-${gcc_os_name}"
machtype=${gcc_host}-gcc${gcc_version}
;;
esac
fi
echo ${machtype}
exit 0
6.0.5 6.1.X
\ No newline at end of file \ No newline at end of file
...@@ -24,12 +24,12 @@ for fname in $@ ; do ...@@ -24,12 +24,12 @@ for fname in $@ ; do
if [ $num1 != "0" ]; then if [ $num1 != "0" ]; then
sed -n $com1 $fname > $fname.copytmp sed -n $com1 $fname > $fname.copytmp
fi fi
cat ${FSLCONFDIR}/common/copyrights/ccopyright.c >> $fname.copytmp cat ${FSLDIR}/share/fsl/copyrights/ccopyright.c >> $fname.copytmp
sed -n $com2 $fname >> $fname.copytmp sed -n $com2 $fname >> $fname.copytmp
cp -f $fname.copytmp $fname cp -f $fname.copytmp $fname
rm -f $fname.copytmp rm -f $fname.copytmp
fi fi
# Insert TCLCOPYRIGHT message # Insert TCLCOPYRIGHT message
num=`grep -n TCLCOPYRIGHT $fname | head -1 | cut -d':' -f1 `; export num num=`grep -n TCLCOPYRIGHT $fname | head -1 | cut -d':' -f1 `; export num
if [ "X${num}X" != XX ] ; then if [ "X${num}X" != XX ] ; then
...@@ -39,7 +39,7 @@ for fname in $@ ; do ...@@ -39,7 +39,7 @@ for fname in $@ ; do
com2="${num2},\$p"; export com2 com2="${num2},\$p"; export com2
rm -f $fname.copytmp rm -f $fname.copytmp
sed -n $com1 $fname > $fname.copytmp sed -n $com1 $fname > $fname.copytmp
cat ${FSLCONFDIR}/common/copyrights/tclcopyright.tcl >> $fname.copytmp cat ${FSLDIR}/share/fsl/copyrights/tclcopyright.tcl >> $fname.copytmp
sed -n $com2 $fname >> $fname.copytmp sed -n $com2 $fname >> $fname.copytmp
cp -f $fname.copytmp $fname cp -f $fname.copytmp $fname
rm -f $fname.copytmp rm -f $fname.copytmp
...@@ -54,14 +54,14 @@ for fname in $@ ; do ...@@ -54,14 +54,14 @@ for fname in $@ ; do
com2="${num2},\$p"; export com2 com2="${num2},\$p"; export com2
rm -f $fname.copytmp rm -f $fname.copytmp
sed -n $com1 $fname > $fname.copytmp sed -n $com1 $fname > $fname.copytmp
cat ${FSLCONFDIR}/common/copyrights/shcopyright.sh >> $fname.copytmp cat ${FSLDIR}/share/fsl/copyrights/shcopyright.sh >> $fname.copytmp
echo "export LC_ALL=C" >> $fname.copytmp echo "export LC_ALL=C" >> $fname.copytmp
sed -n $com2 $fname >> $fname.copytmp sed -n $com2 $fname >> $fname.copytmp
cp -f $fname.copytmp $fname cp -f $fname.copytmp $fname
rm -f $fname.copytmp rm -f $fname.copytmp
fi fi
# Insert SHBASECOPYRIGHT message # Insert SHBASECOPYRIGHT message
num=`grep -n SHBASECOPYRIGHT $fname | head -1 | cut -d':' -f1 `; export num num=`grep -n SHBASECOPYRIGHT $fname | head -1 | cut -d':' -f1 `; export num
if [ "X${num}X" != XX ] ; then if [ "X${num}X" != XX ] ; then
num1=`echo "$num 1 - p" | dc`; export num1 num1=`echo "$num 1 - p" | dc`; export num1
...@@ -70,11 +70,11 @@ for fname in $@ ; do ...@@ -70,11 +70,11 @@ for fname in $@ ; do
com2="${num2},\$p"; export com2 com2="${num2},\$p"; export com2
rm -f $fname.copytmp rm -f $fname.copytmp
sed -n $com1 $fname > $fname.copytmp sed -n $com1 $fname > $fname.copytmp
cat ${FSLCONFDIR}/common/copyrights/shcopyright.sh >> $fname.copytmp cat ${FSLDIR}/share/fsl/copyrights/shcopyright.sh >> $fname.copytmp
sed -n $com2 $fname >> $fname.copytmp sed -n $com2 $fname >> $fname.copytmp
cp -f $fname.copytmp $fname cp -f $fname.copytmp $fname
rm -f $fname.copytmp rm -f $fname.copytmp
fi fi
fi fi
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment