diff --git a/compiler/Makefile b/compiler/Makefile index 107d52d2e..2a98c28cd 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -1,6 +1,6 @@ BUILD_TYPE?=Release BUILD_DIR?=./build -Python3_EXECUTABLE?=python3 +Python3_EXECUTABLE?=$(shell which python3) BINDINGS_PYTHON_ENABLED=ON DATAFLOW_EXECUTION_ENABLED=OFF TIMING_ENABLED=OFF @@ -22,12 +22,23 @@ HPX_LOCAL_DIR=$(shell pwd)/hpx-$(HPX_VERSION) HPX_INSTALL_DIR?=$(HPX_LOCAL_DIR)/build CONCRETE_CORE_FFI_VERSION?=0.2.0 + +OS=undefined ifeq ($(shell uname), Linux) - CONCRETE_CORE_FFI_TARBALL=concrete-core-ffi_$(CONCRETE_CORE_FFI_VERSION)_linux_amd64.tar.gz -else - CONCRETE_CORE_FFI_TARBALL=concrete-core-ffi_$(CONCRETE_CORE_FFI_VERSION)_darwin_amd64.tar.gz + OS=linux +else ifeq ($(shell uname), Darwin) + OS=darwin endif +ARCHITECTURE=undefined +ifeq ($(shell uname -m), arm64) + ARCHITECTURE=aarch64 +else + ARCHITECTURE=amd64 +endif + +CONCRETE_CORE_FFI_TARBALL=concrete-core-ffi_$(CONCRETE_CORE_FFI_VERSION)_$(OS)_$(ARCHITECTURE).tar.gz + export PATH := $(abspath $(BUILD_DIR))/bin:$(PATH) ifeq ($(shell which ccache),) diff --git a/compiler/README.md b/compiler/README.md index 23844cd43..92eab0bce 100644 --- a/compiler/README.md +++ b/compiler/README.md @@ -120,6 +120,8 @@ pybind11 is required to build the python package, you can install it in your cur $ pip install pybind11 ``` +To specify which python executable to target you can specify the `Python3_EXECUTABLE` environment variable. + #### Build wheels in your environment Building the wheels is actually simple. diff --git a/compiler/lib/Runtime/seeder.cpp b/compiler/lib/Runtime/seeder.cpp index 91954587b..d67441e10 100644 --- a/compiler/lib/Runtime/seeder.cpp +++ b/compiler/lib/Runtime/seeder.cpp @@ -12,13 +12,25 @@ SeederBuilder *get_best_seeder() { SeederBuilder *builder = NULL; + +#if defined(__x86_64__) || defined(_M_X64) bool rdseed_seeder_available = false; CAPI_ASSERT_ERROR(rdseed_seeder_is_available(&rdseed_seeder_available)); - if (rdseed_seeder_available) { CAPI_ASSERT_ERROR(get_rdseed_seeder_builder(&builder)); return builder; } +#endif + +#if __APPLE__ + bool apple_seeder_available = false; + CAPI_ASSERT_ERROR( + apple_secure_enclave_seeder_is_available(&apple_seeder_available)); + if (apple_seeder_available) { + CAPI_ASSERT_ERROR(get_apple_secure_enclave_seeder_builder(&builder)); + return builder; + } +#endif bool unix_seeder_available = false; CAPI_ASSERT_ERROR(unix_seeder_is_available(&unix_seeder_available));