devmadhuu commented on code in PR #8262:
URL: https://github.com/apache/ozone/pull/8262#discussion_r2038769109


##########
hadoop-hdds/docs/content/start/FromSource.md:
##########
@@ -32,29 +39,91 @@ planning to build sources yourself, you can safely skip 
this page.
 
 </div>
 
-If you are a Hadoop ninja, and wise in the ways of Apache, you already know
-that a real Apache release is a source release.
-
 If you want to build from sources, Please untar the source tarball (or clone 
the latest code 
-from the [git repository](https://github.com/apache/ozone)) and run the ozone 
build command. This instruction assumes that you have all the
-dependencies to build Hadoop on your build machine. If you need instructions
-on how to build Hadoop, please look at the Apache Hadoop Website.
+from the [git repository](https://github.com/apache/ozone)).
+
+## ARM-based Linux
+If you are using an ARM-based Linux, patch protobuf 2.5.0 and build it from 
source.
 
 ```bash
-mvn clean package -DskipTests=true
+sudo yum install -y make cmake gcc g++ patch
+# or for Ubuntu and Debian:
+# sudo apt-get install -y make cmake gcc g++ patch
+
+# Download protobuf 2.5.0 tarball
+curl -sSL 
https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
 | tar zx
+cd protobuf-2.5.0
+
+# patch protobuf 2.5.0
+curl -L -O 
https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch
+patch -p1 < protobuf-2.5.0-arm64.patch
+# build protobuf
+./configure --disable-shared
+make
+# install protoc to the local Maven repository
+mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc 
-Dversion=2.5.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=src/protoc
+# workaround for Maven 3.9.x
+cp 
$HOME/.m2/repository/com/google/protobuf/protoc/2.5.0/protoc-2.5.0-linux-aarch_64
 
$HOME/.m2/repository/com/google/protobuf/protoc/2.5.0/protoc-2.5.0-linux-aarch_64.exe
+```
+
+## ARM-based Apple Silicon (Apple M1 ... etc)
+
+```bash
+PROTOBUF_VERSION="3.7.1"
+curl -sSL 
https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz
 | tar zx
+cd protobuf-${PROTOBUF_VERSION}
+./configure --disable-shared
+make -j
+# install protoc to the local Maven repository
+mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc 
-Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe 
-Dfile=src/protoc
+# workaround for Maven 3.9.x. Not needed for 3.8.x or earlier
+cp 
$HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64
 
$HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64.exe
+
+cd ..
+# Download protobuf 2.5.0 tarball
+PROTOBUF_VERSION="2.5.0"
+curl -sSL 
https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz
 | tar zx
+cd protobuf-${PROTOBUF_VERSION}
+

Review Comment:
   So we don't need to add below lines in 
`src/google/protobuf/stubs/platform_macros.h` ?
   
   ```
   #elif defined(__arm64__)
   #define GOOGLE_PROTOBUF_ARCH_ARM 1
   #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to