Commit bafb7155 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #460 from dagar/cmake-default

cmake change default build directory, configure script, Fedora support
parents 13cfd50a 1482fe34
build
Makefile.local
tools/astprint
tools/demangle
......
......@@ -51,9 +51,8 @@ install:
script:
- ccache -z
- ninja -j4 pyston
- PYSTON_RUN_ARGS=G ninja -j4 check-pyston
- ccache -s
- PYSTON_RUN_ARGS=G ninja check-pyston
- mysql -e 'create database mysqldb_test charset utf8;'
- PYSTON_RUN_ARGS=G python $TRAVIS_BUILD_DIR/tools/tester.py -R ./pyston -a=-S -k -t600 --exit-code-only $TRAVIS_BUILD_DIR/test/extra
......
......@@ -3,7 +3,7 @@ project(pyston C CXX ASM)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(CheckTypeSize)
include(pyconfig)
include(ExternalProject)
set(DEPS_DIR $ENV{HOME}/pyston_deps)
......@@ -109,7 +109,7 @@ if(ENABLE_INTEL_JIT_EVENTS)
add_definitions(-DENABLE_INTEL_JIT_EVENTS=1)
endif()
add_subdirectory(${DEPS_DIR}/llvm-trunk ${CMAKE_BINARY_DIR}/llvm EXCLUDE_FROM_ALL)
set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/llvm/share/llvm/cmake/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/llvm/share/llvm/cmake/")
include(LLVMConfig)
llvm_map_components_to_libnames(LLVM_LIBS core mcjit native bitreader bitwriter ipo irreader debuginfodwarf instrumentation ${INTEL_JIT_EVENTS_LIB})
......@@ -146,11 +146,11 @@ SET_SOURCE_FILES_PROPERTIES(
)
# libpypa
add_subdirectory(libpypa)
add_subdirectory(libpypa EXCLUDE_FROM_ALL)
add_dependencies(pypa gitsubmodules)
# lz4
add_subdirectory(lz4/cmake_unofficial)
add_subdirectory(lz4/cmake_unofficial EXCLUDE_FROM_ALL)
add_dependencies(lz4 gitsubmodules)
# valgrind
......@@ -192,24 +192,13 @@ add_definitions(${LLVM_DEFINITIONS})
add_definitions(-DDEFAULT_PYTHON_MAJOR_VERSION=2 -DDEFAULT_PYTHON_MINOR_VERSION=7 -DDEFAULT_PYTHON_MICRO_VERSION=6) # Python 2.7.6
add_definitions(-DLLVMREV=${LLVMREV})
include_directories(${CMAKE_BINARY_DIR}/from_cpython/Include)
include_directories(${LLVM_INCLUDE_DIRS})
include_directories(from_cpython/Include)
find_package(LibLZMA REQUIRED)
link_directories(${CMAKE_BINARY_DIR}/libunwind/lib)
link_directories(${LLVM_LIBRARY_DIRS})
# generate config.h - must be after LLVM is configured
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_SOURCE_DIR}/src/runtime/types.h)
set(CMAKE_REQUIRED_DEFINITIONS "-DNVALGRIND -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS")
set(CMAKE_REQUIRED_INCLUDES ${DEPS_DIR}/llvm-trunk/include
${CMAKE_BINARY_DIR}/llvm/include
${CMAKE_SOURCE_DIR}/from_cpython/Include
${CMAKE_SOURCE_DIR}/src)
check_type_size("pyston::BoxedDict" SIZEOF_BOXEDDICT LANGUAGE CXX)
configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
add_subdirectory(lib_pyston)
add_subdirectory(from_cpython)
add_subdirectory(src)
......@@ -223,7 +212,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/linkdeps_dummy.c COMMAND ${CMAKE_C
add_executable(pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON> linkdeps_dummy.c)
# Wrap the stdlib in --whole-archive to force all the symbols to be included and eventually exported
target_link_libraries(pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES})
target_link_libraries(pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m z readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES})
# copy src/codegen/parse_ast.py to the build directory
add_custom_command(TARGET pyston POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/codegen/parse_ast.py ${CMAKE_BINARY_DIR}/src/codegen/parse_ast.py)
......
......@@ -7,6 +7,9 @@ print-%: ; @echo $($*)
USE_TEST_LLVM := 0
DEPS_DIR := $(HOME)/pyston_deps
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BUILD_DIR := $(SRC_DIR)/build
LLVM_REVISION_FILE := llvm_revision.txt
LLVM_REVISION := $(shell cat $(LLVM_REVISION_FILE))
......@@ -54,8 +57,9 @@ FORCE_TRUNK_BINARIES := 0
USE_CMAKE := 1
NINJA := ninja
CMAKE_DIR_DBG := $(HOME)/pyston-build-dbg
CMAKE_DIR_RELEASE := $(HOME)/pyston-build-release
CMAKE_DIR_DBG := $(BUILD_DIR)/Debug
CMAKE_DIR_DBG_GCC := $(BUILD_DIR)/Debug-gcc
CMAKE_DIR_RELEASE := $(BUILD_DIR)/Release
CMAKE_SETUP_DBG := $(CMAKE_DIR_DBG)/build.ninja
CMAKE_SETUP_RELEASE := $(CMAKE_DIR_RELEASE)/build.ninja
......@@ -183,9 +187,11 @@ COMMON_CXXFLAGS += -I$(DEPS_DIR)/lz4-install/include
ifeq ($(ENABLE_VALGRIND),0)
COMMON_CXXFLAGS += -DNVALGRIND
VALGRIND := false
CMAKE_VALGRIND :=
else
COMMON_CXXFLAGS += -I$(DEPS_DIR)/valgrind-3.10.0/include
VALGRIND := VALGRIND_LIB=$(DEPS_DIR)/valgrind-3.10.0-install/lib/valgrind $(DEPS_DIR)/valgrind-3.10.0-install/bin/valgrind
CMAKE_VALGRIND := -DENABLE_VALGRIND=ON -DVALGRIND_DIR=$(DEPS_DIR)/valgrind-3.10.0-install/
endif
COMMON_CXXFLAGS += -DGITREV=$(shell git rev-parse HEAD | head -c 12) -DLLVMREV=$(LLVM_REVISION)
......@@ -476,8 +482,8 @@ $1_unittest: $(GTEST_DIR)/src/gtest-all.o $(NON_ENTRY_OBJS) $(BUILD_SYSTEM_DEPS)
else
.PHONY: $1_unittest
$1_unittest:
$(NINJA) -C $(HOME)/pyston-build-dbg $1_unittest $(NINJAFLAGS)
ln -sf $(HOME)/pyston-build-dbg/$1_unittest .
$(NINJA) -C $(CMAKE_DIR_DBG) $1_unittest $(NINJAFLAGS)
ln -sf $(CMAKE_DIR_DBG)/$1_unittest .
endif
dbg_$1_unittests: $1_unittest
zsh -c 'ulimit -m $(MAX_MEM_KB); time $(GDB) $(GDB_CMDS) --args ./$1_unittest --gtest_break_on_failure $(ARGS)'
......@@ -502,20 +508,6 @@ define checksha
test "$$($1 | sha1sum)" = "$2 -"
endef
.PHONY: format check_format
ifneq ($(USE_CMAKE),1)
format:
cd src && find \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 $(LLVM_BIN)/clang-format -style=file -i
check_format:
$(ECHO) checking formatting...
$(VERB) cd src && ../tools/check_format.sh $(LLVM_BIN)/clang-format
else
format: $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(HOME)/pyston-build-release format
check_format: $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(HOME)/pyston-build-release check-format
endif
.PHONY: analyze
analyze:
$(MAKE) clean
......@@ -840,9 +832,9 @@ $(call make_compile_config,.grwl_dbg,$(CXXFLAGS_DBG) -DTHREADING_USE_GRWL=1 -DTH
$(call make_compile_config,.nosync,$(CXXFLAGS_RELEASE) -DTHREADING_USE_GRWL=0 -DTHREADING_USE_GIL=0 -UBINARY_SUFFIX -DBINARY_SUFFIX=_nosync)
else
%.o: %.cpp $(CMAKE_SETUP_DBG)
$(NINJA) -C $(HOME)/pyston-build-dbg src/CMakeFiles/PYSTON_OBJECTS.dir/$(patsubst src/%.o,%.cpp.o,$@) $(NINJAFLAGS)
$(NINJA) -C $(CMAKE_DIR_DBG) src/CMakeFiles/PYSTON_OBJECTS.dir/$(patsubst src/%.o,%.cpp.o,$@) $(NINJAFLAGS)
%.release.o: %.cpp $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(HOME)/pyston-build-release src/CMakeFiles/PYSTON_OBJECTS.dir/$(patsubst src/%.release.o,%.cpp.o,$@) $(NINJAFLAGS)
$(NINJA) -C $(CMAKE_DIR_RELEASE) src/CMakeFiles/PYSTON_OBJECTS.dir/$(patsubst src/%.release.o,%.cpp.o,$@) $(NINJAFLAGS)
endif
$(UNITTEST_SRCS:.cpp=.o): CXXFLAGS += -isystem $(GTEST_DIR)/include
......@@ -946,12 +938,12 @@ $(CMAKE_SETUP_DBG):
@$(MAKE) cmake_check
@$(MAKE) clang_check
@mkdir -p $(CMAKE_DIR_DBG)
cd $(CMAKE_DIR_DBG); CC='clang' CXX='clang++' cmake -GNinja $(HOME)/pyston -DCMAKE_BUILD_TYPE=Debug
cd $(CMAKE_DIR_DBG); CC='clang' CXX='clang++' cmake -GNinja $(SRC_DIR) -DTEST_THREADS=$(TEST_THREADS) -DCMAKE_BUILD_TYPE=Debug $(CMAKE_VALGRIND)
$(CMAKE_SETUP_RELEASE):
@$(MAKE) cmake_check
@$(MAKE) clang_check
@mkdir -p $(CMAKE_DIR_RELEASE)
cd $(CMAKE_DIR_RELEASE); CC='clang' CXX='clang++' cmake -GNinja $(HOME)/pyston -DCMAKE_BUILD_TYPE=Release
cd $(CMAKE_DIR_RELEASE); CC='clang' CXX='clang++' cmake -GNinja $(SRC_DIR) -DTEST_THREADS=$(TEST_THREADS) -DCMAKE_BUILD_TYPE=Release
# Shared modules (ie extension modules that get built using pyston on setup.py) that we will ask CMake
# to build. You can flip this off to allow builds to continue even if self-hosting the sharedmods would fail.
......@@ -965,16 +957,30 @@ pyston_release: $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(CMAKE_DIR_RELEASE) pyston copy_stdlib copy_libpyston $(CMAKE_SHAREDMODS) ext_cpython $(NINJAFLAGS)
ln -sf $(CMAKE_DIR_RELEASE)/pyston pyston_release
endif
CMAKE_DIR_GCC := $(HOME)/pyston-build-gcc
CMAKE_DIR_GCC := $(CMAKE_DIR_DBG_GCC)
CMAKE_SETUP_GCC := $(CMAKE_DIR_GCC)/build.ninja
$(CMAKE_SETUP_GCC):
@$(MAKE) cmake_check
@mkdir -p $(CMAKE_DIR_GCC)
cd $(CMAKE_DIR_GCC); CC='$(GCC)' CXX='$(GPP)' cmake -GNinja $(HOME)/pyston -DCMAKE_BUILD_TYPE=Debug
cd $(CMAKE_DIR_GCC); CC='$(GCC)' CXX='$(GPP)' cmake -GNinja $(SRC_DIR) -DCMAKE_BUILD_TYPE=Debug $(CMAKE_VALGRIND)
.PHONY: pyston_gcc
pyston_gcc: $(CMAKE_SETUP_GCC)
$(NINJA) -C $(HOME)/pyston-build-gcc pyston copy_stdlib copy_libpyston sharedmods ext_pyston ext_cpython $(NINJAFLAGS)
ln -sf $(HOME)/pyston-build-gcc/pyston pyston_gcc
$(NINJA) -C $(CMAKE_DIR_DBG_GCC) pyston copy_stdlib copy_libpyston sharedmods ext_pyston ext_cpython $(NINJAFLAGS)
ln -sf $(CMAKE_DIR_DBG_GCC)/pyston pyston_gcc
.PHONY: format check_format
ifneq ($(USE_CMAKE),1)
format:
cd src && find \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 $(LLVM_BIN)/clang-format -style=file -i
check_format:
$(ECHO) checking formatting...
$(VERB) cd src && ../tools/check_format.sh $(LLVM_BIN)/clang-format
else
format: $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(CMAKE_DIR_RELEASE) format
check_format: $(CMAKE_SETUP_RELEASE)
$(NINJA) -C $(CMAKE_DIR_RELEASE) check-format
endif
-include $(wildcard src/*.d) $(wildcard src/*/*.d) $(wildcard src/*/*/*.d) $(wildcard $(UNITTEST_DIR)/*.d) $(wildcard from_cpython/*/*.d) $(wildcard from_cpython/*/*/*.d)
......
#.rst:
# CheckTypeSize
# CheckTypeSizeof
# -------------
#
# Pyston: This file is included from cmake 3 for compatability
......@@ -11,7 +11,7 @@
#
# ::
#
# CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
# CHECK_TYPE_SIZEOF(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
# [LANGUAGE <language>])
#
# Check if the type exists and determine its size. On return,
......@@ -54,7 +54,7 @@
#
# ::
#
# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
# check_type_sizeof("((struct something*)0)->member" SIZEOF_MEMBER)
#
#
#
......@@ -89,11 +89,11 @@ include(CheckIncludeFileCXX)
cmake_policy(PUSH)
cmake_policy(VERSION 2.8)
get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(__check_type_sizeof_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
#-----------------------------------------------------------------------------
# Helper function. DO NOT CALL DIRECTLY.
function(__check_type_size_impl type var map builtin language)
function(__check_type_sizeof_impl type var map builtin language)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Check size of ${type}")
endif()
......@@ -118,14 +118,14 @@ function(__check_type_size_impl type var map builtin language)
# Perform the check.
if("${language}" STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSizeof/${var}.c)
elseif("${language}" STREQUAL "CXX")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSizeof/${var}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
endif()
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSizeof/${var}.bin)
configure_file(${__check_type_sizeof_dir}/CheckTypeSizeof.c.in ${src} @ONLY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
......@@ -170,14 +170,14 @@ function(__check_type_size_impl type var map builtin language)
# Update the architecture-to-size map.
if(mismatch AND keys)
configure_file(${__check_type_size_dir}/CheckTypeSizeMap.cmake.in ${map} @ONLY)
configure_file(${__check_type_sizeof_dir}/CheckTypeSizeMap.cmake.in ${map} @ONLY)
set(${var} 0)
else()
file(REMOVE ${map})
endif()
if(mismatch AND NOT keys)
message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
message(SEND_ERROR "CHECK_TYPE_SIZEOF found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
endif()
if(NOT CMAKE_REQUIRED_QUIET)
......@@ -185,7 +185,7 @@ function(__check_type_size_impl type var map builtin language)
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZEOF: sizeof(${type})")
else()
# The check failed to compile.
if(NOT CMAKE_REQUIRED_QUIET)
......@@ -194,24 +194,24 @@ function(__check_type_size_impl type var map builtin language)
file(READ ${src} content)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZEOF: ${type} unknown")
file(REMOVE ${map})
endif()
endfunction()
#-----------------------------------------------------------------------------
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
macro(CHECK_TYPE_SIZEOF TYPE VARIABLE)
# parse arguments
unset(doing)
foreach(arg ${ARGN})
if("x${arg}" STREQUAL "xBUILTIN_TYPES_ONLY")
set(_CHECK_TYPE_SIZE_${arg} 1)
set(_CHECK_TYPE_SIZEOF_${arg} 1)
unset(doing)
elseif("x${arg}" STREQUAL "xLANGUAGE") # change to MATCHES for more keys
set(doing "${arg}")
set(_CHECK_TYPE_SIZE_${doing} "")
set(_CHECK_TYPE_SIZEOF_${doing} "")
elseif("x${doing}" STREQUAL "xLANGUAGE")
set(_CHECK_TYPE_SIZE_${doing} "${arg}")
set(_CHECK_TYPE_SIZEOF_${doing} "${arg}")
unset(doing)
else()
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
......@@ -220,17 +220,17 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
if("x${doing}" MATCHES "^x(LANGUAGE)$")
message(FATAL_ERROR "Missing argument:\n ${doing} arguments requires a value\n")
endif()
if(DEFINED _CHECK_TYPE_SIZE_LANGUAGE)
if(NOT "x${_CHECK_TYPE_SIZE_LANGUAGE}" MATCHES "^x(C|CXX)$")
message(FATAL_ERROR "Unknown language:\n ${_CHECK_TYPE_SIZE_LANGUAGE}.\nSupported languages: C, CXX.\n")
if(DEFINED _CHECK_TYPE_SIZEOF_LANGUAGE)
if(NOT "x${_CHECK_TYPE_SIZEOF_LANGUAGE}" MATCHES "^x(C|CXX)$")
message(FATAL_ERROR "Unknown language:\n ${_CHECK_TYPE_SIZEOF_LANGUAGE}.\nSupported languages: C, CXX.\n")
endif()
set(_language ${_CHECK_TYPE_SIZE_LANGUAGE})
set(_language ${_CHECK_TYPE_SIZEOF_LANGUAGE})
else()
set(_language C)
endif()
# Optionally check for standard headers.
if(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
if(_CHECK_TYPE_SIZEOF_BUILTIN_TYPES_ONLY)
set(_builtin 0)
else()
set(_builtin 1)
......@@ -244,14 +244,14 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
check_include_file_cxx(stddef.h HAVE_STDDEF_H)
endif()
endif()
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
unset(_CHECK_TYPE_SIZE_LANGUAGE)
unset(_CHECK_TYPE_SIZEOF_BUILTIN_TYPES_ONLY)
unset(_CHECK_TYPE_SIZEOF_LANGUAGE)
# Compute or load the size or size map.
set(${VARIABLE}_KEYS)
set(_map_file ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${VARIABLE}.cmake)
set(_map_file ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CheckTypeSizeof/${VARIABLE}.cmake)
if(NOT DEFINED HAVE_${VARIABLE})
__check_type_size_impl(${TYPE} ${VARIABLE} ${_map_file} ${_builtin} ${_language})
__check_type_sizeof_impl(${TYPE} ${VARIABLE} ${_map_file} ${_builtin} ${_language})
endif()
include(${_map_file} OPTIONAL)
set(_map_file)
......
......@@ -3,8 +3,8 @@ include(FindPackageHandleStandardArgs)
find_path(VALGRIND_INCLUDE_DIR
NAMES valgrind.h
PATHS /usr/include /usr/include/valgrind ${VALGRIND_DIR}/include)
PATHS /usr/include /usr/include/valgrind ${VALGRIND_DIR}/include/valgrind)
find_program(VALGRIND_BIN NAMES valgrind PATH /usr/bin ${VALGRIND_DIR}/bin)
find_program(VALGRIND_BIN NAMES valgrind PATHS /usr/bin ${VALGRIND_DIR}/bin)
find_package_handle_standard_args(valgrind REQUIRED_VARS VALGRIND_BIN VALGRIND_INCLUDE_DIR)
# generate pyconfig.h
include(CheckIncludeFiles)
include(CheckTypeSizeof)
set(CMAKE_EXTRA_INCLUDE_FILES unordered_map)
set(CMAKE_REQUIRED_FLAGS -std=c++11)
check_type_sizeof("std::unordered_map<void*, void*>" SIZEOF_UNORDEREDMAP LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_FLAGS)
check_include_files(alloca.h HAVE_ALLOCA_H)
check_include_files(asm/types.h HAVE_ASM_TYPES_H)
check_include_files(curses.h HAVE_CURSES_H)
check_include_files(dirent.h HAVE_DIRENT_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(errno.h HAVE_ERRNO_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(grp.h HAVE_GRP_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(libintl.h HAVE_LIBINTL_H)
check_include_files(linux/netlink.h HAVE_LINUX_NETLINK_H)
check_include_files(linux/tipc.h HAVE_LINUX_TIPC_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(ncurses.h HAVE_NCURSES_H)
check_include_files(netpacket/packet.h HAVE_NETPACKET_PACKET_H)
check_include_files(poll.h HAVE_POLL_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_include_files(pty.h HAVE_PTY_H)
check_include_files(shadow.h HAVE_SHADOW_H)
check_include_files(signal.h HAVE_SIGNAL_H)
check_include_files(spawn.h HAVE_SPAWN_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(stropts.h HAVE_STROPTS_H)
check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H)
check_include_files(sys/file.h HAVE_SYS_FILE_H)
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/poll.h HAVE_SYS_POLL_H)
check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/statvfs.h HAVE_SYS_STATVFS_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(sys/un.h HAVE_SYS_UN_H)
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
check_include_files(sysexits.h HAVE_SYSEXITS_H)
check_include_files(term.h HAVE_TERM_H)
check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(wchar.h HAVE_WCHAR_H)
configure_file(from_cpython/Include/pyconfig.h.in from_cpython/Include/pyconfig.h)
/*--------------------------------------------------------------------------
* This file is autogenerated from config.h.in
* during the cmake configuration of your project.
* --------------------------------------------------------------------------*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define SIZEOF_BOXEDDICT @SIZEOF_BOXEDDICT@
#endif
Pyston currently only supports installing from source; the following instructions have fairly tested as working on Ubuntu, and are extensively verified as not working on Mac. (Please see issue [#165](https://github.com/dropbox/pyston/issues/165) for discussion on enabling OSX support, which is pretty difficult.)
The build instructions assume that you will put the Pyston source code in `~/pyston` and put the dependencies in `~/pyston_deps`. Barring any bugs, you should be free to put them anywhere you'd like, though the instructions in this file would have to be altered before following. Also, if you want to change the dependency dir, you'll have to change the value of the the `DEPS_DIR` variable in `Makefile`.
The build instructions assume that you will put the Pyston source code in `~/pyston` and put the dependencies in `~/pyston_deps`. If you want to change the dependency dir, you'll have to change the value of the the `DEPS_DIR` variable in `CMakeLists.txt`.
# CMake build system
Our CMake build system supersedes our old Makefile build system. The old Makefile rules still exist and can be activated by adding `USE_CMAKE=0` to your make invocation, but they will be removed at some point. We still use the Makefile as a sort of "lite development environment"; it helps manage multiple cmake configurations and has some testing helpers.
We use a Makefile as a sort of "lite development environment"; it helps manage multiple cmake configurations and has some testing helpers.
### Prerequisites
......@@ -18,9 +18,14 @@ sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-de
```
**Ubuntu 14.04**
**Ubuntu 14.04/14.10/15.04**
```
sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-dev libreadline-dev libgmp3-dev autoconf libtool python-dev texlive-extra-utils clang-3.4 libssl-dev libsqlite3-dev pkg-config
sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-dev libreadline-dev libgmp3-dev autoconf libtool python-dev texlive-extra-utils clang libssl-dev libsqlite3-dev pkg-config
```
**Fedora 21**
```
sudo yum install cmake clang gcc gcc-c++ ccache ninja-build xz-devel automake libtool gmp-devel readline-devel openssl-devel sqlite-devel python-devel zlib-devel
```
### Building and testing
......@@ -54,6 +59,28 @@ See the main README for more information about available make targets and option
There are a number of optional dependencies that the build system knows about, but aren't strictly necessary for building and running Pyston. Most of them are related to developing and debugging:
### GCC 4.8.2
Pyston (and LLVM) requires a fairly modern [host compiler](http://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library), so you will have to compile a recent GCC if it's not already available for your system. The easiest thing to do is to just create a fresh build of GCC:
```
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev make build-essential libtool zip gcc-multilib autogen
cd ~/pyston_deps
wget http://ftpmirror.gnu.org/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
tar xvf gcc-4.8.2.tar.bz2
mkdir gcc-4.8.2-{build,install}
cd gcc-4.8.2-build
# Space- and time-saving configuration:
../gcc-4.8.2/configure --disable-bootstrap --enable-languages=c,c++ --prefix=$HOME/pyston_deps/gcc-4.8.2-install
# full configuration:
# ../gcc-4.8.2/configure --prefix=$HOME/pyston_deps/gcc-4.8.2-install
# Specifying LIBRARY_PATH is a workaround to get gcc to compile on newer Ubuntus with multiarch
LIBRARY_PATH=/usr/lib32 make -j4
make check
make install
```
### gdb
A modern gdb is highly recommended; users on Ubuntu 12.04 should definitely update:
......@@ -164,181 +191,8 @@ Then, run `make dbgpy_TESTNAME` and it will launch the test under gdb. There's
```
sudo apt-get install doxygen graphviz
# then run cmake (see below) and invoke the docs target
# then run cmake and invoke the docs target
ninja docs
# now within the Pyston build directory open docs/html/index.html with a browser
```
Generate doxygen documentation for Pyston. Requires using the cmake build system.
# Deprecated Makefile build system
These are the old instructions for our original Makefile build system and toolchain. They will be disappearing shortly.
### Prerequisites
GNU make is required to build pyston.
Start off by making the relevant directories:
```
mkdir ~/pyston_deps
git clone --recursive https://github.com/dropbox/pyston.git ~/pyston
```
### Compiler for clang
clang requires a fairly modern [host compiler](http://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library), so typically you will have to install a new one. The easiest thing to do is to just create a fresh build of GCC:
```
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev make build-essential libtool zip gcc-multilib autogen
cd ~/pyston_deps
wget http://ftpmirror.gnu.org/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
tar xvf gcc-4.8.2.tar.bz2
mkdir gcc-4.8.2-{build,install}
cd gcc-4.8.2-build
# Space- and time-saving configuration:
../gcc-4.8.2/configure --disable-bootstrap --enable-languages=c,c++ --prefix=$HOME/pyston_deps/gcc-4.8.2-install
# full configuration:
# ../gcc-4.8.2/configure --prefix=$HOME/pyston_deps/gcc-4.8.2-install
# Specifying LIBRARY_PATH is a workaround to get gcc to compile on newer Ubuntus with multiarch
LIBRARY_PATH=/usr/lib32 make -j4
make check
make install
```
### ccache
ccache is a build tool that can help speed up redundant compilations. It's not strictly necessary but it's useful enough to be enabled by default; you can disable it by adding `USE_CCACHE := 0` to your Makefile.local. To get it, run:
```
sudo apt-get install ccache
```
### LLVM dependencies
```
sudo apt-get install libncurses5-dev zlib1g-dev liblzma-dev
```
### LLVM + clang
LLVM and clang depend on a pretty modern compiler; the steps below assume you installed GCC 4.8.2 as described above. It should be possible to build using clang >= 3.1, such as what you might find on a Mac, but that will require changes to the way LLVM is configured (specified in Makefile) that I haven't tested.
```
cd ~/pyston_deps
git clone http://llvm.org/git/llvm.git llvm-trunk
git clone http://llvm.org/git/clang.git llvm-trunk/tools/clang
cd ~/pyston
make llvm_up
make llvm_configure
make llvm -j4
```
There seem to be some lingering issues with the LLVM build that haven't been identified yet; if the last step fails with errors along the lines of "rm: could not find file foo.tmp", it is quite likely that simply running it again will cause it to continue successfully. You may have to do this multiple times, unfortunately.
### libunwind
```
cd ~/pyston_deps
sudo apt-get install texlive-extra-utils autoconf
git clone git://git.sv.gnu.org/libunwind.git libunwind-trunk
mkdir libunwind-trunk-install
cd libunwind-trunk
git checkout 65ac867416
autoreconf -i
# disable shared libraries because we'll be installing this in a place that the loader can't find it:
./configure --prefix=$HOME/pyston_deps/libunwind-trunk-install --enable-shared=0
make -j4
make install
```
Note: if you followed the previous version of the directions and installed libunwind globally, you'll need to uninstall it by doing the following:
```
cd ~/pyston_deps/libunwind-1.1
./configure
sudo make uninstall
```
and then repeat the correct process
### zsh
`zsh` is needed when running pyston tests.
```
sudo apt-get install zsh
```
### readline
`readline` is used for the repl.
```
sudo apt-get install libreadline-dev
```
### gmp
`gmp` is a multiprecision library used for implementing Python longs. It's also a dependency of gcc, so if you installed that you should already have it:
```
sudo apt-get install libgmp3-dev
```
### libpypa
```
cd ~/pyston_deps
git clone git://github.com/vinzenz/pypa
mkdir pypa-install
cd pypa
./autogen.sh
./configure --prefix=$HOME/pyston_deps/pypa-install CXX=$HOME/pyston_deps/gcc-4.8.2-install/bin/g++
make -j4
make install
```
### libssl, libcrypto
```
sudo apt-get install libssl-dev
```
### gtest
For running the unittests:
```
cd ~/pyston_deps
wget https://googletest.googlecode.com/files/gtest-1.7.0.zip
unzip gtest-1.7.0.zip
cd gtest-1.7.0
./configure CXXFLAGS="-fno-omit-frame-pointer -isystem $HOME/pyston_deps/gcc-4.8.2-install/include/c++/4.8.2"
make -j4
```
### LZ4
```
cd ~/pyston_deps
git clone git://github.com/Cyan4973/lz4.git
mkdir lz4-install
cd lz4/lib
DESTDIR="$HOME/pyston_deps/lz4-install" PREFIX="/" make install
```
### Debug build of libunwind
Assuming you've already built the normal version above:
```
cd ~/pyston_deps
cp -rv libunwind-trunk libunwind-trunk-debug
mkdir libunwind-trunk-debug-install
cd libunwind-trunk-debug
CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=$HOME/pyston_deps/libunwind-trunk-debug-install --enable-shared=0 --enable-debug --enable-debug-frame
make -j4
make install
echo "USE_DEBUG_LIBUNWIND := 1" >> ~/pyston/Makefile.local
```
This will link pyston_dbg and pyston_debug against the debug version of libunwind (the release pyston build will still link against the release libunwind); to enable debug output, set the UNW_DEBUG_LEVEL environment variable, ex to 13.
......@@ -111,6 +111,7 @@ file(GLOB_RECURSE STDPARSER_SRCS Parser
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers -Wno-tautological-compare -Wno-type-limits -Wno-unused-result -Wno-strict-aliasing")
add_library(FROM_CPYTHON OBJECT ${STDMODULE_SRCS} ${STDOBJECT_SRCS} ${STDPYTHON_SRCS} ${STDPARSER_SRCS})
add_dependencies(FROM_CPYTHON copy_stdlib)
add_custom_command(OUTPUT
${CMAKE_BINARY_DIR}/lib_pyston/_multiprocessing.pyston.so
......
......@@ -94,8 +94,7 @@ struct _dictobject {
#endif
typedef struct {
PyObject_HEAD;
char _filler[48]; // gcc 4.8
// char _filler[56]; // gcc 4.9
char _filler[SIZEOF_UNORDEREDMAP];
} PyDictObject;
// Pyston change: these are no longer static objects:
......
......@@ -47,12 +47,9 @@
#define HAVE_ACOSH 1
#define HAVE_ADDRINFO 1
#define HAVE_ALARM 1
#define HAVE_ALLOCA_H 1
#define HAVE_ASINH 1
#define HAVE_ASM_TYPES_H 1
#define HAVE_ATANH 1
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
// #define HAVE_BLUETOOTH_BLUETOOTH_H 1
#define HAVE_C99_BOOL 1
#define HAVE_CHOWN 1
#define HAVE_CHROOT 1
......@@ -60,7 +57,6 @@
#define HAVE_CONFSTR 1
#define HAVE_COPYSIGN 1
#define HAVE_CTERMID 1
#define HAVE_CURSES_H 1
#define HAVE_CURSES_IS_TERM_RESIZED 1
#define HAVE_CURSES_RESIZE_TERM 1
#define HAVE_CURSES_RESIZETERM 1
......@@ -69,21 +65,17 @@
#define HAVE_DECL_ISNAN 1
#define HAVE_DEVICE_MACROS 1
#define HAVE_DEV_PTMX 1
#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
#define HAVE_DUP2 1
#define HAVE_DYNAMIC_LOADING 1
#define HAVE_EPOLL 1
#define HAVE_ERF 1
#define HAVE_ERFC 1
#define HAVE_ERRNO_H 1
#define HAVE_EXECV 1
#define HAVE_EXPM1 1
#define HAVE_FCHDIR 1
#define HAVE_FCHMOD 1
#define HAVE_FCHOWN 1
#define HAVE_FCNTL_H 1
#define HAVE_FDATASYNC 1
#define HAVE_FINITE 1
#define HAVE_FLOCK 1
......@@ -123,7 +115,6 @@
#define HAVE_GETSPNAM 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETWD 1
#define HAVE_GRP_H 1
#define HAVE_HSTRERROR 1
#define HAVE_HYPOT 1
#define HAVE_INET_ATON 1
......@@ -131,43 +122,32 @@
#define HAVE_INITGROUPS 1
#define HAVE_INT32_T 1
#define HAVE_INT64_T 1
#define HAVE_INTTYPES_H 1
#define HAVE_KILL 1
#define HAVE_KILLPG 1
#define HAVE_LANGINFO_H 1
#define HAVE_LCHOWN 1
#define HAVE_LGAMMA 1
#define HAVE_LIBDL 1
#define HAVE_LIBINTL_H 1
#define HAVE_LIBREADLINE 1
#define HAVE_LINK 1
#define HAVE_LINUX_NETLINK_H 1
#define HAVE_LINUX_TIPC_H 1
#define HAVE_LOG1P 1
#define HAVE_LONG_DOUBLE 1
#define HAVE_LONG_LONG 1
#define HAVE_LSTAT 1
#define HAVE_MAKEDEV 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMORY_H 1
#define HAVE_MKFIFO 1
#define HAVE_MKNOD 1
#define HAVE_MKTIME 1
#define HAVE_MMAP 1
#define HAVE_MREMAP 1
#define HAVE_NCURSES_H 1
#define HAVE_NETPACKET_PACKET_H 1
#define HAVE_NICE 1
// #define HAVE_OPENPTY 1 // pyston change: turned this off for now to avoid -lutil dependency
#define HAVE_PATHCONF 1
#define HAVE_PAUSE 1
#define HAVE_POLL 1
#define HAVE_POLL_H 1
#define HAVE_PROTOTYPES 1
#define HAVE_PTHREAD_ATFORK 1
#define HAVE_PTHREAD_H 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTY_H 1
#define HAVE_PUTENV 1
#define HAVE_READLINK 1
#define HAVE_REALPATH 1
......@@ -199,54 +179,28 @@
#define HAVE_SETSID 1
#define HAVE_SETUID 1
#define HAVE_SETVBUF 1
#define HAVE_SHADOW_H 1
#define HAVE_SIGACTION 1
#define HAVE_SIGINTERRUPT 1
#define HAVE_SIGNAL_H 1
#define HAVE_SIGRELSE 1
#define HAVE_SNPRINTF 1
#define HAVE_SOCKADDR_STORAGE 1
#define HAVE_SOCKETPAIR 1
#define HAVE_SPAWN_H 1
#define HAVE_SSIZE_T 1
#define HAVE_STAT_TV_NSEC 1
#define HAVE_STATVFS 1
#define HAVE_ST_BLOCKS 1
#define HAVE_STDARG_PROTOTYPES 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRDUP 1
#define HAVE_STRFTIME 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STROPTS_H 1
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_STRUCT_TM_TM_ZONE 1
#define HAVE_SYMLINK 1
#define HAVE_SYSCONF 1
#define HAVE_SYS_EPOLL_H 1
#define HAVE_SYSEXITS_H 1
#define HAVE_SYS_FILE_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_POLL_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_STATVFS_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_UN_H 1
#define HAVE_SYS_UTSNAME_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_TCGETPGRP 1
#define HAVE_TCSETPGRP 1
//#define HAVE_TEMPNAM 1 // pyston change: we have them but I dislike the compiler warnings they generate
#define HAVE_TERM_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TGAMMA 1
#define HAVE_TIMEGM 1
#define HAVE_TIMES 1
......@@ -259,16 +213,65 @@
#define HAVE_UINT64_T 1
#define HAVE_UINTPTR_T 1
#define HAVE_UNAME 1
#define HAVE_UNISTD_H 1
#define HAVE_UNSETENV 1
#define HAVE_UTIME_H 1
#define HAVE_UTIMES 1
#define HAVE_WAIT3 1
#define HAVE_WAIT4 1
#define HAVE_WAITPID 1
#define HAVE_WCHAR_H 1
#define HAVE_WCSCOLL 1
#define HAVE_WORKING_TZSET 1
#define HAVE_ZLIB_COPY 1
#cmakedefine HAVE_ALLOCA_H 1
#cmakedefine HAVE_ASM_TYPES_H 1
// #cmakedefine HAVE_BLUETOOTH_BLUETOOTH_H 1
#cmakedefine HAVE_CURSES_H 1
#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_ERRNO_H 1
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_GRP_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_LANGINFO_H 1
#cmakedefine HAVE_LIBINTL_H 1
#cmakedefine HAVE_LINUX_NETLINK_H 1
#cmakedefine HAVE_LINUX_TIPC_H 1
#cmakedefine HAVE_MEMORY_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NETPACKET_PACKET_H 1
#cmakedefine HAVE_POLL_H 1
#cmakedefine HAVE_PTHREAD_H 1
#cmakedefine HAVE_PTY_H 1
#cmakedefine HAVE_SHADOW_H 1
#cmakedefine HAVE_SIGNAL_H 1
#cmakedefine HAVE_SPAWN_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_STROPTS_H 1
#cmakedefine HAVE_SYS_EPOLL_H 1
#cmakedefine HAVE_SYSEXITS_H 1
#cmakedefine HAVE_SYS_FILE_H 1
#cmakedefine HAVE_SYS_PARAM_H 1
#cmakedefine HAVE_SYS_POLL_H 1
#cmakedefine HAVE_SYS_RESOURCE_H 1
#cmakedefine HAVE_SYS_SELECT_H 1
#cmakedefine HAVE_SYS_SOCKET_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_STATVFS_H 1
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine HAVE_SYS_TIMES_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_SYS_UTSNAME_H 1
#cmakedefine HAVE_SYS_WAIT_H 1
#cmakedefine HAVE_TERM_H 1
#cmakedefine HAVE_TERMIOS_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_UTIME_H 1
#cmakedefine HAVE_WCHAR_H 1
#define SIZEOF_UNORDEREDMAP @SIZEOF_UNORDEREDMAP@
#endif /*Py_PYCONFIG_H*/
......@@ -110,7 +110,7 @@ add_library(PYSTON_OBJECTS OBJECT ${OPTIONAL_SRCS}
runtime/util.cpp
)
add_dependencies(PYSTON_OBJECTS libunwind_patched libunwind pypa ${LLVM_LIBS})
add_dependencies(PYSTON_OBJECTS copy_stdlib libunwind_patched libunwind pypa ${LLVM_LIBS})
add_library(PYSTON_MAIN_OBJECT OBJECT jit.cpp)
add_dependencies(PYSTON_MAIN_OBJECT libunwind_patched libunwind pypa liblz4 ${LLVM_LIBS})
......
......@@ -9,7 +9,7 @@ add_custom_target(unittests)
macro(add_unittest unittest)
add_executable(${unittest}_unittest EXCLUDE_FROM_ALL ${unittest}.cpp $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON>)
target_link_libraries(${unittest}_unittest stdlib sqlite3 gmp ssl crypto readline pypa liblz4 double-conversion unwind gtest gtest_main ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
target_link_libraries(${unittest}_unittest stdlib z sqlite3 gmp ssl crypto readline pypa liblz4 double-conversion unwind gtest gtest_main ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
add_dependencies(unittests ${unittest}_unittest)
endmacro()
......
......@@ -17,6 +17,8 @@ elif which gold > /dev/null ; then
LD=gold
# FLAGS="--incremental --incremental-patch=10"
# RETRY=y
elif which ld.gold > /dev/null ; then
LD=ld.gold
else
echo "gold not available"
LD=ld
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment