Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Compiler configuration problem

Compiler configuration problem
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Apr 15, 2001, 10:44 AM
 
Dear Unix and OS X gurus,
I've been unsucessfully trying to compile and install a program under OS X. I was wondering whether the more experienced UNIX users could give me a hint - and I hope this forum is the right place to ask... I think I have located the source of (at least some of) the trouble:

#
# Compiler Configuration
#
CC = cc
AUX_CFLAGS =
AUX_LDFLAGS =
# next line is for gcc on Linux systems
#AUX_LIBS = /lib/libcrypt.so.1 -lm
# next line is for gcc on Solaris systems
AUX_LIBS = -lsocket -lnsl -lm


during the "make all" stage, it complains a few times (some warnings) and finally breaks off with the following message:

cc -D__unix__ -I. -DCONV_ALL -DACC_MODE=0600 -DACC_UMASK=0077 -DLOG_FACILITY=LOG_LOCAL7 -DBNC_PORT=7000 -DACCPATH=\"/Volumes/Corpus/bnc2/adm/\" -DBIBPATH=\"/Volumes/Corpus/bnc2/Etc/\" -DETCPATH=\"/Volumes/Corpus/bnc2/Etc/\" -DTXTPATH=\"/Volumes/Corpus/bnc2/Texts/\" -DTMPPATH=\"/tmp/\" -DPARAM=\"corpus.prm\" -DCHDPATH=\"/Volumes/Corpus/bnc2//Texts/\" -DSRTPATH=\"/tmp/\" -c -o corpuser.o corpuser.c

corpuser.c:29: header file 'crypt.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make: *** [corpuser.o] Error 1


Line 29 in file corpuser.c is:
#include <crypt.h>


Quite obviously, I'm not runing Solaris and I suppose that this is the source of the error. But what do I change AUX_LIBS to? Do I need to install some additional libraries first or is there a different way?
(In a naive attempt, I tried both /usr/lib/libcrypto.0.9.dylib /usr/lib/libcrypto.dylib - they were the closest I could find - but to no avail.)

Any help is greatly appreciated!
Best,
Sebastian

     
Addicted to MacNN
Join Date: Aug 2000
Location: Retired
Status: Offline
Reply With Quote
Apr 15, 2001, 12:03 PM
 
As root, do this:
sudo ln -s /usr/bin/cc /usr/bin/gcc

This will permanently make a link that will direct compiler libraries to where Darwin has them. Everything I've compiled has worked after using this command. I hope this helps.
Power Macintosh Dual G4
SGI Indigo2 6.5.21f
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 15, 2001, 02:22 PM
 
All that does is symlink cc so it looks like it's gcc.

The problem is probably that OpenSSL doesn't include headers by default on OS X for some obscure reason.
     
sebhoff  (op)
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Apr 15, 2001, 02:35 PM
 
Originally posted by MacGorilla:
As root, do this:
sudo ln -s /usr/bin/cc /usr/bin/gcc

This will permanently make a link that will direct compiler libraries to where Darwin has them. Everything I've compiled has worked after using this command. I hope this helps.
I'm afraid that in this case it didn't do the trick... But I now managed to solve at least the problem with crypt -I had to include <unistd.h> instead of the 'crypt.h'. But the problem now is ld - and the path to the (dynamic shared?) library. Here's what "make all" now produces (both with cc and gcc):

cc -ggdb -o sarad \
corpserv.o corppq.o corpwl.o corpqy.o corptest.o corpcoll.o corpuser.o corpprm.o corphash.o corpdesc.o corpi2.o corplemm.o corpsubc.o corpfrob.o
/usr/bin/ld: Undefined symbols:
_fix_bibentry
_fix_bibhdr
_fix_di
_fix_pihead
_fix_pii
_fix_strb
_fix_dicent
_fix_ihdr
_fix_accentry
_fix_locent
_fix_dhead
_fix_sig
_fix_sara_long
make: *** [sarad] Error 1

Any further suggestions?
Thanks for your patience...
Sebastian
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 16, 2001, 12:43 PM
 
cc IS gcc. You'll get exactly the same output using both of them. The only thing linking them is useful for as far as I can see is compiling UNIX software that uses gcc by default without having to hack up Makefiles.

Anyway... Do you have any idea what library those symbols belong to? From the names it looks like they MIGHT be part of a library built by the project, but I'm by no means sure. Any ideas? You might like to try reading INSTALL or README for any library dependencies it might have.
     
sebhoff  (op)
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Apr 17, 2001, 03:16 PM
 
Originally posted by Angus_D:

Anyway... Do you have any idea what library those symbols belong to? From the names it looks like they MIGHT be part of a library built by the project, but I'm by no means sure. Any ideas? You might like to try reading INSTALL or README for any library dependencies it might have.
I'm afraid there isn't much of a README or install manual to what I'm doing. It seems that I'm one of the first trying to compile something which was originally written for a little-endian system - with a few hasty changes added to make sure it works on a big-endian one... I have now managed to get a good deal further. After some changes in the Makefile and in the header files (basically, some variables not having been spelled consistently, etc.), I messed around with flags for ld. I took what I could find in other Makefiles and tried it out. With the following flags, I actually managed to finish the make all run without any errors - only a few warnings which also occur when you install it under linux:

LDDLFLAGS = -bundle -undefined suppress

However, when I try to run the resulting thingy, this happens:

[localhost:Corpora/bnc2/SARA] root# sarad -c corpus.prm
/usr/local/bin/sarad: Bad executable (or shared library).

I assume that the linker has some problems which are due to the wrong flags...
Any ideas or hints where to start looking? I know that this information is probably too limited to find the error - buty maybe it's just obvious to someone with more experience.

I used to rely on our sysadmin for all this - but it's kind of fun trying it out myself now that I am my own sysadmin. But it's also pretty frustrating at times - I really need to read up on quite a bit. ;-)

Thanks,
Sebastian

     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2