using PETSc in gfortran, but it didn't compile - gfortran

I want to test and use PESTc in fortran, so I wrote something very simple and null like (petscexe.F):
PROGRAM petscexe
INCLUDE 'petscsys.h'
END PROGRAM petscexe
to see if the header file can be correctly imported.
I compile the file with gfortran:
gfortran petscexe.F -I /opt/local/lib/petsc/include/finclude
the header file is located in this folder (/opt/local/lib/petsc/include/finclude) in my computer. So everything should be fine, but...
The error is
Warning: petscsys.h:5: Illegal preprocessor directive
Warning: petscsys.h:6: Illegal preprocessor directive
Warning: petscsys.h:7: Illegal preprocessor directive
Warning: petscsys.h:9: Illegal preprocessor directive
Warning: petscsys.h:10: Illegal preprocessor directive
Warning: petscsys.h:11: Illegal preprocessor directive
Warning: petscsys.h:20: Illegal preprocessor directive
Warning: petscsys.h:22: Illegal preprocessor directive
Warning: petscsys.h:24: Illegal preprocessor directive
Warning: petscsys.h:87: Illegal preprocessor directive
Warning: petscsys.h:88: Illegal preprocessor directive
Warning: petscsys.h:89: Illegal preprocessor directive
Warning: petscsys.h:90: Illegal preprocessor directive
Warning: petscsys.h:91: Illegal preprocessor directive
Warning: petscsys.h:92: Illegal preprocessor directive
Warning: petscsys.h:93: Illegal preprocessor directive
Warning: petscsys.h:94: Illegal preprocessor directive
Warning: petscsys.h:119: Illegal preprocessor directive
Warning: petscsys.h:121: Illegal preprocessor directive
Warning: petscsys.h:123: Illegal preprocessor directive
Warning: petscsys.h:139: Illegal preprocessor directive
Warning: petscsys.h:143: Illegal preprocessor directive
Warning: petscsys.h:147: Illegal preprocessor directive
Warning: petscsys.h:153: Illegal preprocessor directive
Warning: petscsys.h:154: Illegal preprocessor directive
Warning: petscsys.h:156: Illegal preprocessor directive
Warning: petscsys.h:158: Illegal preprocessor directive
Warning: petscsys.h:159: Illegal preprocessor directive
Warning: petscsys.h:160: Illegal preprocessor directive
Warning: petscsys.h:162: Illegal preprocessor directive
Warning: petscsys.h:164: Illegal preprocessor directive
Warning: petscsys.h:165: Illegal preprocessor directive
Warning: petscsys.h:168: Illegal preprocessor directive
Warning: petscsys.h:170: Illegal preprocessor directive
Warning: petscsys.h:172: Illegal preprocessor directive
Warning: petscsys.h:234: Illegal preprocessor directive
Warning: petscsys.h:235: Illegal preprocessor directive
Warning: petscsys.h:236: Illegal preprocessor directive
Warning: petscsys.h:252: Illegal preprocessor directive
Warning: petscsys.h:254: Illegal preprocessor directive
Warning: petscsys.h:256: Illegal preprocessor directive
petscsys.h:18.6:
Included at petscexe.F:2:
PetscBool PETSC_TRUE
1
Error: Unclassifiable statement at (1)
petscsys.h:19.6:
Included at petscexe.F:2:
PetscBool PETSC_FALSE
1
Error: Unclassifiable statement at (1)
petscsys.h:23.29:
Included at petscexe.F:2:
parameter (PETSC_TRUE = .true.,PETSC_FALSE = .false.)
1
Error: Can't convert LOGICAL(4) to REAL(4) at (1)
petscsys.h:25.6:
Included at petscexe.F:2:
PetscInt PETSC_DECIDE,PETSC_DETERMINE
1
Error: Unclassifiable statement at (1)
petscsys.h:28.6:
Included at petscexe.F:2:
PetscInt PETSC_DEFAULT_INTEGER
1
Error: Unclassifiable statement at (1)
petscsys.h:31.6:
Included at petscexe.F:2:
PetscFortranDouble PETSC_DEFAULT_DOUBLE_PRECISION
1
Error: Unclassifiable statement at (1)
petscsys.h:34.6:
Included at petscexe.F:2:
PetscEnum PETSC_FP_TRAP_OFF
1
Error: Unclassifiable statement at (1)
petscsys.h:35.6:
Included at petscexe.F:2:
PetscEnum PETSC_FP_TRAP_ON
1
Error: Unclassifiable statement at (1)
petscsys.h:43.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_DRAW_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:44.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_DRAW_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:45.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_SOCKET_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:46.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_SOCKET_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:47.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_STDOUT_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:48.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_STDOUT_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:49.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_STDERR_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:50.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_STDERR_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:51.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_BINARY_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:52.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_BINARY_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:53.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_MATLAB_WORLD
1
Error: Unclassifiable statement at (1)
petscsys.h:54.6:
Included at petscexe.F:2:
PetscFortranAddr PETSC_VIEWER_MATLAB_SELF
1
Error: Unclassifiable statement at (1)
petscsys.h:75.6:
Included at petscexe.F:2:
PetscEnum PETSC_INT
1
Error: Unclassifiable statement at (1)
petscsys.h:76.6:
Included at petscexe.F:2:
PetscEnum PETSC_DOUBLE
1
Error: Unclassifiable statement at (1)
petscsys.h:77.6:
Included at petscexe.F:2:
PetscEnum PETSC_COMPLEX
1
Error: Unclassifiable statement at (1)
petscsys.h:78.6:
Included at petscexe.F:2:
PetscEnum PETSC_LONG
1
Error: Unclassifiable statement at (1)
petscsys.h:79.6:
Included at petscexe.F:2:
PetscEnum PETSC_SHORT
1
Error: Unclassifiable statement at (1)
Fatal Error: Error count reached limit of 25.
What is this error? Thanks a lot!

You have to use -cpp -dM as necessary flags when doing compilation. Besides, you have to use C++/C style, i.e., #include + ..., for the including .

Related

When running flutter app on iOS real device getting below errors. working fine in android and iOS simulator

/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R instead
return try data.withUnsafeBytes { (bytes:UnsafePointer) -> Data in
^
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:29: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:33: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
/fullpath.../ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
Command CompileSwift failed with a nonzero exit code
While building module 'AVFoundation' imported from /fullpath.../flutter/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/ios/Classes/FLTVideoPlayerPlugin.m:6:
In file included from <module-includes>:1:
/Volumes/MyData/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:15:9: fatal error: 'AVFCore/AVFCore.h' file not found #import <AVFCore/AVFCore.h>
1 error generated.
/Volumes/MyData/Flutter_Data/flutter/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/ios/Classes/FLTVideoPlayerPlugin.m:6:9: fatal error: could not build module 'AVFoundation'
#import <AVFoundation/AVFoundation.h>
2 errors generated.
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Unsupported architecture error on initializing React Native app

It's so weird, yesterday morning everything works well, but after trying to install on a physical iOS device, I even cannot initiate a React Native project, right after the npx react-native init MyNewApp command I get this error:
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/lib/libc++.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/lib/libc++.tbd (4 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/lib/libSystem.tbd (4 slices)
clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:52:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv/errno.h:25:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/errno.h:31:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/errno.h:23:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/errno.h:72:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'; did you mean
'__int128_t'?
typedef __int64_t __darwin_blkcnt_t; /* total blocks */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean
'__int128_t'?
typedef __int32_t __darwin_blksize_t; /* preferred block size */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean
'__int128_t'?
typedef __int32_t __darwin_dev_t; /* dev_t */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean
'__uint128_t'?
typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean
'__uint128_t'?
typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'; did you mean
'__int128_t'?
typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean
'__int128_t'?
typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_sigset_t; /* [???] signal set */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean
'__int128_t'?
typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */
^
note: '__int128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_uid_t; /* [???] user IDs */
^
note: '__uint128_t' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:71:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean
'__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:75:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types/_va_list.h:31:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:55:
In file included from /Users/amerllica/Library/Caches/node-gyp/12.18.0/include/node/uv.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/stdio.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/_stdio.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/_types/_va_list.h:32:9: error: unknown type name
'__darwin_va_list'
typedef __darwin_va_list va_list;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/amerllica/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/Users/amerllica/.nvm/versions/node/v12.18.0/bin/node" "/Users/amerllica/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/amerllica/.npm/_npx/15892/lib/node_modules/react-native/node_modules/fsevents
gyp ERR! node -v v12.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
I tried many ways, even I uninstall XCode and then re-install XCode. set everything from scratch but I get this error for initializing React Native application.
With the following steps everything back on track:
Logging out
Restarting
It's so weird, but fully shut down the system without keeping open programs states was the solution.

Error trying to install rinku gem on mac

I'm having trouble installing the rinku gem version '1.7.3' on Mavericks. I followed the advice of another post that suggested to install apple-gcc42 but that didn't help. I've also tried searching google and stack overflow but couldn't find this exact issue. Here is the error:
Building native extensions. This could take a while...
ERROR: Error installing rinku:
ERROR: Failed to build gem native extension.
/Users/home/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before 'uint8_t'
In file included from autolink.c:18:
autolink.h:31: warning: type defaults to 'int' in declaration of 'uint8_t'
autolink.h:31: error: expected ';', ',' or ')' before '*' token
autolink.h:35: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:39: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:43: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: warning: type defaults to 'int' in declaration of 'uint8_t'
... Had to leave out some of the error because it won't let me post this without a lower code to text ratio.
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c: In function 'sd_autolink__url':
autolink.c:263: error: 'data' undeclared (first use in this function)
autolink.c:266: warning: implicit declaration of function 'isalpha'
autolink.c:269: warning: implicit declaration of function 'sd_autolink_issafe'
autolink.c:272: warning: incompatible implicit declaration of built-in function 'strlen'
make: *** [autolink.o] Error 1
make failed, exit code 2
this ended up fixing it for 1.9.3
xcode-select --install

using clang compile ffmpeg with too much warning on osx

I use clang to compile ffmpeg, It reports too much warn
./libavutil/arm/intmath.h:102:40: warning: value size does not match register size specified by the constraint and modifier
[-Wasm-operand-widths]
./libavutil/arm/intmath.h:102:40: warning: value size does not match register size specified by the constraint and modifier
[-Wasm-operand-widths]
and finally stop with error
libavcodec/arm/mlpdsp_armv5te.S:5180:9: error: unknown directive
.hword (75f - 0b) / 2
^
libavcodec/arm/mlpdsp_armv5te.S:5182:9: error: unknown directive
.hword (76f - 0b) / 2
^
libavcodec/arm/mlpdsp_armv5te.S:5184:9: error: unknown directive
.hword (77f - 0b) / 2
^
libavcodec/arm/mlpdsp_armv5te.S:5186:9: error: unknown directive
.hword (78f - 0b) / 2
^
libavcodec/arm/mlpdsp_armv5te.S:5648:9: error: unknown directive
Is there anyone met the same problem?

Error compiling tweak in theos

I set a simple tweak using theos following the tutorial here. However when I run make with the headers from here, I get
Making all for tweak WelcomeWagon...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from Tweak.xm:1:
/opt/theos//include/SpringBoard/SpringBoard.h:7:26: error: UIApplication.h: No such file or directory
cc1objplus: warnings being treated as errors
In file included from /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:7,
from /opt/theos//include/SpringBoard/SpringBoard.h:9,
from Tweak.xm:1:
/opt/theos//include/SpringBoard/NSObject-Protocol.h:7: warning: duplicate declaration for protocol ‘NSObject’
In file included from /opt/theos//include/SpringBoard/SpringBoard.h:9,
from Tweak.xm:1:
/opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:11: warning: duplicate declaration for protocol ‘UIApplicationDelegate’
/opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:35: error: duplicate property declaration ‘window’
make[2]: *** [obj/Tweak.xm.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [WelcomeWagon.all.tweak.variables] Error 2
After some searching around I also found that some people were using Ryan Petrich's dumped headers, so I emptied the include folder and put his headers in and ran make, with this as the output
Making all for tweak WelcomeWagon...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurface.h:20:36: error: IOSurface/IOSurfaceAPI.h: No such file or directory
In file included from /opt/theos//include/IOSurface/IOSurface.h:21,
from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: ‘IOSurfaceRef’ has not been declared
/opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: ‘IOSurfaceRef’ has not been declared
In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurface.h:27: error: variable or field ‘IOSurfaceFlushProcessorCaches’ declared void
/opt/theos//include/IOSurface/IOSurface.h:27: error: ‘IOSurfaceRef’ was not declared in this scope
In file included from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/QuartzCore/QuartzCore-Structs.h:196: error: ‘IOSurfaceRef’ does not name a type
In file included from /opt/theos//include/UIKit/UIKit2.h:52,
from /opt/theos//include/MessageUI/MessageUI-Structs.h:8,
from /opt/theos//include/MessageUI/ComposeRecipient.h:9,
from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6,
from /opt/theos//include/ChatKit/ChatKit.h:41,
from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13,
from /opt/theos//include/SpringBoard/SpringBoard.h:8,
from Tweak.xm:1:
/opt/theos//include/UIKit/UIImage2.h:85: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:85: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:85: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIImage2.h:86: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:86: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:86: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIImage2.h:91: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:91: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:91: error: expected `;' before ‘)’ token
In file included from /opt/theos//include/UIKit/UIKit2.h:448,
from /opt/theos//include/MessageUI/MessageUI-Structs.h:8,
from /opt/theos//include/MessageUI/ComposeRecipient.h:9,
from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6,
from /opt/theos//include/ChatKit/ChatKit.h:41,
from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13,
from /opt/theos//include/SpringBoard/SpringBoard.h:8,
from Tweak.xm:1:
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected `;' before ‘)’ token
make[2]: *** [obj/Tweak.xm.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [WelcomeWagon.all.tweak.variables] Error 2
Could anyone tell me what I'm doing wrong? Thanks in advance.
I found the same problem with current version of Ryan Petrich's dumped headers today.
Finally I find out that the solution is,
Import the dumped Springboard headers
Copy /System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h to /opt/theos/include/IOSurface. The reason is in IOSurface/IOSurface.h!
If you are running OS X Lion or later, you may need to comment out the following lines in /opt/theos/include/IOSurface/IOSurfaceAPI.h:
/* This call lets you get an xpcobject_t that holds a reference to the IOSurface.
Note: Any live XPC objects created from an IOSurfaceRef implicity increase the IOSurface's global use
count by one until the object is destroyed. */
// xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
/* This call lets you take an xpcobject_t created via IOSurfaceCreatePort() and recreate an IOSurfaceRef from it. */
// IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
Give it a try!
I just did this today 02/13/2013 and found the above to be somewhat helpful. With a little brains and the help of Google I found that what you need to do is :
1.) Get the headers - use a Google search for "Ryan Petrich's dumped headers" which will lead you to :https://github.com/rpetrich/iphoneheaders
2.) Use git to clone the repo : git clone https://github.com/rpetrich/iphoneheaders
3.) run make ( I found that I needed to run make as sudo make due to the location of theos being installed under /opt. )
4.) For each "error file not found" I copied the include files into my project.
5.) I believe you should end up with the following folders in your project folder :
AccountSettings IOKit SpringBoard
ActorKit IOSurface TelephonyUI
AppSupport JavaScriptCore Tutorial.plist
Availability2.h MIME Tweak.xm
ChatKit Makefile Tweak.xm.original
CoreFoundation MediaPlayer UIKit
CoreGraphics Message WebCore
DAVKit MessageUI WebKit
DataAccess MusicLibrary control
Foundation PhotoLibrary obj
GraphicsServices QuartzCore theos
6.) You need to do #2 from the answer above "Copy /System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h to /opt/theos/include/IOSurface. The reason is in IOSurface/IOSurface.h!"
7.) You also need to make the edit from the answer above "If you are running OS X Lion, you may need to comment out the following lines in /opt/theos/include/IOSurface/IOSurfaceAPI.h:"
/* This call lets you get an xpcobject_t that holds a reference to the IOSurface.
Note: Any live XPC objects created from an IOSurfaceRef implicity increase the IOSurface's global use
count by one until the object is destroyed. */
// xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
/* This call lets you take an xpcobject_t created via IOSurfaceCreatePort() and recreate an IOSurfaceRef from it. */
// IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
FYI in my IOSurfaceAPI.h these were lines around line number 252/253
You don't need to import the dumped Springboard headers.

Resources