compiling old C program in Linux.


 
Thread Tools Search this Thread
Top Forums Programming compiling old C program in Linux.
# 1  
Old 10-24-2011
compiling old C program in Linux.

Hello,
I am writing to ask for support about compiling an very old but famous C-progam for genetics study called MapMaker/QTL, and the source code is available from MIT:
Code:
http://www.broadinstitute.org/ftp/distribution/software/mapmaker3/

The program was originally designed for systems like SunOS SPARC station, Apple A/UX 3.0 and MS-DOS. I am trying to set it up in my Linux Box (Ubuntu 11.10 Ocelot), which seems never been tried before. When I searched the web there was only one try to port it for Mac OS,but there was no detail available and the links are dead.
This is very challenging to me! But it is a very popular program for genetic data analysis for crops breeding, especially for quantitative traits analysis. Another reason for me to re-compile it is for learning purpose as I am a beginner for C-programming.
Here are the errors I tried for my first step to get my feet wet. Obviously the errors are related to the library.
Code:
cc -I./lib/ -D_SYS_SUNOS -c lib/memlib.c -o lib/memlib.o
In file included from /usr/include/stdio.h:846:0,
                 from lib/system.h:519,
                 from lib/memlib.c:19:
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:28:30: error: conflicting types for ‘sys_errlist’
lib/system.h:184:14: note: previous declaration of ‘sys_errlist’ was here
In file included from lib/system.h:544:0,
                 from lib/memlib.c:19:
/usr/include/string.h:413:14: error: expected identifier or ‘(’ before ‘int’
In file included from lib/memlib.c:19:0:
lib/system.h:596:5: error: conflicting types for ‘srandom’
/usr/include/stdlib.h:330:13: note: previous declaration of ‘srandom’ was here
lib/memlib.c: In function ‘xalloc’:
lib/memlib.c:51:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
lib/memlib.c:51:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
lib/memlib.c:59:7: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
lib/memlib.c:59:7: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
make: *** [lib/memlib.o] Error 1

I appreciate if any body can help me look through it, although "who has anywhere from 15 minutes to a few days free" is needed to set it up as stated in the INSTALL.ME file with the package.

Thank you very much!

yifang

---------- Post updated at 07:04 PM ---------- Previous update was at 06:53 PM ----------

I happened to find this link for the "porting" of the program for MAC OS after I posted my question, which might be helpful. Thanks again! YF
Code:
http://ftp.kaist.ac.kr/macports/release/ports/science/mapm3/files/


Last edited by yifangt; 10-25-2011 at 02:00 PM.. Reason: correct text errors.
# 2  
Old 10-25-2011
Code:
cc -I./lib/ -D_SYS_SUNOS -c lib/memlib.c -o lib/memlib.o

Fairly sure you're not using sunos...

It gets a lot further if you change the makefile into -D_SYS_WATCOM, since one of the header files noted that it's practically ANSI. Still working on it.

---------- Post updated at 12:11 PM ---------- Previous update was at 09:24 AM ----------

I've gotten it to partially compile and try and use itself but makehelp segfaults.

"makehelp.c" contains a written apology from the programmer for its poor quality and excessive use of "globals and other ickiness." I may be in trouble. Smilie

---------- Post updated at 12:52 PM ---------- Previous update was at 12:11 PM ----------

tracking down pointer corruption, mumblegrumble...
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Error compiling program with extension .c

good morning, I have 64-bit DB2 V9.7 AIX 7.1.0.0 I am compiling a C program, when running cc-I / rutadb2/include-c programa.c this error. ksh: cc: not found. how I can check if I have installed the C compiler? Any help will be greatly appreciated. Thank you very much and best regards. (2 Replies)
Discussion started by: systemoper
2 Replies

2. Programming

Compiling a 64 bits program using gcc

Hi Everyone, I can ask what is the option to compile a 64 bits program using gcc. I have looked everywhere but can't find it. Before I used to use cc and the -q64 flag was the option to generate the 64 bits binary. Can anyone tell me what is the flags when using gcc. Thanks...... (3 Replies)
Discussion started by: arizah
3 Replies

3. Programming

Compiling Pro*C program under unix

Hello, I am trying to compile a Pro*C program under unix: proc iname=test.pc works fine but then I am not able to compile the test.c file : gcc test.c -o test.o -L $ORACLE_HOME/lib -l clntsh /usr/bin/ld: Object file format error in: /u01/app/oracle/product/10.1.0.2.0/lib:... (1 Reply)
Discussion started by: nsmrmd
1 Replies

4. Programming

compiling c program in unix

if somebody can help me pls. i need the source code for a shell which compiles C or java programs in unix i need a very short and simple one, just the compiling part Respect (2 Replies)
Discussion started by: zlatan005
2 Replies

5. Solaris

Compiling and Running C Program on Solaris

Hello Guys, I am using Solaris Developer Express Edition 9/07, I am a beginner. Please tell me how to compile and execute a C program. Please give me your answers clearly, for the compilers cc,c89,c99. please....... reply to me. I not getting the answer anywhere.. Advance... (2 Replies)
Discussion started by: selva_ss
2 Replies

6. Programming

help on compiling a C program on Tiger

here is the very simple bob.c: main() { printf("hello"); } i use tiger and i use the command: gcc bob.c and the end result: bob.c: In function ‘main': bob.c:3: warning: incompatible implicit declaration of built-in function /‘printf' any help appreciated, i'm just starting... (4 Replies)
Discussion started by: cleansing_flame
4 Replies

7. Programming

Compiling a C program

Help I know nothing about c programming. :confused: I want to compile the below c program. It extracts data from an oracle database into csv files. I have oracle 9206 installed with ProC. I dont have gcc My question is. How the hell do I make this into an file I can run? I am pulling... (3 Replies)
Discussion started by: ooploo
3 Replies

8. Programming

Problem compiling program

hi i am having a problem that when ever i use cc program_name.c to compile a program. an error occurs, showing cc not found. please help. (28 Replies)
Discussion started by: rochitsharma
28 Replies

9. Programming

Compiling a program

Hello. I am trying to run a c program on a unix shell (ssh). I have searched this forum but have not come accross the soultion to my problem, so I am posting my question here :cool: I wrote the following simple code: #include <iostream.h> using namespace std; int main() { ... (7 Replies)
Discussion started by: Minnesota Red
7 Replies

10. Programming

Error Compiling C program

Hi All, I tried to compile a C program but i am getting error while Linking . it says Undefined reference to ' ' (here it gives a method name which is defined Globally ). Can any body tell the resaon and remedy for the same . Iam stuck up here . Thanks (3 Replies)
Discussion started by: Vivek
3 Replies
Login or Register to Ask a Question