Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

notwist

macrumors regular
Original poster
Dec 29, 2006
191
0
New Brunswick, NJ
I need to use this C cryptography library to run some tests for a project. I am not asking for help in doing the project but rather just help to get it installed and working. I'm not that experienced in programming. The library is located at http://libtom.org/?page=features&newsitems=5&whatfile=crypt
I'm probably just going to compile and test my code in the Terminal.

The downloads file has a bunch files and folders. I just do not know how to go about getting it installed. I tried doing "make" in Terminal but when I try to compile a test code, it says it cannot find the Crypto header file. Plus, the instructions on configuring and building it seem to be aimed towards those who know a bit about programming unlike me.

If anyone can help me in this I would be extremely thankful.

Thanks.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
There is a very large pdf under docs. On page 153 (the page that says 153, not the PDF page 153) there is a chapter on building. I didn't do any customizations and just moving into the directory that I unzipped to and running make resulted in a libtomcrypt.a with 301 object files in it.

I figure that's all you need to statically link against this library, but I'm not sure how to test it.

-Lee
 

Cromulent

macrumors 604
Oct 2, 2006
6,812
1,100
The Land of Hope and Glory
Run these commands to install it properly:

./configure
make
sudo make install

that will put the library and header files in /usr/local then you just need to make sure that Xcode can see the libraries by adding them to your projects search path. Or by using the correct switch if you are compiling from the command line.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
There was not a configure script distributed. When I tried to make install, it seems that the target requires latex, which I don't have installed. I added the line:
NODOCS=TRUE

To the top of the makefile. That skipped the documentation, and the header files were put in /usr/include.

So the steps should be:
cd to the directory you extracted the archive to
make
-open makefile with a text editor, add the line "NODOCS=TRUE"
sudo make install

-Lee
 

Cromulent

macrumors 604
Oct 2, 2006
6,812
1,100
The Land of Hope and Glory
There was not a configure script distributed. When I tried to make install, it seems that the target requires latex, which I don't have installed. I added the line:
NODOCS=TRUE

To the top of the makefile. That skipped the documentation, and the header files were put in /usr/include.

So the steps should be:
cd to the directory you extracted the archive to
make
-open makefile with a text editor, add the line "NODOCS=TRUE"
sudo make install

-Lee

Ahh, that'll teach me to assume it used standard open source conventions. You know what they say about assumption...
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
i was pretty perplexed re: the lack of configure, too. There's a lot of separate configuration for this package in the makefile itself. I prefer configure myself, but it's their library, I suppose.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.