Open ysstech opened 7 years ago
Use CMake instead:
mkdir build && cd build && cmake .. && make && make install
Library will be in build/build-src/libsigar.dylib
cmake it's work. but complie occur error:
8 warnings and 1 error generated. make[2]: [build-src/CMakeFiles/sigar.dir/os/darwin/darwin_sigar.c.o] Error 1 make[1]: [build-src/CMakeFiles/sigar.dir/all] Error 2
In file included from /Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:33: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/mach/mach_init.h:61: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/mach/mach_types.h:94: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/mach/thread_info.h:193:26: error: expected ';' at end of declaration list struct io_stat_entry disk_reads; ^ /Users/satan/Projects/Test/build/sigar/src/../include/sigar.h:482:24: note: expanded from macro 'disk_reads'
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:1392:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const char const thread_states[] = {
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3302:42: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'rpc_cnt_t ' (aka 'int ') [-Wincompatible-pointer-types]
map_nfs_stats((sigar_nfs_v3_t )nfs, &stats.rpccnt[0]);
^~~~
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3244:59: note: passing argument to parameter 'rpc' here
static void map_nfs_stats(sigar_nfs_v3_t nfs, rpc_cnt_t rpc)
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3328:42: warning: incompatible pointer types passing 'uint64_t ' (aka 'unsigned long long ') to parameter of type 'rpc_cnt_t ' (aka 'int ') [-Wincompatible-pointer-types]
map_nfs_stats((sigar_nfs_v3_t )nfs, &stats.srvrpccnt[0]);
^~~~~~~
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3244:59: note: passing argument to parameter 'rpc' here
static void map_nfs_stats(sigar_nfs_v3_t nfs, rpc_cnt_t rpc)
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3618:9: warning: 'Gestalt' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
if (Gestalt(gestaltSystemVersion, &version) == noErr) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
Gestalt(
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3618:17: warning: 'gestaltSystemVersion' is deprecated: first deprecated in OS X 10.8 - Use NSProcessInfo's operatingSystemVersion property instead. [-Wdeprecated-declarations]
if (Gestalt(gestaltSystemVersion, &version) == noErr) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:2076:3: note: 'gestaltSystemVersion' has been explicitly marked deprecated here
gestaltSystemVersion = 'sysv', / system version/
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3620:13: warning: 'Gestalt' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
Gestalt('sys1' /gestaltSystemVersionMajor/, &version_major);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
Gestalt(
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3621:13: warning: 'Gestalt' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
Gestalt('sys2' /gestaltSystemVersionMinor/, &version_minor);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
Gestalt(
^
/Users/satan/Projects/Test/build/sigar/src/os/darwin/darwin_sigar.c:3622:13: warning: 'Gestalt' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
Gestalt('sys3' /gestaltSystemVersionBugFix/, &version_fix);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
Gestalt(
^
You probably changed something in source code because before posting the solution, I checked and it worked ( besides warnings about "Gesalt" interface )
But I haven't modify anything,it's fork from sigar master.
I compiled fresh clone of repository from top of master branch (ad47dc3 Go sources update) on MacOS Sierra 10.12.2 using Apple LLVM version 8.0.0 (clang-800.0.42.1)
I clone of repository from branch ad47dc3,run command such as:
mkdir -p build/sigar && cp -rp deps/sigar/* build/sigar/ && cd build/sigar && ./autogen.sh && cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=false . && cmake --build . && make && make install && cd ../.. && node-gyp configure && node-gyp build
it's still not pass
(node:89934) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. CXX(target) Release/obj.target/sigar/src/node_sigar.o In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:9: ../src/./node_sigar_utils.cc:14:20: error: no member named 'New' in 'v8::String' return String::New(addr_str);
In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:86:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'? inline void CheckArguments(int min, const v8::Arguments& args) { ^~~~~~~~~~~~~ v8::internal::Arguments /Users/satan/.node-gyp/6.9.1/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:87:11: error: member access into incomplete type 'const v8::internal::Arguments' if (args.Length() < min) ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:147:7: note: forward declaration of 'v8::internal::Arguments' class Arguments; ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:88:38: error: 'New' is a private member of 'v8::PersistentBase<v8::Value>' throw v8::Persistent<v8::Value>::New(v8::Exception::RangeError(v8::String::New("Not enough arguments."))); ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:669:23: note: declared private here V8_INLINE static T* New(Isolate* isolate, T* that); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:88:80: error: no member named 'New' in 'v8::String' throw v8::Persistent<v8::Value>::New(v8::Exception::RangeError(v8::String::New("Not enough arguments."))); ~~~~~~~~~~~~^ ../src/v8u.hpp:293:34: error: too few arguments to function call, expected 2, have 1 return v8::Integer::New(integer); ~~~~~~~~~~~~~~~~ ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:2558:3: note: 'New' declared here static Local<Integer> New(Isolate* isolate, int32_t value); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:297:46: error: too few arguments to function call, expected 2, have 1 return v8::Integer::NewFromUnsigned(integer); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:2559:3: note: 'NewFromUnsigned' declared here static Local<Integer> NewFromUnsigned(Isolate* isolate, uint32_t value); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:301:22: error: no member named 'New' in 'v8::String' return v8::String::New(data, length); ~~~~~~~~~~~~^ ../src/v8u.hpp:305:22: error: no member named 'New' in 'v8::String' return v8::String::New(str.data(), str.length()); ~~~~~~~~~~~~^ ../src/v8u.hpp:309:22: error: no member named 'NewSymbol' in 'v8::String' return v8::String::NewSymbol(data, length); ~~~~~~~~~~~~^ ../src/v8u.hpp:313:26: error: too few arguments to function call, single argument 'isolate' was not specified return v8::Object::New(); ~~~~~~~~~~~~~~~ ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:3006:3: note: 'New' declared here static Local<Object> New(Isolate* isolate); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:317:25: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'int' return v8::Array::New(length); ^~~~~~ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:3039:36: note: passing argument to parameter 'isolate' here static Local<Array> New(Isolate* isolate, int length = 0); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:325:1: error: no member named 'New' in 'v8::String' __V8_ERROR_CTOR() ^~~~~~~~~~~~~~~~~ ../src/v8u.hpp:322:50: note: expanded from macro '__V8_ERROR_CTOR' return v8::Exception::ERROR##Error(v8::String::New(msg)); \ ~~~~~~~~~~~~^ ../src/v8u.hpp:326:1: error: no member named 'New' in 'v8::String' __V8_ERROR_CTOR(Range) ^~~~~~~~~~~~~~~~~~~~~~ ../src/v8u.hpp:322:50: note: expanded from macro '__V8_ERROR_CTOR' return v8::Exception::ERROR##Error(v8::String::New(msg)); \ ~~~~~~~~~~~~^ ../src/v8u.hpp:327:1: error: no member named 'New' in 'v8::String' __V8_ERROR_CTOR(Reference) ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/v8u.hpp:322:50: note: expanded from macro '__V8_ERROR_CTOR' return v8::Exception::ERROR##Error(v8::String::New(msg)); \ ~~~~~~~~~~~~^ ../src/v8u.hpp:328:1: error: no member named 'New' in 'v8::String' __V8_ERROR_CTOR(Syntax) ^~~~~~~~~~~~~~~~~~~~~~~ ../src/v8u.hpp:322:50: note: expanded from macro '__V8_ERROR_CTOR' return v8::Exception::ERROR##Error(v8::String::New(msg)); \ ~~~~~~~~~~~~^ ../src/v8u.hpp:329:1: error: no member named 'New' in 'v8::String' __V8_ERROR_CTOR(Type) ^~~~~~~~~~~~~~~~~~~~~ ../src/v8u.hpp:322:50: note: expanded from macro '__V8_ERROR_CTOR' return v8::Exception::ERROR##Error(v8::String::New(msg)); \ ~~~~~~~~~~~~^ ../src/v8u.hpp:332:32: error: too few arguments to function call, expected 2, have 1 return v8::Number::New(number); ~~~~~~~~~~~~~~~ ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:2545:3: note: 'New' declared here static Local<Number> New(Isolate* isolate, double value); ^ In file included from ../src/node_sigar.cc:2: In file included from ../src/node_sigar.h:11: ../src/v8u.hpp:336:34: error: too few arguments to function call, expected 2, have 1 return v8::Boolean::New(boolean); ~~~~~~~~~~~~~~~~ ^ /Users/satan/.node-gyp/6.9.1/include/node/v8.h:8000:1: note: 'New' declared here Local<Boolean> Boolean::New(Isolate* isolate, bool value) { ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make: *** [Release/obj.target/sigar/src/node_sigar.o] Error 1
./autogen.sh && make && make install *** No targets specified and no makefile found. Stop.
how issues?