LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2008, 02:36 PM   #1
tekmann33
Member
 
Registered: Nov 2006
Posts: 188

Rep: Reputation: 30
Compiling files


I am trying to install an ASUS System Web-based Management tool on an ASUS Server and I am having trouble installing the rpm's.

The rpm files are on the System board CD. There are three of them:

Code:
aswm_core-2.0-312.el4rhat.x86_64.rpm
aswm_doc-2.0-9.noarch.rpm
aswm_rs163-e4_rx4-2.0-312.el4rhat.x86_64.rpm
When I install the first "core" rpm, I get this message:
Code:
[root@localhost x86_64]# rpm -ivh aswm_core-2.0-312.el4rhat.x86_64.rpm
Preparing...                ########################################### [100%]
   1:aswm_core              ########################################### [100%]
Warning: ASWM drivers doesn't support your running kernel 2.6.23.15-137.fc8
Please get the ASWM driver source code in /usr/aswm/lib/modules/src.
Untar and compile ghadrv,iodrv and laninfo for kernel 2.6.23.15-137.fc8.
Error, Can't find /etc/syslog.conf
Setting log file failed!
Please install the model RPM for running aswm.
[root@localhost x86_64]#
I then go to my /usr/aswm/lib/modules/src file and unpack and untar the indicated file and I see some directories as well as a macro makefile and version file:

Code:
[root@localhost src]# ls
drvsrc  drvsrc.tgz
[root@localhost src]# cd drvsrc
[root@localhost drvsrc]# ls
ghadrv  ghadrv_base  ghaipmi  iodrv  laninfo  macro  makefile  version
[root@localhost drvsrc]#
I go into the first directory and I see what looks like C code files:

Code:
[root@localhost drvsrc]# cd ghadrv
[root@localhost ghadrv]# ls
gha_common.o  ghadrv_kernel.c  ghaioctl.h  ghipmi_exp.h  load  Makefile  unload
[root@localhost ghadrv]#
What is the correct method to compile these files for the kernel? Would I use the gcc command? My experience with compiling code with Linux is by using the configure make and make install commands.

Any help would be appreciated.
 
Old 02-22-2008, 02:56 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
You most likely just have to type make, although that usually depends on your kernel-source symlink being setup correctly (/lib/modules/`uname -r`/build -> your_kernel_sourcedir).
 
Old 02-22-2008, 03:10 PM   #3
tekmann33
Member
 
Registered: Nov 2006
Posts: 188

Original Poster
Rep: Reputation: 30
When I execute the make command, I am not sure what this output is telling me:

Code:
[root@localhost ghadrv]# pwd
/usr/aswm/lib/modules/src/drvsrc/ghadrv
[root@localhost ghadrv]# ls
gha_common.o  ghadrv_kernel.c  ghaioctl.h  ghipmi_exp.h  load  Makefile  unload
[root@localhost ghadrv]# make
../iodrv/checkCompiler.mk:18: *** commands commence before first target.  Stop.
[root@localhost ghadrv]#
This is my kernel information:
Code:
[root@localhost ghadrv]# uname -r
2.6.23.15-137.fc8
[root@localhost ghadrv]#
My symlinks appear to be directed to the right kernel version:

Code:
[root@localhost 2.6.23.15-137.fc8]# pwd
/lib/modules/2.6.23.15-137.fc8
[root@localhost 2.6.23.15-137.fc8]# ls -l build
lrwxrwxrwx 1 root root 49 2008-02-21 20:15 build -> ../../../usr/src/kernels/2.6.23.15-137.fc8-x86_64
[root@localhost 2.6.23.15-137.fc8]#
 
Old 02-22-2008, 04:07 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Quote:
Originally Posted by tekmann33 View Post
Code:
[root@localhost ghadrv]# pwd
/usr/aswm/lib/modules/src/drvsrc/ghadrv
[root@localhost ghadrv]# ls
gha_common.o  ghadrv_kernel.c  ghaioctl.h  ghipmi_exp.h  load  Makefile  unload
[root@localhost ghadrv]# make
../iodrv/checkCompiler.mk:18: *** commands commence before first target.  Stop.
[root@localhost ghadrv]#
Thatís odd. Perhaps you should try from the parent directory, and it will descend into each target. Are you sure that none of the files are executable? If it still doesnít work, I suggest looking at iodrv/checkCompiler.mk (specifically around line 18) to see what the package creator was intending.
 
Old 02-22-2008, 04:47 PM   #5
tekmann33
Member
 
Registered: Nov 2006
Posts: 188

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by osor View Post
Thatís odd. Perhaps you should try from the parent directory, and it will descend into each target. Are you sure that none of the files are executable? If it still doesnít work, I suggest looking at iodrv/checkCompiler.mk (specifically around line 18) to see what the package creator was intending.
When I execute the make command from the parent directory, I get the same message:
Code:
[root@localhost drvsrc]# pwd
/usr/aswm/lib/modules/src/drvsrc
[root@localhost drvsrc]# ls
ghadrv  ghadrv_base  ghaipmi  iodrv  laninfo  macro  makefile  version
[root@localhost drvsrc]# make
make  -C  iodrv
make[1]: Entering directory `/usr/aswm/lib/modules/src/drvsrc/iodrv'
checkCompiler.mk:18: *** commands commence before first target.  Stop.
make[1]: Leaving directory `/usr/aswm/lib/modules/src/drvsrc/iodrv'
make: *** [_all_iodrv] Error 2
[root@localhost drvsrc]#
Within each directory, there are two executables: load and unload:
Code:
[root@localhost ghadrv]# pwd
/usr/aswm/lib/modules/src/drvsrc/ghadrv
[root@localhost ghadrv]# ls -l
total 112
-rw-r--r-- 1 root root 44888 2006-12-13 22:34 gha_common.o
-rw-r--r-- 1 root root 17586 2006-05-19 02:08 ghadrv_kernel.c
-rw-r--r-- 1 root root  3895 2005-09-26 03:44 ghaioctl.h
-rw-r--r-- 1 root root   680 2003-11-05 04:34 ghipmi_exp.h
-rwxr-xr-x 1 root root   937 2006-02-20 03:09 load
-rw-r--r-- 1 root root  3699 2005-07-07 03:40 Makefile
-rwxr-xr-x 1 root root   197 2005-05-05 06:01 unload
[root@localhost ghadrv]#
When I execute the load command, I receive a message that a driver is missing:

Code:
[root@localhost ghadrv]# ./load
load driver : ./2.6.23.15-137.fc8/gha.o
Unable to load driver, can't find driver!

gha_common.o  ghadrv_kernel.c  ghaioctl.h  ghipmi_exp.h  load  Makefile  unload
[root@localhost ghadrv]#
The following is the from the file usr/aswm/lib/modules/src/drvsrc/iodrv\
checkCompiler.mk
Code:
 1 # checkCompiler.mk
  2 # Dennis Yang
  3 # Include this for checking the compiler
  4 # Support RedHat, RHEL_AS_30, RHEL_AS_40, SUSE, SUEL_9
  5 # This .mk will parapre these parameters
  6 # $(CC) $(CPP)
  7 # Start: 2005/05/04
  8 
  9 CC := gcc
 10 cc := $(shell which $(CC) > /dev/null 2>&1 && echo 1)
 11 ifeq (,$(cc))
 12         $(error Can not detect compiler $(CC))
 13 endif
 14 
 15 CPP := g++
 16 cpp := $(shell which $(CPP) > /dev/null 2>&1 && echo 1)
 17 ifeq (,$(cpp))
 18         $(warning Can not detect compiler $(CPP))
 19 endif
I am not sure why it cannot see the compiler since I have the following installed:

Code:
[root@localhost iodrv]# rpm -qa | grep gcc
gcc-4.1.2-33
avr-gcc-c++-4.1.2-5.fc8
libgcc-4.1.2-33
libgcc-4.1.2-33
avr-gcc-4.1.2-5.fc8
[root@localhost iodrv]#
 
Old 02-22-2008, 05:21 PM   #6
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Do you have both gcc and g++ installed? Do you have the which utility installed? Are both gcc and g++ in your PATH? If the answer to all of these questions is yes, you can safely replace checkCompiler.mk by the following two-line file:
Code:
CC  := gcc
CPP := g++
I personally donít understand why it checks for g++ since I donít see any C++ source files.
 
Old 06-24-2008, 11:31 AM   #7
groenegrasmat
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
Just came across your post and saw that you have the same goal as I have, prop your gcc is fine so here is the first part of the solution;


Quote:
Originally Posted by tekmann33 View Post
When I execute the make command from the parent directory, I get the same message:
Code:
[root@localhost drvsrc]# pwd
/usr/aswm/lib/modules/src/drvsrc
[root@localhost drvsrc]# ls
ghadrv  ghadrv_base  ghaipmi  iodrv  laninfo  macro  makefile  version
[root@localhost drvsrc]# make
make  -C  iodrv
make[1]: Entering directory `/usr/aswm/lib/modules/src/drvsrc/iodrv'
checkCompiler.mk:18: *** commands commence before first target.  Stop.
make[1]: Leaving directory `/usr/aswm/lib/modules/src/drvsrc/iodrv'
make: *** [_all_iodrv] Error 2
[root@localhost drvsrc]#
Within each directory, there are two executables: load and unload:
Code:
[root@localhost ghadrv]# pwd
/usr/aswm/lib/modules/src/drvsrc/ghadrv
[root@localhost ghadrv]# ls -l
total 112
-rw-r--r-- 1 root root 44888 2006-12-13 22:34 gha_common.o
-rw-r--r-- 1 root root 17586 2006-05-19 02:08 ghadrv_kernel.c
-rw-r--r-- 1 root root  3895 2005-09-26 03:44 ghaioctl.h
-rw-r--r-- 1 root root   680 2003-11-05 04:34 ghipmi_exp.h
-rwxr-xr-x 1 root root   937 2006-02-20 03:09 load
-rw-r--r-- 1 root root  3699 2005-07-07 03:40 Makefile
-rwxr-xr-x 1 root root   197 2005-05-05 06:01 unload
[root@localhost ghadrv]#
When I execute the load command, I receive a message that a driver is missing:

Code:
[root@localhost ghadrv]# ./load
load driver : ./2.6.23.15-137.fc8/gha.o
Unable to load driver, can't find driver!

gha_common.o  ghadrv_kernel.c  ghaioctl.h  ghipmi_exp.h  load  Makefile  unload
[root@localhost ghadrv]#
The following is the from the file usr/aswm/lib/modules/src/drvsrc/iodrv\
checkCompiler.mk
Code:
 1 # checkCompiler.mk
  2 # Dennis Yang
  3 # Include this for checking the compiler
  4 # Support RedHat, RHEL_AS_30, RHEL_AS_40, SUSE, SUEL_9
  5 # This .mk will parapre these parameters
  6 # $(CC) $(CPP)
  7 # Start: 2005/05/04
  8 
  9 CC := gcc
 10 cc := $(shell which $(CC) > /dev/null 2>&1 && echo 1)
 11 ifeq (,$(cc))
 12         $(error Can not detect compiler $(CC))
 13 endif 14 
 15 CPP := g++
 16 cpp := $(shell which $(CPP) > /dev/null 2>&1 && echo 1)
 17 ifeq (,$(cpp))
 18         $(warning Can not detect compiler $(CPP))
 19 endif
I am not sure why it cannot see the compiler since I have the following installed:

Code:
[root@localhost iodrv]# rpm -qa | grep gcc
gcc-4.1.2-33
avr-gcc-c++-4.1.2-5.fc8
libgcc-4.1.2-33
libgcc-4.1.2-33
avr-gcc-4.1.2-5.fc8
[root@localhost iodrv]#
First red marked line means that you have [tabs] (before spitting output) in your script. Remove them (see 3rd red line). Now your script will run but will still stop with errors.

Second red line will not work, as the file ghaio.o is not yet generated.

The make command from the drvsrc directory will go to the appropriate directories and run the make command, during this process the *****.mod.o and the *****.o files are generated for your kernel version. After this process you will have a new directory in all the subdirs of drvsrc and will be able to load the files, but there is no need to do this manually.

This is where is goes wrong for me now. I get an error 126: cannot execute file. My rights are all as they should be but....

So far all the info that is usefull to you, if you get further then this please let me know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling c++ files :( gizmo_thunder Programming 6 10-23-2007 01:57 PM
Compiling and installing gz files xennetwork Linux - Newbie 30 04-26-2006 01:21 AM
Compiling driver files AngryDwarf Linux - Hardware 1 09-28-2005 08:05 AM
compiling .h and .cpp files with g++ arnab_be Linux - Newbie 2 03-03-2004 03:23 PM
Compiling files bacloff Linux - Software 3 08-27-2003 09:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration