protobuf 2.5.0 for ARM64 for Hadoop 2.6.4

1,305 views
Skip to first unread message

David MacMillan

unread,
May 27, 2016, 10:35:11 AM5/27/16
to Protocol Buffers
In recompiling the native libraries for Hadoop 2.6.4 for ARM64, I need protobuf 2.5.0 for ARM64. But when I try to build protobuf 2.5.0 on an ARM64 cpu, I get the 'atomicops' error shown below. This error seems similar to this bug report for Solaris:
but in my case it is for ARM64. It would be great if someone could either suggest a workaround or suggest how to fix the protobuf 2.5.0 make files. Unfortunately the build of the Hadoop native libraries is insisting on protobuf 2.5.0 so using a more recent protobuf version doesn't appear to be an option.. 

Here is my make listing, with the error shown at the end:
make
make  all-recursive
make[1]: Entering directory '/home/hduser/Downloads/protobuf-2.5.0'
Making all in .
make[2]: Entering directory '/home/hduser/Downloads/protobuf-2.5.0'
make[2]: Leaving directory '/home/hduser/Downloads/protobuf-2.5.0'
Making all in src
make[2]: Entering directory '/home/hduser/Downloads/protobuf-2.5.0/src'
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT atomicops_internals_x86_gcc.lo -MD -MP -MF .deps/atomicops_internals_x86_gcc.Tpo -c -o atomicops_internals_x86_gcc.lo `test -f 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc' || echo './'`google/protobuf/stubs/atomicops_internals_x86_gcc.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT atomicops_internals_x86_gcc.lo -MD -MP -MF .deps/atomicops_internals_x86_gcc.Tpo -c google/protobuf/stubs/atomicops_internals_x86_gcc.cc  -fPIC -DPIC -o .libs/atomicops_internals_x86_gcc.o
In file included from ./google/protobuf/stubs/atomicops.h:59:0,
                 from google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:
./google/protobuf/stubs/platform_macros.h:61:2: error: #error Host architecture was not detected as supported by protobuf
 #error Host architecture was not detected as supported by protobuf
  ^
In file included from google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:0:
./google/protobuf/stubs/atomicops.h:161:1: error: stray â#â in program
 #error "Atomic operations are not supported on your platform"
 ^
./google/protobuf/stubs/atomicops.h:188:1: note: in expansion of macro âGOOGLE_PROTOBUF_ATOMICOPS_ERRORâ
 GOOGLE_PROTOBUF_ATOMICOPS_ERROR
 ^
./google/protobuf/stubs/atomicops.h:161:2: error: âerrorâ does not name a type
 #error "Atomic operations are not supported on your platform"
  ^
./google/protobuf/stubs/atomicops.h:188:1: note: in expansion of macro âGOOGLE_PROTOBUF_ATOMICOPS_ERRORâ
 GOOGLE_PROTOBUF_ATOMICOPS_ERROR
 ^
Makefile:1481: recipe for target 'atomicops_internals_x86_gcc.lo' failed
make[2]: *** [atomicops_internals_x86_gcc.lo] Error 1
make[2]: Leaving directory '/home/hduser/Downloads/protobuf-2.5.0/src'
Makefile:669: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/hduser/Downloads/protobuf-2.5.0'
Makefile:576: recipe for target 'all' failed
make: *** [all] Error 2

 

Feng Xiao

unread,
May 31, 2016, 1:55:28 PM5/31/16
to David MacMillan, Protocol Buffers
ARM64 support was added after 2.5.0, so you probably have to patch the fix back to 2.5.0 in order to compile 2.5.0 for arm64. See the patch:

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Wei-ju Wu

unread,
Jun 2, 2016, 2:46:36 PM6/2/16
to Protocol Buffers
I had exactly the same problem.

Thanks to Feng Xiao's reply below I was able to make a patch that works for me (on ODROID C2 and Ubuntu Mate), I've put the patch file on my public Dropbox folder.

You can apply it e.g. like that

$ tar xfz protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ patch -p1 < ../protobuf-2.5.0-arm64.patch

and then configure and build as you would typically do

Muskan Khedia

unread,
Jan 8, 2024, 12:57:37 AMJan 8
to Protocol Buffers
Hi all,

I am facing issue while configuring Hadoop 3.3.5 on Linux Ubuntu 20.04. Can you direct me to the documentation for setting up Hadoop ARM64 on an Azure VM or any similar resources?

Currently, I'm using the guide Apache Hadoop 3.3.5 – Hadoop: Setting up a Single Node Cluster for the setup process.

The software versions being utilized are:

I would greatly appreciate any assistance provided.

Reply all
Reply to author
Forward
0 new messages