Can't compile qc-usb driver? [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Ubuntu 11.04 64-bit [Tried on SuSE 32-bit, and got same error], I have gcc, and can compile normal C programs.. and the linux headers in /usr/src/linux-headers-2.6*
I downlaoded this driver:
http://qce-ga.sourceforge.net/#download
downloaded, extracted, ran make all and this is the output
matt: /d/dl/qc-usb-0.6.6 $ make all
make -C "/lib/modules/2.6.38-8-generic/build" SUBDIRS="/home/matt/Desktop/dl/qc-usb-0.6.6" modules V=1 USER_OPT="-DHAVE_UTSRELEASE_H="
make[1]: Entering directory `/usr/src/linux-headers-2.6.38-8-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_versions ; rm -f /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/matt/Desktop/dl/qc-usb-0.6.6
gcc -Wp,-MD,/home/matt/Desktop/dl/qc-usb-0.6.6/.qc-driver.o.d -nostdinc -isystem /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include -I/usr/src/linux-headers-2.6.38-8-generic/arch/x86/include -Iinclude -include include/generated/autoconf.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=1024 -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DNOKERNEL -DHAVE_UTSRELEASE_H= -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(qc_driver)" -D"KBUILD_MODNAME=KBUILD_STR(quickcam)" -c -o /home/matt/Desktop/dl/qc-usb-0.6.6/.tmp_qc-driver.o /home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.c
In file included from /home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.c:47:0:
/home/matt/Desktop/dl/qc-usb-0.6.6/quickcam.h:79:28: fatal error: linux/autoconf.h: No such file or directory
compilation terminated.
make[2]: *** [/home/matt/Desktop/dl/qc-usb-0.6.6/qc-driver.o] Error 1
make[1]: *** [_module_/home/matt/Desktop/dl/qc-usb-0.6.6] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-8-generic'
make: *** [quickcam.ko] Error 2
Note: I tried what this is suggesting I run [make oldconfig &&]. Here is a URL of the output: http://pastebin.com/ccnYn9uc
I googled a bit, and someone said to, in the kernel source, run make menuconfig and so I ran it but I have no clue what to change.. can you help me? thanks

You are trying to compile on 2.6.38, but include/linux/autoconf.h does not exist anymore since 2.6.33 (it was moved somewhere else in commit 264a26838056fc2d759f58bec2e720e01fcb1bdb). Besides, it should not need to be included by hand - the kernel build system does it automatically for you (see the -include in the gcc command line).
You do not need to run make menuconfig, and probably should not change anything using it - the kernel is already configured for your distribution, and changing it to something which does not match the running kernel can make the module not work correctly. Even make oldconfig should not be needed; what looks like a message saying to run make oldconfig is in fact code to detect if it is needed and print that message in that case (for some reason the driver you are trying to compile enabled some verbose mode which prints all commands before running them).
The problem you have is that the driver you are trying to compile is too old - the sourceforge release page shows it is from 2006, back when the latest kernel was still 2.6.18. The kernel internal API is not stable and changes frequently, so even if you fixed that error (probably simply removing the incorrect #include), it will probably still fail to compile due to several other changes. The drivers which come with the Linux kernel do not have that problem because it is the responsibility of the one who made the API change to fix all the drivers, but for drivers which are outside the Linux kernel tree, it is the driver author's responsibility to closely follow the kernel development and fix his driver whenever the API changed.
Your options are to find a newer driver (one which works in 2.6.38), or get someone who understands the Linux kernel to update your driver to 2.6.38. And to prevent it breaking in the future, it should be submitted to the Linux kernel.
And in fact, the kernel does seem to already have a driver for these devices. It is called gspca_stv06xx, and claims the three USB IDs the driver you were trying to compile claims - and many more.

One must wonder what did you Google. http://www.google.ca/search?sourceid=chrome&ie=UTF-8&q=%22fatal+error%3A+linux%2Fautoconf.h%3A+No+such+file+or+directory%22 very first result is a https://bbs.archlinux.org/viewtopic.php?id=103348 topic about a webcam(!) albeit on Arch it must be relevant. It's leading to http://aur.archlinux.org/packages.php?ID=9861 where you can find a tarball containing autoconf.patch. Read the topic and the linked Ubuntu topic it seems helpful.

Related

gcc make error on hpc

I want to use the hpc in our univerisity, but the gcc version of the system is too old to compile new packages that I need. So I want to install a new version gcc locally.
I downloaded the gcc-5.2.0 package and configured. When I make the files, there are some mistake, which lead to process killed. The last sentence before process killed is
/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/prev-gcc/xg++ -B/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/prev-gcc/ -B/home/$USERNAME/local/gcc-5.2.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/home/$USERNAME/software/gcc-5.2.0/libstdc++-v3/libsupc++ -L/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/home/$USERNAME/software/gcc-5.2.0/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -c -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I/home/$USERNAME/local/gmp-4.3.2//include -I/home/$USERNAME/local/mpfr-2.4.2/include -I/home/$USERNAME/local/mpc-1.0.1//include -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/bid -I../libdecnumber -I../.././gcc/../libbacktrace -o insn-recog.o -MT insn-recog.o -MMD -MP -MF ./.deps/insn-recog.TPo insn-recog.c
and the error information is
xg++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
make[3]: *** [insn-recog.o] Error 4
make[3]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0/host-x86_64-unknown-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory '/home/$USERNAME/software/gcc-5.2.0'
make: *** [all] Error 2
I have searched some question about this kind of problem, it seems that this is caused by not enough memory. But I run on a hpc with more than 20G memory free. So I don't what the problem is and how to solve it.
The OS version is Red Hat 4.4.7-3
The fact shows that it's still the memory problem. It seems that the login node doesn't use the swap memeory. I have to log into the test node to install softwares.
An internal compiler error (ICE) means that the compiler has detected a bug in itself. It might be that you're using some unusual code construct that causes the compiler to hit this bug. In any case, the first step you should do is to test with a newer compiler, in case the bug has already been fixed, as 5.2 that you're using now is still quite old. The latest version at the time of writing this is 7.2.

threading.h:10:24: fatal error installation error

Fairly unknowledgable linux (ubuntu 14.04) user here. I'm trying to install a bioinformatics program called Bowtie2 - I get this error and not sure where it's coming from. They did quote this on their website which might have something to do with it, but didn't mention it as a dependency.
TBB is now the default threading library. We consistently found TBB to
give superior thread scaling. It is widely available and widely
installed. That said, we are also preserving a "legacy" version of
Bowtie that, like previous releases, does not use TBB. To compile
Bowtie source in legacy mode use NO_TBB=1. To use legacy binaries,
download the appropriate binary archive with "legacy" in the name.
sam#SumnerLab-Computer:~/Program_Files/bowtie-1.2$ make
g++ -w -O3 -m64 -DCOMPILER_OPTIONS="\"-O3 -m64 -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \"" -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \
-fno-strict-aliasing -DBOWTIE_VERSION="\"`cat VERSION`\"" -DBUILD_HOST="\"`hostname`\"" -DBUILD_TIME="\"`date`\"" -DCOMPILER_VERSION="\"`g++ -w -v 2>&1 | tail -1`\"" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DPREFETCH_LOCALITY=2 -DBOWTIE_MM -DBOWTIE_SHARED_MEM -DNDEBUG -Wall \
-I SeqAn-1.1 -I third_party -I third_party \
-o bowtie-build-s ebwt_build.cpp \
ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp edit.cpp ebwt.cpp bowtie_build_main.cpp \
-lpthread -ltbb -ltbbmalloc_proxy
In file included from pat.h:17:0,
from sequence_io.h:12,
from multikey_qsort.h:8,
from diff_sample.h:8,
from blockwise_sa.h:13,
from ebwt.h:27,
from ebwt_build.cpp:11:
threading.h:10:24: fatal error: tbb/mutex.h: No such file or directory
compilation terminated.
Makefile:259: recipe for target 'bowtie-build-s' failed
make: *** [bowtie-build-s] Error 1
Any ideas what the issue might be?
thanks
You'll probably need to install the package TBB development package, e.g. libtbb-dev.
On Ubuntu, run sudo apt-get install libtbb-dev
​sudo apt-get install libtbb-dev
​make

Compiling program with Open Source libFTDI

I use Asus router (based on ARMv7 proc) with Advanced Tomato installed
on it as my ARMv7 developer platform. I install compiler (gcc - 5.4.0-1)
plus dependencies and libFTDI (libftdi1 - 1.3-1) from OpenWRT Linux
repo. OpenWRT does not provide libftdi-dev so I copied ftdi.h file from libFTDI download page to /opt/include directly. I try to compile program taken directly from libFTDI samples. The
compiler command is:
gcc -v -Wl,-rpath=/opt/usr/local/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/opt/lib -O2 -pipe -march=armv7-a -mtune=cortex-a9-fno-caller-saves -mfloat-abi=soft -l ftdi1 d.c -o d
But compilation fails because:
/opt/bin/ld: cannot find -lftdi1
But there is /opt/usr/local/lib/libftdi1.so linked to libftdi1.so.2
My LD_LIBRARY_PATH looks like this:
/lib:/usr/lib:/usr/local/lib:/opt/lib:/opt/usr/lib:/opt/include:/opt/usr/local/lib:/opt/usr/include
So what the problem is?
I dont know why (probably bug) but for compiler taken from OpenWRT repo, MUST have wanted library in /opt/lib. So simply copy libftdi1.so.2.3.0 file and linking it to libftdi1.so resolved problem. That means that it does not use correctly LD_LIBRARY_PATH variable. Finally compilation command looks like this:
gcc -v -Wl,-rpath=/opt/usr/local/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/opt/lib -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -l ftdi1 arco.c -o arco
From my point of view - topic closed

Installing PThread on linux for tophat

Bowtie is a program which is needed for tophat. I need this program to map a few hundredmilion reads against a reference genome. Bowtie does the mapping part, this needs many CPU. In the manual of bowtie there is an option to do this multithreaded, but the library PThread needs to be installed.
I downloaded PThread from this website. Extracted this to my program folder, opened a shell and was standing in this directory. When entering the command 'make', I get this error and I don't know how to solve this.
if /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 -MT PThreadRun.lo -MD -MP -MF ".deps/PThreadRun.Tpo" -c -o PThreadRun.lo PThreadRun.cpp; \
then mv -f ".deps/PThreadRun.Tpo" ".deps/PThreadRun.Plo"; else rm -f ".deps/PThreadRun.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 -MT PThreadRun.lo -MD -MP -MF .deps/PThreadRun.Tpo -c PThreadRun.cpp -fPIC -DPIC -o .libs/PThreadRun.o
PThreadRun.cpp: In member function 'pthread_t PThreadRun::start()':
PThreadRun.cpp:28:38: error: 'redirectPthreadRun' was not declared in this scope
make: * [PThreadRun.lo] Error 1
make: Leaving directory `/install_dir'
make: * [all-recursive] Error 1
make: Leaving directory `/install_dir'
make: * [all] Error 2
Anyone knows how to solve this?
You need to run configure first. Per the installation instructions:
These are generic installation instructions.
The configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create aMakefile' in each directory of the package.
It may also create one or more .h' files containing system-dependent
definitions. Finally, it creates a shell scriptconfig.status' that
you can run in the future to recreate the current configuration, and a
file config.log' containing compiler output (useful mainly for
debuggingconfigure').
It can also use an optional file (typically called config.cache'
and enabled with--cache-file=config.cache' or simply `-C') that
saves the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how configure' could check whether to do them, and mail
diffs or instructions to the address given in theREADME' so they can
be considered for the next release. If you are using the cache, and
at some point `config.cache' contains results you don't want to keep,
you may remove or edit it.
The file configure.ac' (orconfigure.in') is used to create
configure' by a program calledautoconf'. You only need
configure.ac' if you want to change it or regenerateconfigure'
using a newer version of `autoconf'.
The simplest way to compile this package is:
cd' to the directory containing the package's source code and type
./configure' to configure the package for your system. If you're
using csh' on an old version of System V, you might need to type
sh ./configure' instead to prevent csh' from trying to execute
configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
Type `make' to compile the package.
Optionally, type `make check' to run any self-tests that come with
the package.
Type `make install' to install the programs and any data files and
documentation.
You can remove the program binaries and object files from the
source code directory by typing make clean'. To also remove the
files thatconfigure' created (so you can compile the package for
a different kind of computer), type make distclean'. There is
also amake maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.

How to prevent GCC from passing in default flags?

I am trying to cross-compile linux for an ARM architecture.
The host is an X86 machine running ubuntu-jaunty. I downloaded a cross-compile toolchain for ARM from http://ftp.arm.linux.org.uk/pub/armlinux/toolchain/. I downloaded the 2.95.3 version of the toolchain.
The problem I am having is that GCC is passing in some default flags by itself that is causing GCC to then output error:
/usr/local/arm/2.95.3/bin/arm-linux-gcc -specs=/home/feroze/wnr834m/marvell_WNR834M/gcc_specs -D__KERNEL__ -I/home/feroze/wnr834m/marvell_WNR834M/linux-88fxx81-1_1_3_gtk/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -DLED_DUAL_COLOR -DFOR_ROUTER -I/home/feroze/wnr834m/marvell_WNR834M/linux-88fxx81-1_1_3_gtk/arch/arm/mach-mv88fxx81/Soc/gpp/ -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=5 -march=armv5 -mtune=arm9tdmi -mshort-load-bytes -msoft-float -Uarm -march=strongarm -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
cc1: bad value (strongarm) for -march= switch
make[1]: *** [init/main.o] Error 1
make[1]: Leaving directory `/home/feroze/wnr834m/marvell_WNR834M/linux-88fxx81-1_1_3_gtk'
I checked the whole makefile, and could not find any place where LINUX_ARM_ARCH_5 and -march=armv5 are being defined. I am defining -march=strongarm in the makefile, but then it gets appended by theh ARMv5 defines.
So, I created a defs file from gcc, modified it to only have options for ARMv4, and then used it by specifying the -specs= option. However, that still doesnt solve the problem.
Can somemone help? How do I resolve this?
Thanks!
feroze
The -march flag is set in arch/ARM/Makefile, and depends on the machine you selected in your config file. If you don't want the armv5 flag, be sure to select the correct architecture in the config file.
You should assume the kernel appended CFLAGS are right (provided your config is ok) and if your toolchain does not support one of them, then you have no choice but to cross compile a toolchain by yourself, using the original crosstol script that should work with 2.95.3
Edit : original answer
What are you trying to build ?
a 2.95.3 toolchain is fairly ancient. You should try a more recent toolchain. You can find a precompiled one here
Pick the EABI one to start.
This is not a direct answer to your problem, but if you are building the linux kernel, you should not need to mess with the Makefiles. You will get more help if you can get a more "standard" toolchain.
This won't strictly help you eliminate the issue, but you can do gcc -dM -E <empty_file.c> or gcc -dM -E -x c /dev/null to print out a listing of all the predefined #defines for gcc. Combine -dM with another flag like your -march and you might be able to track down what's causing your #define issue.
Be sure to check your environment variables, as they can persuade make to do unexpected things.
If the Makefile includes another file, it could be modifying CFLAGS before CC is called. Can you print the contents of CFLAGS just before the CC call?

Resources