Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC on FreeBSD 10.1 #273

Closed
M-Vivek opened this issue Apr 8, 2015 · 1 comment
Closed

gRPC on FreeBSD 10.1 #273

M-Vivek opened this issue Apr 8, 2015 · 1 comment

Comments

@M-Vivek
Copy link

M-Vivek commented Apr 8, 2015

Had a chance to port gRPC on FreeBSD 10.1. Basically created a FreeBSD 10.1 VM, cloned the gRPC git and with some changes in header file, makefiles & downloading few tools, was able to compile and run the sample app from the git.

Pasted below are the changes done. Please do have a look and let know your feedback. Also let know if gRPC can start supporting freeBSD.

I. grpc compilation for FreeBSD 10.1:
--------------------------------------------
a) Add support for FreeBSD platform in include/grpc/support/port_platform.h.
The following changes required to have support for FreeBSD platform.

+++ include/grpc/support/port_platform.h
@@ -75,6 +75,28 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+/_/
+#elif defined(FreeBSD)
+#define GPR_GCC_ATOMIC 1
+#define GPR_CPU_POSIX 1
+#define GPR_POSIX_LOG 1
+#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
+#define GPR_POSIX_WAKEUP_FD 1
+#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
+#define GPR_POSIX_SOCKET 1
+#define GPR_POSIX_SOCKETADDR 1
+#define GPR_POSIX_SOCKETUTILS 1
+#define GPR_POSIX_ENV 1
+#define GPR_POSIX_FILE 1
+#define GPR_POSIX_SYNC 1
+#define GPR_POSIX_STRING 1
+#define GPR_POSIX_TIME 1
+#ifdef LP64
+#define GPR_ARCH_64 1
+#else
+#define GPR_ARCH_32 1
+#endif
+/**
/
#elif defined(linux)
#ifndef _BSD_SOURCE
#define _BSD_SOURCE

b) The tools automake, autoconf and libtool needs to installed to compile thirdparty/protobuf for protobuf 3.0.

c) A change is need to the Makefile under thirdparty/openssl/ to set C/C++ compilers appropriately.
The FreeBSD 10.x comes with clang and will not have gcc by default.
The Makefile under thirdparty/openssl/ sets C/C++ compilers to gcc and g++ which should be cc(clang) and c++(clang++) for FreeBSD 10.x.

d) A change is needed to the Makefile under thirdparty/zlib/ to set C/C++ compilers appropriately (same reason mentioned above).

II. grpc-common compilation for FreeBSD 10.1
--------------------------------------------------------
The following changes needed for Services (or Applications) Makefiles.

a) Need to set C/C++ compilers appropriately fro FreeBSD 10.x.

b) Need to link with the library libc.so (-lc) instead of the library libdl (-ldl) for FreeBSD 10.x for calls to deal with a shared library (eg, dlopen, dlsym etc.).

III. The environment and tools used for compilations as follows.
--------------------------------------------------------------------------
OS: FreeBSD 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

compiler: FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
libtool: libtool (GNU libtool) 2.4.5
automake: automake (GNU automake) 1.15
autoconf: autoconf (GNU Autoconf) 2.69
host-triplet: amd64-portbld-freebsd10.1
shell: GNU bash, version 4.3.33(0)-release (amd64-portbld-freebsd10.1)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@M-Vivek
Copy link
Author

M-Vivek commented Apr 8, 2015

oops! I have wrongly posted about gRPC here. Please ignore this post and in case you are interested in this post, follow this @ grpc/grpc#1228

@M-Vivek M-Vivek closed this as completed Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant