folly icon indicating copy to clipboard operation
folly copied to clipboard

[MacOS]F'TARGET_OS_SIMULATOR' is not defined, evaluates to 0.

Open CPWstatic opened this issue 2 years ago • 1 comments

Failed to compile on version v2022.03.14.00. How can i solve this problem?

FAILED: CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o
/usr/local/opt/llvm/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_LOCALE -DFOLLY_XLOG_STRIP_PREFIXES=\"/Users/chenpengwei/Documents/project-souce-code/velox/folly:/Users/chenpengwei/Documents/project-souce-code/velox/folly/_build\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/Users/chenpengwei/Documents/project-souce-code/velox/folly -I/Users/chenpengwei/Documents/project-souce-code/velox/folly/_build -I/usr/local/include -I/usr/local/opt/[email protected]/include -mcpu=apple-m1+crc -std=c++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk -fPIC -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type -Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new -fopenmp -std=gnu++17 -MD -MT CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o -MF CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o.d -o CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o -c /Users/chenpengwei/Documents/project-souce-code/velox/folly/folly/ClockGettimeWrappers.cpp
clang-14: warning: argument unused during compilation: '-mcpu=apple-m1+crc' [-Wunused-command-line-argument]
In file included from /Users/chenpengwei/Documents/project-souce-code/velox/folly/folly/ClockGettimeWrappers.cpp:17:
In file included from /Users/chenpengwei/Documents/project-souce-code/velox/folly/folly/ClockGettimeWrappers.h:19:
In file included from /Users/chenpengwei/Documents/project-souce-code/velox/folly/folly/portability/Time.h:22:
In file included from /Users/chenpengwei/Documents/project-souce-code/velox/folly/folly/portability/Config.h:20:
/Users/chenpengwei/Documents/project-souce-code/velox/folly/_build/folly/folly-config.h:22:34: error: 'TARGET_OS_SIMULATOR' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
     (TARGET_IPHONE_SIMULATOR || TARGET_OS_SIMULATOR || TARGET_OS_IPHONE))
                                 ^
/Users/chenpengwei/Documents/project-souce-code/velox/folly/_build/folly/folly-config.h:22:57: error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
     (TARGET_IPHONE_SIMULATOR || TARGET_OS_SIMULATOR || TARGET_OS_IPHONE))
                                                        ^
2 errors generated.

Failed to compile on version

CPWstatic avatar Jul 14 '22 03:07 CPWstatic

I expect you may run into other issues since velox seems to believe you're on an m1 mac, but is trying to build Folly as x86_64, but I'll put up a diff that should resolve at least this specific error.

Including TargetConditionals.h in folly-config.h should resolve this.

Orvid avatar Jul 15 '22 21:07 Orvid

This is still showing up on my Mac M1 as of 9/28/22. I'll try to see if the TargetConditionals.h are included in folly-config.h but I simply followed the instructions from https://github.com/facebookincubator/velox and run into this issue.

drabastomek avatar Sep 28 '22 22:09 drabastomek