All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lin <minggr@gmail.com>
To: Marcus Watts <mwatts@redhat.com>
Cc: Sage Weil <sage@newdream.net>,
	ceph-devel@vger.kernel.org, John Spray <john.spray@redhat.com>
Subject: Re: rocksdb related build error
Date: Tue, 03 May 2016 16:28:27 -0700	[thread overview]
Message-ID: <1462318107.23609.3.camel@gmail.com> (raw)
In-Reply-To: <20160503225852.GA17962@degu.b.linuxbox.com>

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 <sage@newdream.net>
> > 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.

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
 
--
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

      reply	other threads:[~2016-05-03 23:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  7:05 rocksdb related build error Ming Lin
2016-05-03 12:26 ` Sage Weil
2016-05-03 18:52   ` Jianjian Huo-SSI
2016-05-03 19:03     ` Sage Weil
2016-05-03 21:15   ` Ming Lin
2016-05-03 22:58     ` Marcus Watts
2016-05-03 23:28       ` Ming Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462318107.23609.3.camel@gmail.com \
    --to=minggr@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=john.spray@redhat.com \
    --cc=mwatts@redhat.com \
    --cc=sage@newdream.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.