[ 
https://issues.apache.org/jira/browse/HDFS-11971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048387#comment-16048387
 ] 

James Clampffer commented on HDFS-11971:
----------------------------------------

Nice find on the linking fix.  I'd prefer if the file rename changes were 
pushed into another patch though since it makes it really hard to see what 
functional stuff you changed in this diff.

I think if we want to continue to support the C API that C based tools and 
examples should live in their own directory; ideally they should also be forced 
to build in C99 mode.  One of the issues with the C stuff now is some C++ has 
leaked in since everything builds with -std=c++11, last time I tried to link a 
pure C application with hdfs.h I ran into some issues.



> libhdfs++: A few portability issues
> -----------------------------------
>
>                 Key: HDFS-11971
>                 URL: https://issues.apache.org/jira/browse/HDFS-11971
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Anatoli Shein
>            Assignee: Anatoli Shein
>         Attachments: HDFS-11971.HDFS-8707.000.patch
>
>
> I recently encountered a few portability issues with libhdfs++ while trying 
> to build it as a stand alone project (and also as part of another Apache 
> project).
> 1. Method fixCase in configuration.h file produces a warning "conversion to 
> ‘char’ from ‘int’ may alter its value [-Werror=conversion]" which does not 
> allow libhdfs++ to be compiled as part of the codebase that treats such 
> warnings as errors (can be fixed with a simple cast).
> 2. In CMakeLists.txt file (in libhdfspp directory) we do 
> find_package(Threads) however we do not link it to the targets (e.g. 
> hdfspp_static), which causes the build to fail with pthread errors. After the 
> Threads package is found we need to link it using ${CMAKE_THREAD_LIBS_INIT}.
> 3. All the tools and examples fail to build as part of a standalone libhdfs++ 
> because they are missing multiple libraries such as protobuf, ssl, pthread, 
> etc. This happens because we link them to a shared library hdfspp instead of 
> hdfspp_static library. We should either link all the tools and examples to 
> hdfspp_static library or explicitly add linking to all missing libraries for 
> each tool/example.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to