Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6231F200B92 for ; Wed, 14 Sep 2016 00:46:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60F36160AD8; Tue, 13 Sep 2016 22:46:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ADFBC160AD2 for ; Wed, 14 Sep 2016 00:46:21 +0200 (CEST) Received: (qmail 38206 invoked by uid 500); 13 Sep 2016 22:46:20 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 38185 invoked by uid 99); 13 Sep 2016 22:46:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2016 22:46:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6E7682C1B77 for ; Tue, 13 Sep 2016 22:46:20 +0000 (UTC) Date: Tue, 13 Sep 2016 22:46:20 +0000 (UTC) From: "Roman (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AVRO-1844) Avro-C build procedure doesn't set include paths for Jansson MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 13 Sep 2016 22:46:22 -0000 [ https://issues.apache.org/jira/browse/AVRO-1844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15488698#comment-15488698 ] Roman commented on AVRO-1844: ----------------------------- I don't know enough about CMake as well, but the following allowed me to at least build Avro-C: Replace the following lines in CMakeLists.txt #pkg_check_modules(JANSSON jansson>=2.3) #if (JANSSON_FOUND) # set(JANSSON_PKG libjansson) # include_directories(${JANSSON_INCLUDE_DIR}) # link_directories(${JANSSON_LIBRARY_DIRS}) #else (JANSSON_FOUND) # message(FATAL_ERROR "libjansson >=2.3 not found") #endif (JANSSON_FOUND) with the following code, which is mostly taken from https://github.com/watchedit/CMakeModules/blob/master/FindJansson.cmake : # - Try to find Jansson # Once done this will define # # JANSSON_FOUND - system has Jansson # JANSSON_INCLUDE_DIRS - the Jansson include directory # JANSSON_LIBRARIES - Link these to use Jansson # # Copyright (c) 2011 Lee Hambley # # Redistribution and use is allowed according to the terms of the New # BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # if (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS) # in cache already set(JANSSON_FOUND TRUE) else (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS) find_path(JANSSON_INCLUDE_DIR NAMES jansson.h PATHS /usr/include /usr/local/include /opt/local/include /sw/include ${JANSSON_PATH}/include ) find_library(JANSSON_LIBRARY NAMES jansson PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib ${JANSSON_PATH}/lib ) set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} ) if (JANSSON_LIBRARY) set(JANSSON_LIBRARIES ${JANSSON_LIBRARIES} ${JANSSON_LIBRARY} ) endif (JANSSON_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Jansson DEFAULT_MSG JANSSON_LIBRARIES JANSSON_INCLUDE_DIRS) # show the JANSSON_INCLUDE_DIRS and JANSSON_LIBRARIES variables only in the advanced view mark_as_advanced(JANSSON_INCLUDE_DIRS JANSSON_LIBRARIES) endif (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS) include_directories(${JANSSON_INCLUDE_DIR}) link_directories(${JANSSON_LIBRARY_DIRS}) ----------------------------------------------------------------------------------------------------------------------- This allows the user to specify -DJANSSON_PATH as a command-line option to cmake, and this worked to build Avro for me. > Avro-C build procedure doesn't set include paths for Jansson > ------------------------------------------------------------ > > Key: AVRO-1844 > URL: https://issues.apache.org/jira/browse/AVRO-1844 > Project: Avro > Issue Type: Bug > Components: c > Affects Versions: 1.8.0 > Environment: gcc 4.9.3, Scientific Linux Fermi release 6.7 > Reporter: Jim Pivarski > > I `configure` Jansson with a user-space `PREFIX` because I don't have root access, and when I `make install`, the Jansson includes and libs appear in new `include` and `lib` directories, as expected. > I `cmake` with `-DCMAKE_INSTALL_PREFIX:PATH=` the same path as `PREFIX` and CMake is successful: it finds Jansson and makes the Makefiles. > BUT, when I `make`, it fails because it can't find `jansson.h`. The same is true if I explicitly set `PKG_CONFIG_PATH` to point to `$PREFIX/lib/pkgconfig` and `pkg-config jansson --cflags --libs` works. > If I explicitly add full paths to Avro's and Jansson's `#include ` lines in the source code, Avro compiles without trouble. (`avro-c-1.8.0/src/schema.c`, `avro-c-1.8.0/src/value-json.c`, `include/jansson.h`) > Presumably, the Jansson part of the build process is only partly implemented, such that the CMake script searches for the appropriate version but `-I` flags are not generated for the compiler. I don't know enough CMake to know where to insert these. > Fixing this issue is the only way I know of to make Avro-C installable on a system without root access, apart from the hack I described above. -- This message was sent by Atlassian JIRA (v6.3.4#6332)