Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

PARQUET-416: C++11 compilation, code reorg, libparquet and installation targets #14

Closed
wants to merge 1 commit into from

Conversation

wesm
Copy link
Member

@wesm wesm commented Jan 7, 2016

Reorganize code into a top level src/parquet directly, add a libparquet shared library, and add install targets for libparquet and its header files. Add cpplint script and make lint target for code linting.

Replaces earlier PR #13

@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

OS X is failing with a homebrew error on brew install thrift; trying work around for now, if not we can disable OS X for the time being.

@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

I disabled OS X in the Travis CI setup for now; the .travis.yml will need some more twiddling which can go in a separate patch. For some reason brew install thrift was failing with a checksum error

@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

I tried this patch on osx by cloning and following the build steps in the readme. It worked on master but not this patch.

cmake .
...
Make Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   parquet

This warning is for project developers.  Use -Wno-dev to suppress it.
make 
[ 50%] Linking CXX shared library build/debug/libparquet.dylib
Undefined symbols for architecture x86_64:
  "snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)", referenced from:
      parquet_cpp::SnappyCodec::Compress(int, unsigned char const*, int, unsigned char*) in libparquet_compression.a(snappy-codec.cc.o)
  "snappy::RawUncompress(char const*, unsigned long, char*)", referenced from:
      parquet_cpp::SnappyCodec::Decompress(int, unsigned char const*, int, unsigned char*) in libparquet_compression.a(snappy-codec.cc.o)
  "snappy::MaxCompressedLength(unsigned long)", referenced from:
      parquet_cpp::SnappyCodec::MaxCompressedLen(int, unsigned char const*) in libparquet_compression.a(snappy-codec.cc.o)
  "typeinfo for apache::thrift::transport::TMemoryBuffer", referenced from:
      boost::shared_ptr<apache::thrift::transport::TMemoryBuffer> boost::dynamic_pointer_cast<apache::thrift::transport::TMemoryBuffer, apache::thrift::transport::TTransport>(boost::shared_ptr<apache::thrift::transport::TTransport> const&) in parquet.cc.o
  "typeinfo for apache::thrift::transport::TTransportException", referenced from:
      apache::thrift::transport::TMemoryBuffer::TMemoryBuffer(unsigned char*, unsigned int, apache::thrift::transport::TMemoryBuffer::MemoryPolicy) in parquet.cc.o
      apache::thrift::transport::TTransport::open() in parquet.cc.o
      apache::thrift::transport::TTransport::close() in parquet.cc.o
      apache::thrift::transport::TTransport::read_virt(unsigned char*, unsigned int) in parquet.cc.o
      apache::thrift::transport::TTransport::write_virt(unsigned char const*, unsigned int) in parquet.cc.o
      apache::thrift::transport::TTransport::consume_virt(unsigned int) in parquet.cc.o
      unsigned int apache::thrift::transport::readAll<apache::thrift::transport::TTransport>(apache::thrift::transport::TTransport&, unsigned char*, unsigned int) in parquet.cc.o
      ...
  "vtable for apache::thrift::transport::TMemoryBuffer", referenced from:
      apache::thrift::transport::TMemoryBuffer::TMemoryBuffer(unsigned char*, unsigned int, apache::thrift::transport::TMemoryBuffer::MemoryPolicy) in parquet.cc.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for apache::thrift::transport::TTransportException", referenced from:
      apache::thrift::transport::TTransportException::TTransportException(apache::thrift::transport::TTransportException::TTransportExceptionType, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in parquet.cc.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64

src/parquet.cc
)

set(LIBPARQUET_LINK_LIBS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why doesn't this have more things in it? e.g. snappy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, If i add snappystatic and thriftstatic, it compiles.

@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

Dynamic linking on OS X is a nightmare. With the fix I put in ./debug/decode-benchmark works and dynamically links to libparquet.dylib properly.

@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

As soon as we get the build environment question sorted out it would be good to use the same linkage as libparquet for the dependencies that have both static and shared libraries available.

@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

Cool, I tried the latest version in your branch and it builds.

@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

@wesm can you fix the build issue. I think you just need to add -fPIC

@wesm wesm force-pushed the libparquet-library branch 2 times, most recently from 8b71d4f to 636d0b7 Compare January 7, 2016 03:57
@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

This looks good to me. Can you file a jira and prefix the commit so the title is
PARQUET-XXX: description?

@wesm wesm changed the title C++11 compilation, code reorg, libparquet and installation targets PARQUET-416: C++11 compilation, code reorg, libparquet and installation targets Jan 7, 2016
@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

Ready for cherry-picking. I updated the PARQUET-416 title and description. Thanks!

@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

@wesm is disabling osx still necessary?

@wesm
Copy link
Member Author

wesm commented Jan 7, 2016

I can try the build again to see if the Homebrew thrift error cleared. I also could not get Thrift to build from source on Travis yesterday

@nongli
Copy link
Contributor

nongli commented Jan 7, 2016

Nvm. I got confused. It's not the osx issues that that been fixed.

Thanks. I'll merge this later today.


set(THIRDPARTY_PREFIX ${CMAKE_SOURCE_DIR}/thirdparty/installed)
set(CMAKE_PREFIX_PATH ${THIRDPARTY_PREFIX})

set(CMAKE_MACOSX_RPATH 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you wrap this in if (APPLE) please?

@wesm
Copy link
Member Author

wesm commented Jan 8, 2016

@grundprinzip sure; I'm seeing if OS X travis build will pass now and then will squash all these again

@kalaxy
Copy link
Contributor

kalaxy commented Jan 8, 2016

Let me know when this is no longer in flux and I'lll rebase on top of it again with my pull request.

…tr with

std::shared_ptr and other C++11 fixes. Reorganize code into a top level
src/parquet directly, add a libparquet shared library, and add install targets
for libparquet and its header files. Add cpplint script and `make lint` target
for code linting.
@wesm
Copy link
Member Author

wesm commented Jan 8, 2016

@kalaxy I got gcc-4.9 working and got the OS X build passing again (the magic trick was to call brew update before using brew install >:|). @nongli this should be good to cherry pick if the build is passing

@asfgit asfgit closed this in 337cf58 Jan 8, 2016
@nongli
Copy link
Contributor

nongli commented Jan 8, 2016

@wesm Thanks! Can you not squash in the future? It makes it hard to review the deltas and the merge tool we use will squash them.

@wesm wesm deleted the libparquet-library branch January 9, 2016 00:37
@wesm
Copy link
Member Author

wesm commented Jan 9, 2016

Sure, no problem.

asfgit pushed a commit that referenced this pull request Jan 19, 2016
This is based off of pull request #14.

Author: Kalon Mills <kmills@adobe.com>

Closes #16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 2, 2018
This is based off of pull request apache/parquet-cpp#14.

Author: Kalon Mills <kmills@adobe.com>

Closes apache#16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 4, 2018
This is based off of pull request apache/parquet-cpp#14.

Author: Kalon Mills <kmills@adobe.com>

Closes apache#16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.

Change-Id: I266283fc15457a6116fc944b29656d071a917159
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 6, 2018
This is based off of pull request apache/parquet-cpp#14.

Author: Kalon Mills <kmills@adobe.com>

Closes apache#16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.

Change-Id: I266283fc15457a6116fc944b29656d071a917159
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 7, 2018
This is based off of pull request apache/parquet-cpp#14.

Author: Kalon Mills <kmills@adobe.com>

Closes apache#16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.

Change-Id: I266283fc15457a6116fc944b29656d071a917159
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 8, 2018
This is based off of pull request apache/parquet-cpp#14.

Author: Kalon Mills <kmills@adobe.com>

Closes apache#16 from kalaxy/libparquet-library-update-build and squashes the following commits:

0ce51db [Kalon Mills] Add script for automating build env setup.
82a198c [Kalon Mills] Make thrift build on mac only a warning when not specified explicitly.
d096c64 [Kalon Mills] Update build instructions.
6709182 [Kalon Mills] Support thrift dependency in thirdparty scripts for linux.
bedd0d4 [Kalon Mills] Remove thirdparty code lz4 from repo.
30c2b7e [Kalon Mills] Support build environment configuration of LZ4 library.
73e7785 [Kalon Mills] Support build environment configuration of Snappy library.

Change-Id: I266283fc15457a6116fc944b29656d071a917159
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants