How do I configure and build this library?

Discussion in 'Mac Programming' started by notwist, Apr 19, 2008.

  1. notwist macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #1
    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.
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    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
     
  3. notwist thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #3
    I did the same thing but I when compile a simple Hello World program with #include <tomcrypt.h>, it says it cannot find it
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    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.
     
  5. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    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
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    Ahh, that'll teach me to assume it used standard open source conventions. You know what they say about assumption...
     
  7. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #7
    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
     

Share This Page