user2991421
user2991421

Reputation: 417

Importing Bazel Build Tensorflow

I'm trying to import the tensorflow project into the CLion IDE (on Linux) so that I can run various cc tests for example this.

I've built tensorflow from source using Bazel following the instructions from here . Now, I'm trying to import the bazel project into the CLion IDE by following the steps listed here.

I'm not able to select an initial project view file of .bazelproject type since it does not exist in my tensorflow directory.

Am I missing something or is there another way so that I can run tensorflow test files on my ide?

Upvotes: 1

Views: 897

Answers (1)

IsakBosman
IsakBosman

Reputation: 1533

Importing the Tensorflow project is no different than any other Bazel Project. It works fine for me when I try the following:

  1. Install the Bazel plugin by going to configure -> Plugins -> and searching for Bazel. Install the following plugin:

enter image description here

  1. Once installed restart CLion

  2. Once restarted click on the open project option in the load screen:

enter image description here

  1. This will open and import the tensorflow project with build settings. You can see from this image that the bazel configuration and settings are imported correctly:

enter image description here

Note: Bazel builds the entire tensorflow project into an installable python package. If you are purely interested in compiling it for C/C++ then I suggest you look at how to build and use the C++ API as building the entire project for every edit you make will age you very quickly.

Recommendation: If you just want to run the test files then install Tensorflow and simply execute the test files like you would run any program with cpp source files.

Upvotes: 1

Related Questions