LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MCC DAQ Linux Drivers... (https://www.linuxquestions.org/questions/linux-newbie-8/mcc-daq-linux-drivers-910279/)

dmoyamendez 10-26-2011 09:29 AM

MCC DAQ Linux Drivers...
 
On mccdaq.com, there is a link to download linux drivers for Measurement Computing's products; however, there is no technical support available from the company to help actually install the drivers.

I'm a linux noob, and I really need some help with this. Does anyone have any ideas?

Much appreciated.

theNbomr 10-26-2011 10:44 AM

I took a quick look, and it appears that the packages require you to build the drivers from the source code that makes up the driver package. You unpack the tarball, and run make. This will result in kernel drivers (xxxx.ko for 2.6 kernels), which you load at runtime with modprobe or insmod. There seems to be a udev configuration file, which should allow you to set up properly configured drivers at boot time.
There is paid support available from MCC, and the driver author's name and contact information is all over the source packages. In the package I downloaded, the included README file provides more detailed information about what I've written here.

--- rod.

dmoyamendez 10-26-2011 01:22 PM

When I run make, I get this error:


Quote:

Makefile:71: pmd.d: No such file or directory
Makefile:71: usb-1208LS.d: No such file or directory
Makefile:71: usb-1024LS.d: No such file or directory
Makefile:71: usb-1208FS.d: No such file or directory
Makefile:71: usb-1408FS.d: No such file or directory
Makefile:71: usb-1608FS.d: No such file or directory
Makefile:71: usb-tc.d: No such file or directory
Makefile:71: usb-tc-ai.d: No such file or directory
Makefile:71: usb-temp.d: No such file or directory
Makefile:71: usb-1096HFS.d: No such file or directory
Makefile:71: usb-1616FS.d: No such file or directory
Makefile:71: minilab-1008.d: No such file or directory
Makefile:71: usb-52XX.d: No such file or directory
Makefile:71: usb-ssr.d: No such file or directory
Makefile:71: usb-3100.d: No such file or directory
Makefile:71: usb-pdiso8.d: No such file or directory
Makefile:71: usb-erb.d: No such file or directory
Makefile:71: usb-4303.d: No such file or directory
Makefile:71: usb-dio24.d: No such file or directory
set -e; gcc -I. -M usb-dio24.c \
| sed 's/\(usb-dio24\)\.o[ :]*/\1.o usb-dio24.d : /g' > usb-dio24.d; \
[ -s usb-dio24.d ] || rm -f usb-dio24.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-4303.c \
| sed 's/\(usb-4303\)\.o[ :]*/\1.o usb-4303.d : /g' > usb-4303.d; \
[ -s usb-4303.d ] || rm -f usb-4303.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-erb.c \
| sed 's/\(usb-erb\)\.o[ :]*/\1.o usb-erb.d : /g' > usb-erb.d; \
[ -s usb-erb.d ] || rm -f usb-erb.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-pdiso8.c \
| sed 's/\(usb-pdiso8\)\.o[ :]*/\1.o usb-pdiso8.d : /g' > usb-pdiso8.d; \
[ -s usb-pdiso8.d ] || rm -f usb-pdiso8.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-3100.c \
| sed 's/\(usb-3100\)\.o[ :]*/\1.o usb-3100.d : /g' > usb-3100.d; \
[ -s usb-3100.d ] || rm -f usb-3100.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-ssr.c \
| sed 's/\(usb-ssr\)\.o[ :]*/\1.o usb-ssr.d : /g' > usb-ssr.d; \
[ -s usb-ssr.d ] || rm -f usb-ssr.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-52XX.c \
| sed 's/\(usb-52XX\)\.o[ :]*/\1.o usb-52XX.d : /g' > usb-52XX.d; \
[ -s usb-52XX.d ] || rm -f usb-52XX.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M minilab-1008.c \
| sed 's/\(minilab-1008\)\.o[ :]*/\1.o minilab-1008.d : /g' > minilab-1008.d; \
[ -s minilab-1008.d ] || rm -f minilab-1008.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1616FS.c \
| sed 's/\(usb-1616FS\)\.o[ :]*/\1.o usb-1616FS.d : /g' > usb-1616FS.d; \
[ -s usb-1616FS.d ] || rm -f usb-1616FS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1096HFS.c \
| sed 's/\(usb-1096HFS\)\.o[ :]*/\1.o usb-1096HFS.d : /g' > usb-1096HFS.d; \
[ -s usb-1096HFS.d ] || rm -f usb-1096HFS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-temp.c \
| sed 's/\(usb-temp\)\.o[ :]*/\1.o usb-temp.d : /g' > usb-temp.d; \
[ -s usb-temp.d ] || rm -f usb-temp.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-tc-ai.c \
| sed 's/\(usb-tc-ai\)\.o[ :]*/\1.o usb-tc-ai.d : /g' > usb-tc-ai.d; \
[ -s usb-tc-ai.d ] || rm -f usb-tc-ai.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-tc.c \
| sed 's/\(usb-tc\)\.o[ :]*/\1.o usb-tc.d : /g' > usb-tc.d; \
[ -s usb-tc.d ] || rm -f usb-tc.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1608FS.c \
| sed 's/\(usb-1608FS\)\.o[ :]*/\1.o usb-1608FS.d : /g' > usb-1608FS.d; \
[ -s usb-1608FS.d ] || rm -f usb-1608FS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1408FS.c \
| sed 's/\(usb-1408FS\)\.o[ :]*/\1.o usb-1408FS.d : /g' > usb-1408FS.d; \
[ -s usb-1408FS.d ] || rm -f usb-1408FS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1208FS.c \
| sed 's/\(usb-1208FS\)\.o[ :]*/\1.o usb-1208FS.d : /g' > usb-1208FS.d; \
[ -s usb-1208FS.d ] || rm -f usb-1208FS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1024LS.c \
| sed 's/\(usb-1024LS\)\.o[ :]*/\1.o usb-1024LS.d : /g' > usb-1024LS.d; \
[ -s usb-1024LS.d ] || rm -f usb-1024LS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M usb-1208LS.c \
| sed 's/\(usb-1208LS\)\.o[ :]*/\1.o usb-1208LS.d : /g' > usb-1208LS.d; \
[ -s usb-1208LS.d ] || rm -f usb-1208LS.d
/bin/sh: gcc: command not found
set -e; gcc -I. -M pmd.c \
| sed 's/\(pmd\)\.o[ :]*/\1.o pmd.d : /g' > pmd.d; \
[ -s pmd.d ] || rm -f pmd.d
/bin/sh: gcc: command not found
gcc -g -Wall -fPIC -c -o pmd.o pmd.c
make: gcc: Command not found
make: *** [pmd.o] Error 127

dmoyamendez 10-26-2011 01:25 PM

By the way, thank you for your prompt response, Rod.
I was not aware of the paid support service; however, I don't think would use it unless exhausted all other options. :)

dmoyamendez 10-26-2011 02:07 PM

Okay, so after installing the gcc, libhid, libusb, and libusb-dev packages and running make again, I get this error:

Quote:

gcc -static -g -Wall -I. -o test-usb1208LS test-usb1208LS.c -lmccusb -L. -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [test-usb1208LS] Error 1

theNbomr 10-26-2011 03:37 PM

The error message is saying than the linker (/usr/bin/ld) cannot find the sytandard C library, and the math library. Usually, a properly installed toolchain will know where to find those, since they are integral parts of the toolchain itself. Does your build host have a libm.so and libc.so somewhere? What is the output of
Code:

gcc -print-search-dirs
The toolchain will look in all of the places listed to find its component parts. Did you use a distro repository to get your toolchain, or did you roll your own somehow?

--- rod.

knudfl 10-26-2011 03:46 PM

Quote:

... after installing the gcc ...
GCC alone will not do.
Usually all dependencies get installed with g++ or gcc-c++ :
Different package names for different OS's.

Ubuntu : libc6-dev linux-libc-dev
Fedora : glibc-devel kernel-headers

dmoyamendez 10-26-2011 04:13 PM

Quote:

Originally Posted by theNbomr (Post 4509165)
What is the output of
Code:

gcc -print-search-dirs

Code:

install: /usr/lib/gcc/i686-redhat-linux/4.6.1/
programs: =/usr/libexec/gcc/i686-redhat-linux/4.6.1/:/usr/libexec/gcc/i686-redhat-linux/4.6.1/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../../i686-redhat-linux/bin/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../../i686-redhat-linux/bin/
libraries: =/usr/lib/gcc/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../../i686-redhat-linux/lib/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../../i686-redhat-linux/lib/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../:/lib/i686-redhat-linux/4.6.1/:/lib/:/usr/lib/i686-redhat-linux/4.6.1/:/usr/lib/


dmoyamendez 10-26-2011 04:18 PM

@knudfl

Code:

[root@fedora pps]# yum install glibc-devel
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Package glibc-devel-2.14-5.i686 already installed and latest version
Nothing to do
[root@fedora pps]# yum install kernel-headers
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Package kernel-headers-2.6.40.6-0.fc15.i686 already installed and latest version
Nothing to do


theNbomr 10-26-2011 04:50 PM

Okay, so it looks like the glibc-devel package is installed, but what about glibc itself? I cannot imagine a working system that doesn't have glibc.so.something. The Makefile must be specifying some odd compiler switch '-L'.

I'm not sure what usually provides libm; perhaps you can use your package manager to look it up for your distro. As far as I know, it should have come with gcc as well.

Put the follwing code in a C source file, lmath.c
Code:

#include        <stdio.h>
#include        <math.h>

int    main(){

double  a = sin( 3.1415926L );
        printf( "%lf\n", a );
}

Then, try building it with
Code:

make CFLAGS+=--verbose LDFLAGS+=-lm lmath
If that succeeds, then the answer must be in the driver's Makefile somewhere, possibly in the definition of $(LDFLAGS).

--- rod.

dmoyamendez 10-27-2011 09:30 AM

Quote:

Originally Posted by theNbomr (Post 4509212)
Okay, so it looks like the glibc-devel package is installed, but what about glibc itself?

glibc-2.14-5 is installed.


After stumbling upon a similar problem that someone else had on another forum site, I found that running dmesg | tail displayed information that confirmed that the USB device was being read.
Code:

[root@fedora input]# dmesg | tail
[ 2354.763919] CE: hpet increased min_delta_ns to 67879 nsec
[ 3801.364396] SELinux: initialized (dev sda2, type fuseblk), uses genfs_contexts
[ 4987.750138] usb 5-1: USB disconnect, device number 2
[ 4992.000082] usb 5-1: new low speed USB device number 3 using uhci_hcd
[ 4992.170092] usb 5-1: New USB device found, idVendor=09db, idProduct=007a
[ 4992.170099] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4992.170104] usb 5-1: Product: USB-1208LS
[ 4992.170107] usb 5-1: Manufacturer: MCC
[ 4992.170110] usb 5-1: SerialNumber: 0159ADDE
[ 5077.250091] usb 6-1: USB disconnect, device number 2

I'm not sure where to go from here... ?

theNbomr 10-27-2011 09:42 AM

That is simply telling you that the USB driver layer (upon which your driver depends) is finding the device. Your driver will use that to find and communicate with the data acquisition device. Your findings will be useful once you get the driver built and loaded. Right now, you need to focus on the driver build, or have you solved that?

--- rod.

dmoyamendez 10-27-2011 09:51 AM

Yes, I ran the make install on the untar-red file and got it all to compile.

Edit: I would give more detail, but I did all of that yesterday, trying all kinds of different things to get it working, and to be honest I don't remember everything I updated.

dmoyamendez 10-27-2011 10:11 AM

Quote:

Originally Posted by theNbomr (Post 4509212)
Okay, so it looks like the glibc-devel package is installed, but what about glibc itself? I cannot imagine a working system that doesn't have glibc.so.something. The Makefile must be specifying some odd compiler switch '-L'.

I'm not sure what usually provides libm; perhaps you can use your package manager to look it up for your distro. As far as I know, it should have come with gcc as well.

Put the follwing code in a C source file, lmath.c
Code:

#include        <stdio.h>
#include        <math.h>

int    main(){

double  a = sin( 3.1415926L );
        printf( "%lf\n", a );
}

Then, try building it with
Code:

make CFLAGS+=--verbose LDFLAGS+=-lm lmath
If that succeeds, then the answer must be in the driver's Makefile somewhere, possibly in the definition of $(LDFLAGS).

--- rod.

Code:

[pps@fedora ~]$ make CFLAGS+=--verbose LDFLAGS+=-lm lmath
cc --verbose  -lm  lmath.c  -o lmath
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.6.1/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.6.1 20110908 (Red Hat 4.6.1-9) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'lmath' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.6.1/cc1 -quiet -v lmath.c -quiet -dumpbase lmath.c -mtune=generic -march=i686 -auxbase lmath -version -o /tmp/ccg4hI0X.s
GNU C (GCC) version 4.6.1 20110908 (Red Hat 4.6.1-9) (i686-redhat-linux)
        compiled by GNU C version 4.6.1 20110908 (Red Hat 4.6.1-9), GMP version 4.3.2, MPFR version 3.0.0, MPC version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/i686-redhat-linux/4.6.1/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../../i686-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i686-redhat-linux/4.6.1/include
 /usr/local/include
 /usr/include
End of search list.
GNU C (GCC) version 4.6.1 20110908 (Red Hat 4.6.1-9) (i686-redhat-linux)
        compiled by GNU C version 4.6.1 20110908 (Red Hat 4.6.1-9), GMP version 4.3.2, MPFR version 3.0.0, MPC version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7c75a840b33bb054b6c8e0f7ad3bf699
COLLECT_GCC_OPTIONS='-v' '-o' 'lmath' '-mtune=generic' '-march=i686'
 as --32 -o /tmp/ccILG3LS.o /tmp/ccg4hI0X.s
COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.6.1/:/usr/libexec/gcc/i686-redhat-linux/4.6.1/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.6.1/:/usr/lib/gcc/i686-redhat-linux/4.6.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'lmath' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.6.1/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o lmath /usr/lib/gcc/i686-redhat-linux/4.6.1/../../../crt1.o /usr/lib/gcc/i686-redhat-linux/4.6.1/../../../crti.o /usr/lib/gcc/i686-redhat-linux/4.6.1/crtbegin.o -L/usr/lib/gcc/i686-redhat-linux/4.6.1 -L/usr/lib/gcc/i686-redhat-linux/4.6.1/../../.. -lm /tmp/ccILG3LS.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-redhat-linux/4.6.1/crtend.o /usr/lib/gcc/i686-redhat-linux/4.6.1/../../../crtn.o


dmoyamendez 10-27-2011 10:18 AM

I know I'm flooding you with posts now, but after compiling the lmath.c program, the output is: 0.000000

Pretty sure that's not right... ;)


All times are GMT -5. The time now is 03:25 AM.