arowpp icon indicating copy to clipboard operation
arowpp copied to clipboard

How to install?

Open ryandesign opened this issue 5 years ago • 2 comments

Now that the build system is bazel, how can the software be installed?

The old autotools instructions with arowpp 0.1.2 said:

$ git clone https://github.com/tetsuok/arowpp.git
$ cd arowpp
$ ./configure [--enable-gtest]
$ make
$ make check # This is optional. See the note below.
$ make install

Note the make install step which (typically with sudo) installs the software.

The new bazel build instructions with arowpp 0.1.3 say:

$ git clone https://github.com/tetsuok/arowpp.git
$ cd arowpp
$ bazel build //:arow_learn //:arow_test

That builds, but how to install?

ryandesign avatar Jan 08 '21 16:01 ryandesign

Good catch. Thanks for reporting the issue. My understanding is that bazel doesn't offer the counterpart of make install (there is an extension to support the installation, but it only works in Linux right now). Users need to copy the products by themselves. I can update README.md to mention the following installation process to install, but I'm not sure there is a canonical way to install the built products when using Bazel. Bazel normally produces built products (e.g., executables, shared/dynamic/static libraries) under bazel-bin when you run bazel build (bazel-bin will be created in the same directory where WORKSPACE is located).

Sample installation process

bazel build //:arow_learn //:arow_test would produces arow_learn, arow_test, libarowpp.a, and libarowpp.so under bazel-bin. You can just copy these files to your preferred location, e.g., /usr/local/{bin,lib}, using e.g., cp or install. Below is an example of installing the binaries to /usr/local using cp:

sudo cp bazel-bin/arow_learn bazel-bin/arow_test /usr/local/bin
sudo cp bazel-bin/libarowpp.a /usr/local/lib

NOTE: Installing shared/dynamic library libarowpp.so, is a bit tricky. I didn't find the best solution yet because additional commands are required to set up the path for it (install_name_tool -change in macOS needs to be run to fix the path, for example).

Here is an example of how to install the public header:

$ sudo cp ./src/arowpp.h /usr/local/include

tetsuok avatar Jan 09 '21 12:01 tetsuok

I wondered if the installation process might be manual now. In that case, adding those instructions to the readme would be good, and make sure to keep it updated if you change what gets built in the future.

ryandesign avatar Jan 09 '21 18:01 ryandesign