hi Kai, I see -- the problem is that you are running setup_build_env.sh in a separate shell. See
https://github.com/apache/arrow/blob/master/cpp/setup_build_env.sh#L11 You can run `source setup_build_env.sh` to set the environment variables in your current shell. On my machines, I have the following toolchain environment variables, since I share flatbuffers and other libraries amongst several C++ projects (and I have installed several libraries in $TP_DIR): TP_DIR=$HOME/local export FLATBUFFERS_HOME=$TP_DIR I recommend setting up an environment configuration script that works for your preferred development setup. Thanks On Sun, Mar 27, 2016 at 10:57 PM, Zheng, Kai <kai.zh...@intel.com> wrote: > I don't have $FLATBUFFERS_HOME and I'd rather depend on the > setup_build_env.sh work. > > setup_build_env.sh does work and leave this folder > thirdparty/flatbuffers-1.3.0 that looks good. > > The root cause that it doesn't work fully looks like to be Flatbuffers_HOME > isn't set in CMakeLists.txt file. > With the following change, it works now. > > Micah, would you incorporate this change in your PR if it sounds good? Thanks. > > diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt > index 6ed2768..cf5919f 100644 > --- a/cpp/CMakeLists.txt > +++ b/cpp/CMakeLists.txt > @@ -598,6 +598,9 @@ endif() > # IPC library > > ## Flatbuffers > +if ("$ENV{Flatbuffers_HOME}" STREQUAL "") > + set(Flatbuffers_HOME ${THIRDPARTY_DIR}/flatbuffers-1.3.0) > +endif() > > Regards, > Kai > > -----Original Message----- > From: Wes McKinney [mailto:w...@cloudera.com] > Sent: Monday, March 28, 2016 11:04 AM > To: dev@arrow.apache.org > Subject: Re: Does arrow/cpp setup google flatbuffers lib by itself? > > There could be a cmake caching issue, too. So trying a fresh clone (or > deleting your out-of-source build directory) may help. > > Be sure to check $FLATBUFFERS_HOME and look in that directory to check for > `flatbuffers/flatbuffers.h` > > On Sun, Mar 27, 2016 at 6:55 PM, Zheng, Kai <kai.zh...@intel.com> wrote: >> Thanks Micah. Got noted. OK right now I will work around my setup and if any >> further interesting finding I will post here for your reference. >> >> Regards, >> Kai >> >> -----Original Message----- >> From: Micah Kornfield [mailto:emkornfi...@gmail.com] >> Sent: Monday, March 28, 2016 9:47 AM >> To: dev@arrow.apache.org >> Subject: Re: Does arrow/cpp setup google flatbuffers lib by itself? >> >> Hi Kai, >> This might not solve your problem but I had an issue building flatbuffers. >> The fix was I had to modify the flatbuffers cmake file >> (thirdparty/flatbuffers-1.3.0/CMakeLists.txt) to force -std=c++11 instead of >> c++0x. >> >> I also don't think build_thirdparty.sh is properly surfacing errors if the >> the make step fails for flatbuffers. I will hopefully submit a PR tonight >> or tomorrow with some other build related fixes, that updates >> build_thirdparty.sh to fail fast if there is a problem with flatbuffers. >> >> Thanks, >> Micah >> >> >> >> On Sun, Mar 27, 2016 at 6:12 PM, Zheng, Kai <kai.zh...@intel.com> wrote: >> >>> Hi Wes, >>> >>> Yes I did `sh setup_build_env.sh`. Everything else works fine, except >>> the flatbuffers lib. >>> If it assumes equipping the lib by itself, I can look into the issue >>> and see if a fix is needed or not. >>> >>> Thanks. >>> >>> Regards, >>> Kai >>> >>> -----Original Message----- >>> From: Wes McKinney [mailto:w...@cloudera.com] >>> Sent: Monday, March 28, 2016 9:07 AM >>> To: dev@arrow.apache.org >>> Subject: Re: Does arrow/cpp setup google flatbuffers lib by itself? >>> >>> hi Kai, >>> >>> Did you run >>> >>> source setup_build_env.sh >>> >>> ? >>> >>> You can also manually run the thirdparty build scripts, but then you >>> must set the environment variables yourself (see the >>> setup_build_env.sh and also the Travis CI scripts for a complete >>> accounting). >>> >>> Thanks >>> Wes >>> >>> On Sun, Mar 27, 2016 at 5:25 PM, Zheng, Kai <kai.zh...@intel.com> wrote: >>> > Hi, >>> > >>> > Does Arrow/cpp assumes the building set up all its dependencies >>> including google flatbuffers lib by itself? I hit the following error >>> but am not sure if it's a building issue or not. >>> > Thanks. >>> > >>> > [root@zkdesk debug]# pwd >>> > /home/workspace/arrow/cpp/debug >>> > [root@zkdesk debug]# cmake .. >>> > Configured for DEBUG build (set with cmake >>> > -DCMAKE_BUILD_TYPE={release,debug,...}) >>> > INFO Using built-in specs. >>> > COLLECT_GCC=/bin/c++ >>> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto- >>> > w >>> > ra >>> > pper >>> > Target: x86_64-redhat-linux >>> > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man >>> > --infodir=/usr/share/info >>> > --with-bugurl=http://bugzilla.redhat.com/bugzilla >>> > --enable-bootstrap --enable-shared --enable-threads=posix >>> > --enable-checking=release --with-system-zlib --enable-__cxa_atexit >>> > --disable-libunwind-exceptions --enable-gnu-unique-object >>> > --enable-linker-build-id --with-linker-hash-style=gnu >>> > --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto >>> > --enable-plugin --enable-initfini-array --disable-libgcj >>> > --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redh >>> > a >>> > t- >>> > linux/isl-install >>> > --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-re >>> > d ha t-linux/cloog-install --enable-gnu-indirect-function >>> > --with-tune=generic --with-arch_32=x86-64 >>> > --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.3 >>> > 20140911 (Red Hat 4.8.3-9) (GCC) >>> > >>> > Selected compiler gcc 4.8.3 >>> > collect2 version 4.8.3 20140911 (Red Hat 4.8.3-9) /usr/bin/ld >>> > --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m >>> > elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 >>> > /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crt1.o >>> > /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crti.o >>> > /usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtbegin.o >>> > -L/usr/lib/gcc/x86_64-redhat-linux/4.8.3 >>> > -L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64 >>> > -L/lib/../lib64 -L/usr/lib/../lib64 >>> > -L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../.. --version >>> > -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc >>> > /usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtend.o >>> > /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crtn.o >>> > Using ld linker >>> > -- Found the GTest library: >>> > /home/workspace/arrow/cpp/thirdparty/googletest-release-1.7.0/libgt >>> > e st .a Added static library dependency gtest: >>> > /home/workspace/arrow/cpp/thirdparty/googletest-release-1.7.0/libgt >>> > e st .a CMake Error at cmake_modules/FindFlatbuffers.cmake:83 >>> > (message): >>> > Could not find the Flatbuffers library. Looked in system search paths. >>> > Call Stack (most recent call first): >>> > CMakeLists.txt:602 (find_package) >>> > >>> > Regards, >>> > Kai >>> > >>> > -- Configuring incomplete, errors occurred! >>> > >>>