Re: CPython compiled failed in macOS
You may need to clean your source tree. "make distclean" or "git clean -fx". 2019年5月22日(水) 13:34 Windson Yang : > > version: macOS 10.14.4, Apple LLVM version 10.0.1 (clang-1001.0.46.4). > > I cloned the CPython source code from GitHub then compiled it which used to > work quite well. However, I messed up my terminal a few days ago for > installing gdb. Now when I try to compile the latest CPython source code > with ./configure --with-pydebug && make -j I always get the error messages: > > ld: warning: ld: warning: ignoring file libpython3.8d.a, file was > built for archive which is not the architecture being linked (x86_64): > libpython3.8d.aignoring file libpython3.8d.a, file was built for > archive which is not the architecture being linked (x86_64): > libpython3.8d.a > Undefined symbols for architecture x86_64: > "__Py_UnixMain", referenced from: > _main in python.o > ld: symbol(s) not found for architecture x86_64Undefined symbols for > architecture x86_64: > "_PyEval_InitThreads", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > "_PyEval_ReleaseThread", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > "_PyEval_RestoreThread", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > _test_bpo20891 in _testembed.o > "_PyEval_SaveThread", referenced from: > _test_bpo20891 in _testembed.o > "_PyGILState_Check", referenced from: > _bpo20891_thread in _testembed.o > "_PyGILState_Ensure", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > _bpo20891_thread in _testembed.o > "_PyGILState_Release", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > _bpo20891_thread in _testembed.o > "_PyInterpreterState_GetID", referenced from: > _print_subinterp in _testembed.o > "_PyMem_RawFree", referenced from: > _test_pre_initialization_api in _testembed.o > "_PyRun_SimpleStringFlags", referenced from: > _test_pre_initialization_api in _testembed.o > _test_pre_initialization_sys_options in _testembed.o > _test_init_main in _testembed.o > _check_stdio_details in _testembed.o > _print_subinterp in _testembed.o > _dump_config in _testembed.o > "_PySys_AddWarnOption", referenced from: > _test_pre_initialization_sys_options in _testembed.o > "_PySys_AddXOption", referenced from: > _test_pre_initialization_sys_options in _testembed.o > "_PySys_ResetWarnOptions", referenced from: > _test_pre_initialization_sys_options in _testembed.o > "_PyThreadState_Get", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > _print_subinterp in _testembed.o > "_PyThreadState_Swap", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > "_PyThread_acquire_lock", referenced from: > _test_bpo20891 in _testembed.o > "_PyThread_allocate_lock", referenced from: > _test_bpo20891 in _testembed.o > "_PyThread_exit_thread", referenced from: > _bpo20891_thread in _testembed.o > "_PyThread_free_lock", referenced from: > _test_bpo20891 in _testembed.o > "_PyThread_release_lock", referenced from: > _bpo20891_thread in _testembed.o > "_PyThread_start_new_thread", referenced from: > _test_bpo20891 in _testembed.o > "_Py_BytesWarningFlag", referenced from: > _test_init_global_config in _testembed.o > _test_init_from_config in _testembed.o > _set_all_global_config_variables in _testembed.o > "_Py_DebugFlag", referenced from: > _set_all_global_config_variables in _testembed.o > "_Py_DecodeLocale", referenced from: > _test_pre_initialization_api in _testembed.o > "_Py_DontWriteBytecodeFlag", referenced from: > _test_init_global_config in _testembed.o > _test_init_from_config in _testembed.o > _set_all_global_config_variables in _testembed.o > _check_init_python_config in _testembed.o > "_Py_EndInterpreter", referenced from: > _test_repeated_init_and_subinterpreters in _testembed.o > "_Py_Finalize", referenced from: > _test_forced_io_encoding in _testembed.o > _test_repeated_init_and_subinterpreters in _testembed.o > _test_pre_initialization_api in _testembed.o > _test_pre_initialization_sys_options in _testembed.o > _test_initialize_twice in _testembed.o > _test_initialize_pymain in _testembed.o > _test_init_default_config in _testembed.o > ... > "_Py_FrozenFlag", referenced from: > _test_init_global_config in _testembed.o > _test_init_from_config in _testembed.o > _set_all_global_config_variables in _testembed.o > _check_init_python_config in _testembed.o > "_Py_IgnoreEnvironmentFlag", referenced from: > _test_init_env in _testembed.o > _test_init_env_dev_mode in _testembed.o >
CPython compiled failed in macOS
version: macOS 10.14.4, Apple LLVM version 10.0.1 (clang-1001.0.46.4). I cloned the CPython source code from GitHub then compiled it which used to work quite well. However, I messed up my terminal a few days ago for installing gdb. Now when I try to compile the latest CPython source code with ./configure --with-pydebug && make -j I always get the error messages: ld: warning: ld: warning: ignoring file libpython3.8d.a, file was built for archive which is not the architecture being linked (x86_64): libpython3.8d.aignoring file libpython3.8d.a, file was built for archive which is not the architecture being linked (x86_64): libpython3.8d.a Undefined symbols for architecture x86_64: "__Py_UnixMain", referenced from: _main in python.o ld: symbol(s) not found for architecture x86_64Undefined symbols for architecture x86_64: "_PyEval_InitThreads", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o "_PyEval_ReleaseThread", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o "_PyEval_RestoreThread", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o _test_bpo20891 in _testembed.o "_PyEval_SaveThread", referenced from: _test_bpo20891 in _testembed.o "_PyGILState_Check", referenced from: _bpo20891_thread in _testembed.o "_PyGILState_Ensure", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o _bpo20891_thread in _testembed.o "_PyGILState_Release", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o _bpo20891_thread in _testembed.o "_PyInterpreterState_GetID", referenced from: _print_subinterp in _testembed.o "_PyMem_RawFree", referenced from: _test_pre_initialization_api in _testembed.o "_PyRun_SimpleStringFlags", referenced from: _test_pre_initialization_api in _testembed.o _test_pre_initialization_sys_options in _testembed.o _test_init_main in _testembed.o _check_stdio_details in _testembed.o _print_subinterp in _testembed.o _dump_config in _testembed.o "_PySys_AddWarnOption", referenced from: _test_pre_initialization_sys_options in _testembed.o "_PySys_AddXOption", referenced from: _test_pre_initialization_sys_options in _testembed.o "_PySys_ResetWarnOptions", referenced from: _test_pre_initialization_sys_options in _testembed.o "_PyThreadState_Get", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o _print_subinterp in _testembed.o "_PyThreadState_Swap", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o "_PyThread_acquire_lock", referenced from: _test_bpo20891 in _testembed.o "_PyThread_allocate_lock", referenced from: _test_bpo20891 in _testembed.o "_PyThread_exit_thread", referenced from: _bpo20891_thread in _testembed.o "_PyThread_free_lock", referenced from: _test_bpo20891 in _testembed.o "_PyThread_release_lock", referenced from: _bpo20891_thread in _testembed.o "_PyThread_start_new_thread", referenced from: _test_bpo20891 in _testembed.o "_Py_BytesWarningFlag", referenced from: _test_init_global_config in _testembed.o _test_init_from_config in _testembed.o _set_all_global_config_variables in _testembed.o "_Py_DebugFlag", referenced from: _set_all_global_config_variables in _testembed.o "_Py_DecodeLocale", referenced from: _test_pre_initialization_api in _testembed.o "_Py_DontWriteBytecodeFlag", referenced from: _test_init_global_config in _testembed.o _test_init_from_config in _testembed.o _set_all_global_config_variables in _testembed.o _check_init_python_config in _testembed.o "_Py_EndInterpreter", referenced from: _test_repeated_init_and_subinterpreters in _testembed.o "_Py_Finalize", referenced from: _test_forced_io_encoding in _testembed.o _test_repeated_init_and_subinterpreters in _testembed.o _test_pre_initialization_api in _testembed.o _test_pre_initialization_sys_options in _testembed.o _test_initialize_twice in _testembed.o _test_initialize_pymain in _testembed.o _test_init_default_config in _testembed.o ... "_Py_FrozenFlag", referenced from: _test_init_global_config in _testembed.o _test_init_from_config in _testembed.o _set_all_global_config_variables in _testembed.o _check_init_python_config in _testembed.o "_Py_IgnoreEnvironmentFlag", referenced from: _test_init_env in _testembed.o _test_init_env_dev_mode in _testembed.o _test_init_env_dev_mode_alloc in _testembed.o _set_all_global_config_variables in _testembed.o _check_init_python_config in _testembed.o "_Py_Initialize", referenced from: _test_forced_io_encoding in _testembed.o _test_pre_initialization_api in _testembed.o _test_initialize_twice in _testembed.o