github Linux下开源merkle-Tree构建

github Linux下开源merkle-Tree构建

github: https://github.com/IAIK/merkle-tree.git


一、Dependencies

1、下载CppUnit
https://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/cppunit-1.12.1.tar.gz/

tar -zvxf cppunit-1.12.1.tar.gz
· cd cppunit-1.12.1
· ./configure LDFLAGS='-ldl'  
· make
· sudo make install
· export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
//  测试代码 testApp.cpp
#include <iostream>
 
#include <cppunit/TestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
 
 
class Test : public CPPUNIT_NS::TestCase
{
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(testHelloWorld);
   CPPUNIT_TEST_SUITE_END();
 
 public:
   void setUp(void) {}
   void tearDown(void) {}
 
 protected:
   void testHelloWorld(void) { std::cout << "Hello, world!" << std::endl; }
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 int main( int argc, char **argv )
 {
   // Create the event manager and test controller
   CPPUNIT_NS::TestResult controller;
 
   // Add a listener that colllects test result
   CPPUNIT_NS::TestResultCollector result;
 controller.addListener( &result );       
 
   // Add a listener that print dots as test run.
   CPPUNIT_NS::BriefTestProgressListener progress;
   controller.addListener( &progress );     
 
   // Add the top suite to the test runner
   CPPUNIT_NS::TestRunner runner;
   runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
   runner.run( controller );
 
   return result.wasSuccessful() ? 0 : 1;
 }

ldl,make:

       g++ testApp .cpp -lcppunit -ldl -o testApp

Then run:

       ./ testApp

2、下载Valgrind
http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2

· tar -jxvf valgrind-3.12.0.tar.bz2
· cd valgrind-3.12.0
· ./configure
· make 
· sudo make install

二、Building the Merkle Tree Library

· git clone https://github.com/IAIK/merkle-tree.git
· cd merkle-tree
· make 

· All successful builds create a static library ‘libMerkleTree.a’ in the ‘src’ directory, for linking to other applications.

· cd tests
· export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
· ./merkle-tree-test

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值