/usr/lib/neuron/bin/nrnivmodl is in neuron-dev 7.5-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | #!/bin/sh
ARCH=x86_64
MODSUBDIR=x86_64
if test "x${NRNHOME}" = x ; then
prefix=/usr
exec_prefix=/usr/lib/neuron
bindir=${exec_prefix}/bin
libdir=${prefix}/lib/x86_64-linux-gnu
else
prefix="$NRNHOME"
exec_prefix="${prefix}/${ARCH}"
bindir="${prefix}/${ARCH}/bin"
libdir="${prefix}/${ARCH}/lib"
fi
if test "${NRNHOME_EXEC}" != "" ; then
exec_prefix="${NRNHOME_EXEC}"
bindir="${exec_prefix}/bin"
libdir="${exec_prefix}/lib"
fi
export prefix
export exec_prefix
export bindir
export libdir
MAKEFILEDIR="${bindir}"
PURIFY="USEPURIFY=no"
if [ "$1" = "-p" ] ; then
PURIFY="USEPURIFY=yes"
shift
fi
TRACE="BGTRACE_LIBS="
if [ "$1" = "-trace" ] ; then
TRACE="BGTRACE_LIBS = -L/bgl/hpct_bgl/mp_profiler/lib -lmpitrace.rts -L/bgl/hpct_bgl/binutils-2.14/lib -lbfd -liberty -lhandle_MPID_Win_start_error.rts"
shift
fi
UserINCFLAGS=""
if [ "$1" = "-incflags" ] ; then
UserINCFLAGS="$2"
shift
shift
fi
UserLDFLAGS=""
if [ "$1" = "-loadflags" ] ; then
UserLDFLAGS="$2"
shift
shift
fi
if [ ! -d $MODSUBDIR ] ; then
echo "Creating $MODSUBDIR directory for .o files."
echo
mkdir $MODSUBDIR
fi
pwd
files=""
incs=""
if test $# -gt 0 ; then
for i in "$@" ; do
if test -d "$i" ; then
files="$files $(ls $i/*.mod)"
incs="$incs $(ls $i/*.inc)"
else
files="$files $i"
fi
done
else
files=$(ls *.mod)
fi
mfiles=""
for i in $files ; do
mfiles="$mfiles `basename $i`"
done
echo $files
echo $mfiles
files=`echo "$files" | sed 's/\.mod//g'`
if test "$files" = '*' ; then
files=""
fi
cd $MODSUBDIR
mdir=`pwd`
for i in $files; do
rm -f "`basename $i`".mod
ln -s ../$i.mod .
done
if test "$incs" != "" ; then
for i in $incs ; do
rm -f "`basename $i`"
ln -s ../$i .
done
fi
bfiles=`echo "$mfiles" | sed 's/\.mod//g'`
for i in $cfiles; do
rm -f $i
ln -s ../$i .
done
COBJS=
MODOBJS=
if [ `echo "\n"` ] ; then
newline="\n"
else
newline="\\\\n"
fi
echo '#include <stdio.h>
#include "hocdec.h"
extern int nrnmpi_myid;
extern int nrn_nobanner_;
' > mod_func.c
for i in $bfiles ; do
echo 'extern void _'$i'_reg(void);' >> mod_func.c
done
echo '
void modl_reg(){
if (!nrn_nobanner_) if (nrnmpi_myid < 1) {
fprintf(stderr, "Additional mechanisms from files'$newline'");
' >> mod_func.c
if true ; then # the standard order
for i in $files
do
echo ' fprintf(stderr," '$i'.mod");' >>mod_func.c
done
else
# use "ls -x" to sort alphabetically by lines
# use "ls -C" to sort alphabetically by columns
ls -C $mfiles | sed 's/\(.*\)/ fprintf(stderr,"\1\\n");/' >> mod_func.c
fi
echo ' fprintf(stderr, "'$newline'");
}' >>mod_func.c
for i in $bfiles; do
echo ' _'$i'_reg();' >> mod_func.c
MODOBJS="$MODOBJS $i.o"
done
echo "}" >> mod_func.c
if test -n "$cfiles" ; then
COBJS=`echo "$cfiles" | sed 's/\.c/.o/g'`
fi
#make -f "${MAKEFILEDIR}/nrniv_makefile" "$PURIFY" "$TRACE" "MODOBJFILES=$MODOBJS" "COBJFILES=$COBJS" "UserLDFLAGS=$UserLDFLAGS" "UserINCFLAGS=$UserINCFLAGS" special &&
# echo "Successfully created $MODSUBDIR/special"
MODLO=`echo "$MODOBJS" | sed 's/\.o/.lo/g'`
CLO=`echo "$COBJS" | sed 's/\.o/.lo/g'`
if test "${mdir}" = "${prefix}/share/nrn/demo/release/powerpc" ; then
mdir='${NRNHOME}'/share/nrn/demo/release/${MODSUBDIR}
fi
make -f "$MAKEFILEDIR/nrnmech_makefile" "MODOBJFILES=$MODLO" "COBJFILES=$CLO" "UserLDFLAGS=$UserLDFLAGS" "UserINCFLAGS=$UserINCFLAGS" libnrnmech.la &&
echo '#!/bin/sh
if test "x${NRNHOME}" = "x" ; then
NRNHOME='"\"${prefix}\""'
fi'> special &&
echo 'if test "x${NRNBIN}" = "x" ; then
NRNBIN='"\"${bindir}/\""'
fi'>> special &&
echo 'if test "" = "yes" ; then
NRNIV="${NRNBIN}nrniv.app/Contents/MacOS/nrniv"
else
NRNIV="${NRNBIN}nrniv"
fi' >> special &&
echo '"${NRNIV}"'" -dll \"${mdir}/.libs/libnrnmech.so\" \"\$@\"" >> special &&
chmod 755 special &&
echo "Successfully created $MODSUBDIR/special"
#if false ; then
if false ; then
#if false ; then
vv=`sw_vers -productVersion|sed 's/.*\.\(.*\)\..*/\1/'`
#if test $vv -gt 6 ; then
if false ; then
echo "use @executable_path prefix for install_name for dylib absolute paths"
ff="${mdir}/.libs/libnrnmech.so"
f=`otool -L "$ff" | sed -n "s,.*$libdir/\(.*dylib\).*,\
-change $libdir/\1 @executable_path/../lib/\1,p"`
install_name_tool $f "$ff"
fi
fi
|