From 6b308e2a713e19d99eae2244a19b64203c2bda70 Mon Sep 17 00:00:00 2001 From: Adam Seering Date: Mon, 30 Dec 2019 17:22:06 -0500 Subject: [PATCH] Replace Circle-CI CPU_CORES hack with environment variables (now supported upstream) --- .circleci/config.yml | 3 +++ Makefile | 4 ++-- cpython/Makefile | 7 +++++-- emsdk/Makefile | 4 ---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de750c1ccc0f..dc8591c81bd0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,9 @@ defaults: &defaults working_directory: ~/repo docker: - image: iodide/pyodide-env:0.3.1 + environment: + - EMSDK_NUM_CORES: 4 + EMCC_CORES: 4 jobs: build: diff --git a/Makefile b/Makefile index 162389f13a7e..ce35d6cbe823 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ PYODIDE_EMCC=$(PYODIDE_ROOT)/ccache/emcc PYODIDE_CXX=$(PYODIDE_ROOT)/ccache/em++ SHELL := /bin/bash -CC=emcc -CXX=em++ +CC=$(shell which emcc) +CXX=$(shell which em++) OPTFLAGS=-O3 CFLAGS=$(OPTFLAGS) -g -I$(PYTHONINCLUDE) -Wno-warn-absolute-paths CXXFLAGS=$(CFLAGS) -std=c++14 diff --git a/cpython/Makefile b/cpython/Makefile index 553a46fea21a..273093e1b728 100644 --- a/cpython/Makefile +++ b/cpython/Makefile @@ -30,6 +30,10 @@ BZIP2TARBALL=$(ROOT)/downloads/bzip2-1.0.2.tar.gz BZIP2BUILD=$(ROOT)/build/bzip2-1.0.2 BZIP2URL=ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz +ifeq ($(shell uname),Darwin) + MAC_SDK_PATH := $(shell xcrun --show-sdk-path) + MAC_BUILD_VARS := CFLAGS=-I$(MAC_SDK_PATH)/usr/include CXXFLAGS=-I$(MAC_SDK_PATH)/usr/include +endif all: $(INSTALL)/lib/$(LIB) @@ -72,13 +76,12 @@ $(BZIP2TARBALL): [ -d $(ROOT)/downloads ] || mkdir $(ROOT)/downloads wget -q -O $@ $(BZIP2URL) - $(HOSTPYTHON) $(HOSTPGEN): $(TARBALL) mkdir -p $(HOSTINSTALL) [ -d $(HOSTBUILD) ] || tar -C $(HOSTINSTALL) -xf $(TARBALL) ( \ cd $(HOSTBUILD); \ - PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ./configure --prefix=$(HOSTINSTALL) || cat config.log && \ + PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ./configure $(MAC_BUILD_VARS) --prefix=$(HOSTINSTALL) || cat config.log && \ make regen-grammar && \ make install && \ cp Parser/pgen$(EXE) $(HOSTINSTALL)/bin/ && \ diff --git a/emsdk/Makefile b/emsdk/Makefile index 77518e1f2d23..b5e305c1f2ad 100644 --- a/emsdk/Makefile +++ b/emsdk/Makefile @@ -3,13 +3,9 @@ include ../Makefile.envs all: emsdk/.complete -# We hack the CPU_CORES, because if you use all of the cores on Circle-CI, you -# run out of memory. - emsdk/.complete: if [ -d emsdk ]; then rm -rf emsdk; fi git clone https://github.com/juj/emsdk.git - sed -i -e "s#CPU_CORES = max(multiprocessing.cpu_count()-1, 1)#CPU_CORES = 3#g" emsdk/emsdk ( \ cd emsdk && \ ./emsdk install --build=Release sdk-fastcomp-tag-$(EMSCRIPTEN_VERSION)-64bit binaryen-tag-$(EMSCRIPTEN_VERSION)-64bit && \