FreeBSD compatibility (#7073)
* Adding FreeBSD compatibility (non-breaking changes) * Adding FreeBSD compatibility (BREAKING changes) - FreeBSD has libdl integrated into libc so -ldl is not available * Adding FreeBSD compatibility (BREAKING changes) - FreeBSD has libdl integrated into libc so -ldl is not available * - Define FreeBSD config - Clear -ldl linkopts for FreeBSD only * Clear -ldl linkopts for FreeBSD only * Changing to local condition just as previously done with darwin * Removing one indentation for syntax validation * Removing one indentation here too * - Changing new config name to lowercase - Fixing buildifier warning
This commit is contained in:
parent
f621cf2252
commit
e75c0fc925
@ -104,6 +104,12 @@ config_setting(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "freebsd",
|
||||
values = {"cpu": "freebsd"},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
package_group(
|
||||
name = "internal",
|
||||
packages = ["//tensorflow/..."],
|
||||
|
@ -1196,7 +1196,10 @@ cc_library(
|
||||
],
|
||||
copts = tf_copts(),
|
||||
defines = tf_additional_lib_defines(),
|
||||
linkopts = ["-ldl"],
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}),
|
||||
deps = tf_additional_lib_deps() + [
|
||||
":lib_hash_crc32c_accelerate_internal",
|
||||
":lib_proto_parsing",
|
||||
@ -1223,7 +1226,10 @@ cc_library(
|
||||
],
|
||||
hdrs = ["lib/gif/gif_io.h"],
|
||||
copts = tf_copts(),
|
||||
linkopts = ["-ldl"],
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}),
|
||||
deps = [
|
||||
":lib",
|
||||
"//tensorflow/core/platform/default/build_config:gif",
|
||||
@ -1242,7 +1248,10 @@ cc_library(
|
||||
"lib/jpeg/jpeg_mem.h",
|
||||
],
|
||||
copts = tf_copts(),
|
||||
linkopts = ["-ldl"],
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}),
|
||||
deps = [
|
||||
":lib",
|
||||
"//tensorflow/core/platform/default/build_config:jpeg",
|
||||
@ -1320,8 +1329,10 @@ tf_cuda_library(
|
||||
"util/tensor_slice_util.h",
|
||||
],
|
||||
copts = tf_copts(),
|
||||
linkopts = [
|
||||
"-ldl",
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}) + [
|
||||
"-lm",
|
||||
],
|
||||
deps = [
|
||||
|
@ -131,7 +131,7 @@ error::Code ErrnoToCode(int err_number) {
|
||||
case ENETUNREACH: // Network unreachable
|
||||
case ENOLCK: // No locks available
|
||||
case ENOLINK: // Link has been severed
|
||||
#if !(defined(__APPLE__) || defined(_WIN32))
|
||||
#if !(defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32))
|
||||
case ENONET: // Machine is not on the network
|
||||
#endif
|
||||
code = error::UNAVAILABLE;
|
||||
|
@ -24,6 +24,7 @@ limitations under the License.
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "tensorflow/core/lib/strings/stringprintf.h"
|
||||
|
@ -16,6 +16,8 @@ limitations under the License.
|
||||
#ifndef TENSORFLOW_PLATFORM_PROFILEUTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H__
|
||||
#define TENSORFLOW_PLATFORM_PROFILEUTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "tensorflow/core/platform/macros.h"
|
||||
#include "tensorflow/core/platform/profile_utils/i_cpu_utils_helper.h"
|
||||
#include "tensorflow/core/platform/types.h"
|
||||
|
@ -24,9 +24,10 @@ cc_library(
|
||||
"lib/gtl/*.h",
|
||||
"platform/**/*.h",
|
||||
]),
|
||||
linkopts = [
|
||||
"-ldl",
|
||||
],
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//tensorflow/core:lib",
|
||||
@ -45,9 +46,10 @@ cc_library(
|
||||
exclude = ["cuda/cuda_platform_id.cc"],
|
||||
),
|
||||
),
|
||||
linkopts = [
|
||||
"-ldl",
|
||||
],
|
||||
linkopts = select({
|
||||
"//tensorflow:freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":stream_executor",
|
||||
|
@ -41,7 +41,7 @@ bool RngSupport::CheckSeed(const uint8 *seed, uint64 seed_bytes) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
const int RngSupport::kMinSeedBytes;
|
||||
const int RngSupport::kMaxSeedBytes;
|
||||
#endif
|
||||
|
12
third_party/gpus/cuda/BUILD.tpl
vendored
12
third_party/gpus/cuda/BUILD.tpl
vendored
@ -33,6 +33,12 @@ config_setting(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "freebsd",
|
||||
values = {"cpu": "freebsd"},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "cuda_headers",
|
||||
hdrs = glob([
|
||||
@ -49,8 +55,10 @@ cc_library(
|
||||
name = "cudart_static",
|
||||
srcs = ["lib/%{cudart_static_lib}"],
|
||||
includes = ["include/"],
|
||||
linkopts = [
|
||||
"-ldl",
|
||||
linkopts = select({
|
||||
":freebsd": [],
|
||||
"//conditions:default": ["-ldl"],
|
||||
}) + [
|
||||
"-lpthread",
|
||||
%{cudart_static_linkopt}
|
||||
],
|
||||
|
2
third_party/gpus/cuda_configure.bzl
vendored
2
third_party/gpus/cuda_configure.bzl
vendored
@ -368,7 +368,7 @@ def _lib_name(lib, cpu_value, version="", static=False):
|
||||
Returns:
|
||||
The platform-specific name of the library.
|
||||
"""
|
||||
if cpu_value == "Linux":
|
||||
if cpu_value in ("Linux", "FreeBSD"):
|
||||
if static:
|
||||
return "lib%s.a" % lib
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user