Solved

How do I compile this tool in Unix

Posted on 2010-09-16
16
691 Views
Last Modified: 2012-06-22
I am trying to compile the tool shown at the link below on my linux server but am experiencing problems.

http://code.google.com/p/uits/wiki/UITSWikiHome

I've uploaded the relevant files for Unix onto my server which includes a Makefile but when I run the command make I get the following message

make: *** No rule to make target `main.o', needed by `UITS_Tool'.  Stop.

Any help would be greatly appreciated.



0
Comment
Question by:albyh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +2
16 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33692721
Did you run "./configure" in the distribution directory before "make"?
wmp
0
 

Author Comment

by:albyh
ID: 33692791
Yeah I just get

-bash: ./configure: No such file or directory
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33692888
Anyway, your Makefile is incomplete.
Which OS do you use?
Seems that only for Mac OSX and Windows there is a straightforward way to build the tool.
wmp
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:albyh
ID: 33693019
I've just tried reuploading the makefile to the server but I get the same error

I'm using CentOS.

That's the problem there's clear instructions for Win and Mac but not for Unix :-(
0
 
LVL 6

Expert Comment

by:LeeeRussell
ID: 33693145
Is the configure file executable?

chmod +x configure
0
 

Author Comment

by:albyh
ID: 33693247
There is no configure file
0
 
LVL 6

Expert Comment

by:LeeeRussell
ID: 33695049
I don't know which file you've downloaded, but this zip:

uits-tool-0.01.zip

includes a few instructions for how to compile on unix in the README.  It might help.

Lee
0
 

Author Comment

by:albyh
ID: 33699247
You mean this line "Under unix, type ./runUITS.sh".  Thats not instructions for how to complie it's just a test script to be run after the file is compiled.
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 33699784
have you tried to compile the tool by following the instruction for building on Mac OSX from commandline? MacOsX is a unix variant.
0
 

Author Comment

by:albyh
ID: 33701497
The instructions for Mac OSX are to go to the directory and type make which is what I have done and get the error shown in the initial question
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 33707239
Are these the build instructions you were referring to?

BUILDING UITS_Tool   The UITS_Tool is written in C and has been compiled using the GNU C compiler on Mac   and Windows (MinGW). It uses three open source libraries. Compiled versions of those   libraries are distributed with the tool. To build in another environment, those   libraries must be re-compiled. The three libraries are:                                                           OpenSSL -  (http://www.openssl.org/) Version 1.0 beta4                                                           Libxml2 -  (http://xmlsoft.org/) Distributed with MacOSX                                                           Mini-XML - (http://www.minixml.org/)        To build under MacOSX using X-Code, use the xcode project,                uits-tool-osx-xcode/uits-tool-osx-xcode.xcodeproj        To build under MacOSX from the command line:                1. open a terminal window                2. cd to uits-tool-osx-make                3. make

There is indeed a Makefile in uits-tool-0.01/uits-tool-osx-make. Did you really cd there? However it needs a little TLC to function under Linux.
Firstly, at least at gcc (GCC) 4.4.4 there is no -arch i386 option, so remove that.
Secondly, you can not use the shipped .a libraries and must recompile them as per the instructions above.

On my system, I already have libxml2 and libssl. I fetched the source for libmxml. Will re-try build now.
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 250 total points
ID: 33707452
It builds for me now. Does it work? - I have no idea. There are a number of warnings when compiling, but they may be all right (see below).
I have attached a patch file for you to update Makefile. Here's how to use it:-

Place the attached file Makefile.txt in the uits-tool-0.01/uits-tool-osx-make directory. cd there.
Type the command cat Makefile.txt | patch

Now make should work, as long as you have built and installed any of the required three libraries that weren't installed already.

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o main.o ../source/main.c
../source/main.c: In function 'uitsGetOptCreate':
../source/main.c:386: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'
../source/main.c: In function 'uitsGetOptVerify':
../source/main.c:528: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'
../source/main.c: In function 'uitsGetOptExtract':
../source/main.c:628: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'
../source/main.c: In function 'uitsGetOptGenHash':
../source/main.c:718: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'
../source/main.c: In function 'uitsGetOptGenKey':
../source/main.c:785: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'
gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsAudioFileManager.o ../source/uitsAudioFileManager.c
gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsMP3Manager.o ../source/uitsMP3Manager.c
../source/uitsMP3Manager.c: In function 'lswap':
../source/uitsMP3Manager.c:1002: warning: assignment from incompatible pointer type
../source/uitsMP3Manager.c: In function 'llswap':
../source/uitsMP3Manager.c:1029: warning: assignment from incompatible pointer type
gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsPayloadManager.o ../source/uitsPayloadManager.c
../source/uitsPayloadManager.c: In function 'uitsValidatePayloadSchema':
../source/uitsPayloadManager.c:983: warning: assignment from incompatible pointer type
../source/uitsPayloadManager.c:984: warning: passing argument 1 of 'xmlSchemaSetValidErrors' from incompatible pointer type
/usr/include/libxml2/libxml/xmlschemas.h:158: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'
../source/uitsPayloadManager.c:985: warning: passing argument 1 of 'xmlSchemaValidateDoc' from incompatible pointer type
/usr/include/libxml2/libxml/xmlschemas.h:182: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'
../source/uitsPayloadManager.c:990: warning: passing argument 1 of 'xmlSchemaFreeValidCtxt' from incompatible pointer type
/usr/include/libxml2/libxml/xmlschemas.h:180: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'
gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsOpenSSL.o ../source/uitsOpenSSL.c
../source/uitsOpenSSL.c: In function 'uitsCreateDigest':
../source/uitsOpenSSL.c:131: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type
../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'
../source/uitsOpenSSL.c: In function 'uitsCreateDigestBuffered':
../source/uitsOpenSSL.c:185: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type
../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'
../source/uitsOpenSSL.c: In function 'uitsCreateSignature':
../source/uitsOpenSSL.c:290: warning: assignment discards qualifiers from pointer target type
../source/uitsOpenSSL.c:292: warning: assignment discards qualifiers from pointer target type
../source/uitsOpenSSL.c: In function 'uitsVerifySignature':
../source/uitsOpenSSL.c:381: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type
../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'
gcc -Os -g -o UITS_Tool   main.o uitsAudioFileManager.o uitsMP3Manager.o uitsPayloadManager.o uitsOpenSSL.o -lmxml -lxml2 -lcrypto -lssl -lpthread

Open in new window

Makefile.txt
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 33707462
Having applied the patch, it might be best to change the line in Makefile that reads:

CFLAGS  = $(OPTIM) -I /usr/include/libxml2 -I openssl/include

to

CFLAGS  = $(OPTIM) -I /usr/include/libxml2 -I /usr/include/openssl

That way, you use the header file that exactly matches the ssl library you are now using. It doesn't change any compiler warnings though
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 33707483
The warnings are pretty innocuous, only bad programming practice (they could be removed easily).

0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 33709560
Yes that's what I thought but I normally have a zero-tolerance policy towards warnings hence "may be all right".
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 33710653
Me too ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question