From patchwork Tue May 3 23:28:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ming Lin X-Patchwork-Id: 9008821 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A2EB09F372 for ; Tue, 3 May 2016 23:28:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C1D7201F4 for ; Tue, 3 May 2016 23:28:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3829720172 for ; Tue, 3 May 2016 23:28:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932711AbcECX2a (ORCPT ); Tue, 3 May 2016 19:28:30 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36137 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756345AbcECX23 (ORCPT ); Tue, 3 May 2016 19:28:29 -0400 Received: by mail-pa0-f42.google.com with SMTP id bt5so16099511pac.3 for ; Tue, 03 May 2016 16:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=voSOO6F0YiCiuwDekNZm0SucmrQDdVB5wEMdEE7HQNQ=; b=SF5oolBS/fUPZcRyNx5Qrni2+npPz/jSCajE44WxGaJERQsLejuJvpE5pft8NfYfmk h4lxp12OLpUJPe8EHtNRbyg1YWSkGVCC5jeWl2BSQFXXxsscdtpn7NJbFlEaY5xG3zf/ eDoPH3X53myblrkigYxcTEKBSh0tghG/1Lt1n9ZryZFxDeJu7ge/UWO6yYUaKLkegxVz 5ojeVN4eYBu0ma0LWeQmmM1pWXhDv/77XYhlTSf4xGUTHj6Od6RMnl84cY6vPl2lW9Cg S7jw7DGQO3sRVFbidW6zHFvK93c49BzT0a6sQ+15dx4wORUC8ONs7886ojJl7cmedjjM gcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=voSOO6F0YiCiuwDekNZm0SucmrQDdVB5wEMdEE7HQNQ=; b=U7NJirX2ZlJ9DMwXKrcbULnAjA2CQw2u/7A0XKdCpdmGQecJnt3aC/MdrOg3wVnJUC QZYIQNVgenoECerEqC/1f1MIBMwxR3zJZyzrVfPS4N1T8EERlcw7TVod8gistX6+KWE/ /lnAzKukHu5x/rDpJh6EPxfKU3Q0iZQbrlQwl7G4lp6/MPvNXnP1lVZKzPPlhPmUnYCK 5Dk2YnXwsS2gxb3RWRQQ7d9GkqBANOxBtVhtiM+Z1OF1idu3RYuJ0RgzdldAZX8ETdzo 2+AD/6h1vOADF09ukU0rGzyCnFXuz2w9yF0Fted4ID8l7vuJpUmB+utg5MyxspfzkDrW AO9w== X-Gm-Message-State: AOPr4FXkPAqDPQ4PevXnR2biBh+IL2Xs36vjrvZpYMfzx4bKlF3NjEd0OMzmzKs3Nv14bg== X-Received: by 10.66.52.112 with SMTP id s16mr7641066pao.35.1462318109191; Tue, 03 May 2016 16:28:29 -0700 (PDT) Received: from ?IPv6:2601:646:8a00:97b0:96db:c9ff:fea3:e614? ([2601:646:8a00:97b0:96db:c9ff:fea3:e614]) by smtp.googlemail.com with ESMTPSA id 19sm680440pfu.83.2016.05.03.16.28.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2016 16:28:28 -0700 (PDT) Message-ID: <1462318107.23609.3.camel@gmail.com> Subject: Re: rocksdb related build error From: Ming Lin To: Marcus Watts Cc: Sage Weil , ceph-devel@vger.kernel.org, John Spray Date: Tue, 03 May 2016 16:28:27 -0700 In-Reply-To: <20160503225852.GA17962@degu.b.linuxbox.com> References: <20160503225852.GA17962@degu.b.linuxbox.com> X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY,URI_NOVOWEL autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 2016-05-03 at 18:58 -0400, Marcus Watts wrote: > On Tue, May 03, 2016 at 02:15:49PM -0700, Ming Lin wrote: > > On Tue, May 3, 2016 at 5:26 AM, Sage Weil > > wrote: > > > On Tue, 3 May 2016, Ming Lin wrote: > > > > Hi John, > > > > > > > > I got rocksdb related build error (commit bb7d9c15). > > > > Any hint to fix it? > > > > > > > > It's OK if I build in the ceph source tree. > > > > > > Out of tree builds don't work currently with autotools. > > > > I just learned a bit about autotools. > > https://en.wikipedia.org/wiki/GNU_Build_System > > > > Could you share what the problem is here to support out-of-tree > > build? > > I'll try to write a patch to fix it. > > I looked at this fairly recently. > > rocksdb comes with a cmake (only used for windows), and makefile > build. > The makefile build doesn't use autotools, it's just a gnu makefile. > gnu make does support out of tree builds, but the rocksdb file > doesn't > do that.  So, it wants to find all its source wherever it's > installed, > and it puts all the .o's in the same place - So: no separate build > possible. > This is a problem for both automake & cmake. > > You could change the makefile to work "out of tree", but it won't > be pretty.  Probably you would be adding some "VPATH" statements, > add -I as necessary, and you'd have to work within the structure > of the file which I think seemed a bit more complicated than > necessary. Here is my quick hack. Just add ${srcdir} It's not real "out of tree" because rocksdb is still build in the tree actually. --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/kv/Makefile.am b/src/kv/Makefile.am index b876171..0dd754c 100644 --- a/src/kv/Makefile.am +++ b/src/kv/Makefile.am @@ -21,8 +21,8 @@ if FREEBSD          NPROC = sysctl -n hw.ncpu  endif  rocksdb/librocksdb.a: - cd rocksdb && CC="${CC}" CXX="${CXX}" EXTRA_CXXFLAGS=-fPIC PORTABLE=1 $(MAKE) -j$(shell ${NPROC}) static_lib -libkv_a_CXXFLAGS += -I rocksdb/include -fPIC + cd ${srcdir}/rocksdb && CC="${CC}" CXX="${CXX}" EXTRA_CXXFLAGS=-fPIC PORTABLE=1 $(MAKE) -j$(shell ${NPROC}) static_lib +libkv_a_CXXFLAGS += -I ${srcdir}/rocksdb/include -fPIC  libkv_a_SOURCES += kv/RocksDBStore.cc  libkv_a_LIBADD += rocksdb/librocksdb.a  noinst_HEADERS += kv/RocksDBStore.h diff --git a/src/os/Makefile.am b/src/os/Makefile.am index 6d22778..4305fe2 100644 --- a/src/os/Makefile.am +++ b/src/os/Makefile.am @@ -61,7 +61,7 @@ if WITH_LIBZFS  libos_a_SOURCES += os/filestore/ZFSFileStoreBackend.cc  endif   -libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I rocksdb/include -fPIC +libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I ${srcdir}/rocksdb/include -fPIC  libos_a_LIBADD = libos_types.a libkv.a  noinst_LIBRARIES += libos.a   diff --git a/src/test/Makefile-server.am b/src/test/Makefile-server.am index fbb42e4..2aaa635 100644 --- a/src/test/Makefile-server.am +++ b/src/test/Makefile-server.am @@ -227,7 +227,7 @@ endif # WITH_OSD  if WITH_SLIBROCKSDB  unittest_rocksdb_option_static_SOURCES = test/objectstore/TestRocksdbOptionParse.cc  unittest_rocksdb_option_static_LDADD = $(LIBOS) $(UNITTEST_LDADD) $(CEPH_GLOBAL) -unittest_rocksdb_option_static_CXXFLAGS = $(UNITTEST_CXXFLAGS) ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -I rocksdb/include +unittest_rocksdb_option_static_CXXFLAGS = $(UNITTEST_CXXFLAGS) ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -I ${srcdir}/rocksdb/include  check_TESTPROGRAMS += unittest_rocksdb_option_static  endif