Coder Social home page Coder Social logo

Bench File Reading Error about lorina HOT 4 CLOSED

hriener avatar hriener commented on July 29, 2024
Bench File Reading Error

from lorina.

Comments (4)

hriener avatar hriener commented on July 29, 2024

Hello utdael,

I would run lorina as follows to parse a bench file:

#include <lorina/lorina.hpp>
#include <iostream>

int main()
{
  using namespace lorina;
  bench_reader reader;
  text_diagnostics consumer;
  diagnostic_engine diag( &consumer );

  if ( read_bench( "c432.bench", reader, &diag ) == return_code::success )
  {
    std::cout << "parsing successful" << std::endl;
  }
  else
  {
    std::cout << "parsing failed" << std::endl;
  }
}

On my system, this approach seems to be able to read all of Maksim's benchmarks.

What do you mean by "it isn't working"? Do you see a specific error message?

Edit: I should point out that lorina is a C++ library. It provides you with API to read bench files, but you still have to implement an executable that calls the API to process the file(s).

Best,
Heinz

from lorina.

utdael avatar utdael commented on July 29, 2024

Thank you for the quick response.
My main problem is compiling and running lorina on one of our cpp files in a linux environment. At the moment, we cloned the github in the same folder as our cpp file.
We attempted to compile it using gcc bench.cpp in one of the screenshots attached.

ErrorMessage

However, we get an error that says "no such file or directory" for the #include <lorina/lorina.hpp> library.

LibraryLorina

How can I go about compiling this design?

from lorina.

hriener avatar hriener commented on July 29, 2024

lorina uses CMake as a build system.

Try the following steps:

$ git clone [email protected]:hriener/lorina.git
Cloning into 'lorina'...
[...]
$ cd lorina
$ mkdir build
$ cd build
$ cmake .. -DLORINA_EXAMPLES=ON
-- The CXX compiler identification is ...
[...]
$ make
[ 50%] Building CXX object examples/CMakeFiles/pretty_print.dir/pretty_print.cpp.o
[100%] Linking CXX executable pretty_print
[100%] Built target pretty_print
$ ./example/pretty_print PATH_TO_YOUR_BENCH_FILE

Two more notes:

  • You may have to install cmake and make on your system first. You will notice if you see error messages saying that cmake or make is not a valid command.
  • All files ending with .cpp in the directory examples will be automatically build. Each time you add a new example, you have to run cmake again in the build directory. Each time you change one of the .cpp files, you have to run make again in the build directory.

from lorina.

hriener avatar hriener commented on July 29, 2024

Seems to be resolved.

If not, then the issue can be re-opened...

from lorina.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.