Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Build fails on Ubuntu 16.04 LTS with gcc 5.4.0 #10

Open
admercs opened this issue Jul 21, 2016 · 2 comments
Open

Build fails on Ubuntu 16.04 LTS with gcc 5.4.0 #10

admercs opened this issue Jul 21, 2016 · 2 comments

Comments

@admercs
Copy link

admercs commented Jul 21, 2016

luarocks make
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/opt/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/opt/torch/install/lib/luarocks/rocks/thrift/scm-1" -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC;
make

-- Found Torch7 in /opt/torch/install
-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/torch-thrift/build
[ 25%] Building C object CMakeFiles/thrift.dir/src/thrift.c.o
/root/Downloads/torch-thrift/src/thrift.c: In function ‘thrift_read_rcsv’:
/root/Downloads/torch-thrift/src/thrift.c:243:16: error: implicit declaration of function ‘betoh64’ [-Werror=implicit-function-declaration]
          i64 = betoh64(i64);
                ^
/root/Downloads/torch-thrift/src/thrift.c:257:16: error: implicit declaration of function ‘betoh16’ [-Werror=implicit-function-declaration]
          i16 = betoh16(i16);
                ^
/root/Downloads/torch-thrift/src/thrift.c:271:16: error: implicit declaration of function ‘betoh32’ [-Werror=implicit-function-declaration]
          i32 = betoh32(i32);
                ^
cc1: all warnings being treated as errors
CMakeFiles/thrift.dir/build.make:62: recipe for target 'CMakeFiles/thrift.dir/src/thrift.c.o' failed
make[2]: *** [CMakeFiles/thrift.dir/src/thrift.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/thrift.dir/all' failed
make[1]: *** [CMakeFiles/thrift.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.
@admercs
Copy link
Author

admercs commented Jul 21, 2016

I added the following definitions to top two lines of /src/thrift.c that fixed the compiler error caused by endian.h:

#define _BSD_SOURCE
#define __USE_BSD

Everything builds successfully now.

@admercs admercs closed this as completed Jul 21, 2016
@admercs admercs reopened this Jul 21, 2016
@admercs
Copy link
Author

admercs commented Jul 28, 2016

Issue re-opened for devs to see and close.

@admercs admercs changed the title Build fails on Ubuntu 16.04 LTS Build fails on Ubuntu 16.04 LTS with gcc 5.4.0 Jul 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant