Instrument control package: Difference between revisions

Line 71: Line 71:
# Prerequisits are that during install of the NI drivers, the C/C++ support  
# Prerequisits are that during install of the NI drivers, the C/C++ support  
# and the NI Measurement & Automation explorer has been enabled.
# and the NI Measurement & Automation explorer has been enabled.
# set the base for includes and libraries on your system
# it is usally /usr, but on newer windows installs of octave, it will be
# /mingw64
INSTALL_BASE=/usr


# this define should find the NI header file, if properly installled
# this define should find the NI header file, if properly installled
Line 79: Line 84:


# symlink NI header file
# symlink NI header file
mkdir -p /usr/include/gpib/
mkdir -p ${INSTALL_BASE}/include/gpib/
ln -sf "${NI_H_FILE}" /usr/include/gpib/ib.h
ln -sf "${NI_H_FILE}" ${INSTALL_BASE}/include/gpib/ib.h


# generate .def for all functions in the NI header file with a NI488CC prefix
# generate .def for all functions in the NI header file with a NI488CC prefix
echo LIBRARY ${NI_DLL_FILE} > ${NI_DEF_FILE}
echo LIBRARY ${NI_DLL_FILE} > ${NI_DEF_FILE}
echo EXPORTS >> ${NI_DEF_FILE}
echo EXPORTS >> ${NI_DEF_FILE}
grep "NI488CC  *[A-Za-z]" /usr/include/gpib/ib.h \
grep "NI488CC  *[A-Za-z]" ${INSTALL_BASE}/include/gpib/ib.h \
   | sed "s/^.*NI488CC  *//" \
   | sed "s/^.*NI488CC  *//" \
   | sed "s/(.*$//" >> ${NI_DEF_FILE}
   | sed "s/(.*$//" >> ${NI_DEF_FILE}


# generate the wrapper library simulating gpib-linux
# generate the wrapper library simulating gpib-linux
dlltool -d ${NI_DEF_FILE} -l /usr/lib/libgpib.a
dlltool -d ${NI_DEF_FILE} -l ${INSTALL_BASE}/lib/libgpib.a


#cleanup  
#cleanup  
Anonymous user