[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 708
  • Last Modified:

How do I compile this tool in Unix

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
albyh
Asked:
albyh
  • 5
  • 4
  • 3
  • +2
1 Solution
 
woolmilkporcCommented:
Did you run "./configure" in the distribution directory before "make"?
wmp
0
 
albyhAuthor Commented:
Yeah I just get

-bash: ./configure: No such file or directory
0
 
woolmilkporcCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
albyhAuthor Commented:
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
 
LeeeRussellCommented:
Is the configure file executable?

chmod +x configure
0
 
albyhAuthor Commented:
There is no configure file
0
 
LeeeRussellCommented:
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
 
albyhAuthor Commented:
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
 
HappyCactusCommented:
have you tried to compile the tool by following the instruction for building on Mac OSX from commandline? MacOsX is a unix variant.
0
 
albyhAuthor Commented:
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
 
Duncan RoeSoftware DeveloperCommented:
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
 
Duncan RoeSoftware DeveloperCommented:
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
 
Duncan RoeSoftware DeveloperCommented:
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
 
HappyCactusCommented:
The warnings are pretty innocuous, only bad programming practice (they could be removed easily).

0
 
Duncan RoeSoftware DeveloperCommented:
Yes that's what I thought but I normally have a zero-tolerance policy towards warnings hence "may be all right".
0
 
HappyCactusCommented:
Me too ;-)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 5
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now