make: *** [Makefile:223: v8js_array_access.lo] Error 1 - v8

I followed this link to compile v8 and v8js but when I executed make to compile v8js it showed this log and this error:
/bin/bash /tmp/v8js/libtool --mode=compile g++ -I. -I/tmp/v8js -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/opt/v8/include -I/opt/v8 -DV8_COMPRESS_POINTERS -DHAVE_CONFIG_H -g -O2 -Wno-narrowing -std=c++14 -c /tmp/v8js/v8js_array_access.cc -o v8js_array_access.lo
libtool: compile: g++ -I. -I/tmp/v8js -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/opt/v8/include -I/opt/v8 -DV8_COMPRESS_POINTERS -DHAVE_CONFIG_H -g -O2 -Wno-narrowing -std=c++14 -c /tmp/v8js/v8js_array_access.cc -fPIC -DPIC -o .libs/v8js_array_access.o
In file included from /usr/include/dirent.h:245,
from /usr/include/php/20200930/Zend/zend_virtual_cwd.h:89,
from /usr/include/php/20200930/main/php.h:437,
from /tmp/v8js/php_v8js_macros.h:45,
from /tmp/v8js/v8js_array_access.cc:17:
/tmp/v8js/v8js_class.h: In function ‘v8js_ctx* v8js_ctx_fetch_object(zend_object*)’:
/tmp/v8js/v8js_class.h:83:54: warning: ‘offsetof’ within non-standard-layout type ‘v8js_ctx’ is conditionally-supported [-Winvalid-offsetof]
83 | return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std));
/tmp/v8js/v8js_class.h:83:43: note: in expansion of macro ‘XtOffsetOf’
83 | return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std));
| ^~~~~~~~~~
/tmp/v8js/v8js_array_access.cc: In function ‘zval v8js_array_access_dispatch(zend_object*, const char*, int, uint32_t, zval)’:
/tmp/v8js/v8js_array_access.cc:53:6: error: ‘zend_fcall_info’ {aka ‘struct _zend_fcall_info’} has no member named ‘no_separation’
53 | fci.no_separation = 0;
| ^~~~~~~~~~~~~
/tmp/v8js/v8js_array_access.cc: In function ‘void v8js_array_access_enumerator(const v8::PropertyCallbackInfo<v8::Array>&)’:
/tmp/v8js/v8js_array_access.cc:213:74: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’, declared with attribute ‘warn_unused_result’ [-Wunused-result]
213 | esult->Set(isolate->GetEnteredOrMicrotaskContext(), i ++, V8JS_INT(j));
| ^
In file included from /tmp/v8js/php_v8js_macros.h:55,
from /tmp/v8js/v8js_array_access.cc:17:
/opt/v8/include/v8.h:3943:37: note: declared here
3943 | V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
| ^~~
/tmp/v8js/v8js_array_access.cc:217:86: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute ‘warn_unused_result’ [-Wunused-result]
217 | late->GetEnteredOrMicrotaskContext(), V8JS_SYM("length"), V8JS_INT(i));
| ^
In file included from /tmp/v8js/php_v8js_macros.h:55,
from /tmp/v8js/v8js_array_access.cc:17:
/opt/v8/include/v8.h:3940:37: note: declared here
3940 | V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
| ^~~
/tmp/v8js/v8js_array_access.cc: In function ‘void v8js_array_access_named_getter(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)’:
/tmp/v8js/v8js_array_access.cc:253:83: warning: ignoring return value of ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const [with S = v8::Value; T = v8::Value]’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
253 | t(isolate->GetEnteredOrMicrotaskContext(), property).ToLocal(&ret_value);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
make: *** [Makefile:223: v8js_array_access.lo] Error 1
My PHP version: 8.0.5

Related

Makefile and run on Mac M1 chip?

Is there any way to compile and run this on Mac M1 chip? I have xcode installed and all other c and c++ libraries. I try with UTM/ubunto also dodnt work.
default:
g++ -O3 -c oldbloom/bloom.cpp -o oldbloom.o
g++ -O3 -c bloom/bloom.cpp -o bloom.o
# g++ -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
g++ -O3 -c sha3/sha3.c -o sha3.o
g++ -O3 -c sha3/keccak.c -o keccak.o
gcc -O3 -c xxhash/xxhash.c -o xxhash.o
g++ -O3 -c util.c -o util.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Int.cpp -o Int.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Point.cpp -o Point.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/SECP256K1.cpp -o SECP256K1.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntMod.cpp -o IntMod.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Random.cpp -o Random.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntGroup.cpp -o IntGroup.o
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160.o -c hash/ripemd160.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256.o -c hash/sha256.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160_sse.o -c hash/ripemd160_sse.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256_sse.o -c hash/sha256_sse.cpp
g++ -o keyhunt keyhunt.cpp base58.o rmd160.o hash/ripemd160.o hash/ripemd160_sse.o hash/sha256.o hash/sha256_sse.o bloom.o oldbloom.o xxhash.o util.o Int.o Point.o SECP256K1.o IntMod.o Random.o IntGroup.o sha3.o keccak.o -lm -lpthread
rm -r *.o
clean:
rm keyhunt
I get all this errors when i try to compile it on Mac M1:
In file included from secp256k1/Int.cpp:18:
secp256k1/Int.h:204:27: error: invalid output constraint '=d' in asm
__asm__( "mulq %[b];" :"=d"(rhi),"=a"(rlo) :"1"(a),[b]"rm"(b));
^
secp256k1/Int.h:211:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shrdq %3,%2,%0;" : "=D"(c) : "r"(a),"r"(b),"c"(n));
^
secp256k1/Int.h:218:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shldq %3,%2,%0;" : "=D"(c) : "r"(b),"r"(a),"c"(n));
^
secp256k1/Int.h:234:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:235:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:236:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:237:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[4], y, &h), carry, dst + 4); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:253:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:254:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:255:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:262:3: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
_addcarry_u64(c, 0ULL, carry, dst + (NB64BLOCK - 1));
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
In file included from secp256k1/Int.cpp:24:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
__builtin_ia32_emms();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: note: '__builtin_isless' declared here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:25: error: too few arguments to function call, expected 2, have 0
__builtin_ia32_emms();
~~~~~~~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:54:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:71:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:133:19: error: use of undeclared identifier '__builtin_ia32_packsswb'
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
My question is, is it needed to change Makefile only or the whole script, to work on M1 chip?
Thanks in advance!

run.do_compile error on poky-dunfell release

When I am bitbaking my custom image recipe for STM32MP1 based Avenger96 board I am facing some errors related to analyze.l:466:19: error: format not a string literal and no format arguments [-Werror=format-security]. I don't understand why I am getting this error as this is the first I am facing it. Please find the below complete log:
DEBUG: Executing python function autotools_aclocals
DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'arm-32', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
DEBUG: Python function autotools_aclocals finished
DEBUG: Executing shell function do_compile
NOTE: make -j 8
make all-recursive
make[1]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build'
Making all in src
make[2]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src'
Making all in libcommon
make[3]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libcommon'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libcommon'
Making all in libkbdfile
make[3]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkbdfile'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkbdfile'
Making all in libkeymap
make[3]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkeymap'
make all-am
make[4]: Entering directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkeymap'
../../arm-poky-linux-gnueabi-libtool --tag=CC --mode=compile arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.2.0/src/libkeymap -I../.. -I../../../kbd-2.2.0/src/libkeymap -I. -I../../../kbd-2.2.0/src/libkeymap/.. -I./.. -I../../../kbd-2.2.0/src/libkeymap/../libcommon -I./../libcommon -I../../../kbd-2.2.0/src/libkeymap/../libkbdfile -I./../libkbdfile -DDATADIR=\"/usr/share\" -DLOCALEDIR=\"/usr/share/locale\" -U_GNU_SOURCE -funit-at-a-time -g -O2 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0=/usr/src/debug/kbd/2.2.0-r0 -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0=/usr/src/debug/kbd/2.2.0-r0 -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot= -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot-native= -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c -o analyze.lo ../../../kbd-2.2.0/src/libkeymap/analyze.c
arm-poky-linux-gnueabi-libtool: compile: arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.2.0/src/libkeymap -I../.. -I../../../kbd-2.2.0/src/libkeymap -I. -I../../../kbd-2.2.0/src/libkeymap/.. -I./.. -I../../../kbd-2.2.0/src/libkeymap/../libcommon -I./../libcommon -I../../../kbd-2.2.0/src/libkeymap/../libkbdfile -I./../libkbdfile -DDATADIR=\"/usr/share\" -DLOCALEDIR=\"/usr/share/locale\" -U_GNU_SOURCE -funit-at-a-time -g -O2 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0=/usr/src/debug/kbd/2.2.0-r0 -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0=/usr/src/debug/kbd/2.2.0-r0 -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot= -fdebug-prefix-map=/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/recipe-sysroot-native= -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c ../../../kbd-2.2.0/src/libkeymap/analyze.c -fPIC -DPIC -o .libs/analyze.o
analyze.l: In function 'find_incl_file_near_fn':
analyze.l:141:24: warning: passing argument 2 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:37: note: expected 'char **' but argument is of type 'const char **'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~
analyze.l:141:42: warning: passing argument 3 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:53: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~~
analyze.l: In function 'find_standard_incl_file':
analyze.l:168:22: warning: passing argument 2 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:37: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~
analyze.l:168:40: warning: passing argument 3 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:53: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~~
analyze.l:197:24: warning: passing argument 2 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:37: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~
analyze.l:197:42: warning: passing argument 3 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:53: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~~
analyze.l: In function 'find_incl_file':
analyze.l:210:27: warning: passing argument 2 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:37: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~
analyze.l:210:45: warning: passing argument 3 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:53: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~~
analyze.l:225:26: warning: passing argument 2 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:37: note: expected 'char **' but argument is of type 'const char **'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~
analyze.l:225:36: warning: passing argument 3 of 'kbdfile_find' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from ../../../kbd-2.2.0/src/libkeymap/keymap/kmap.h:36,
from ../../../kbd-2.2.0/src/libkeymap/keymap.h:8,
from ../../../kbd-2.2.0/src/libkeymap/analyze.c:1:
../../../kbd-2.2.0/src/libkeymap/../libkbdfile/kbdfile.h:40:53: note: expected 'char **' but argument is of type 'const char * const*'
40 | int kbdfile_find(char *fnam, char **dirpath, char **suffixes, struct kbdfile *fp);
| ~~~~~~~^~~~~~~~
In file included from analyze.l:10:
analyze.l: In function 'yylex':
analyze.l:466:19: error: format not a string literal and no format arguments [-Werror=format-security]
../../../kbd-2.2.0/src/libkeymap/contextP.h:79:55: note: in definition of macro 'lk_log_cond'
79 | lk_log(ctx, level, __FILE__, __LINE__, __func__, ##arg); \
| ^~~
analyze.l:466:6: note: in expansion of macro 'ERR'
cc1: some warnings being treated as errors
make[4]: *** [Makefile:604: analyze.lo] Error 1
make[4]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkeymap'
make[3]: *** [Makefile:476: all] Error 2
make[3]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src/libkeymap'
make[2]: *** [Makefile:1083: all-recursive] Error 1
make[2]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build/src'
make[1]: *** [Makefile:471: all-recursive] Error 1
make[1]: Leaving directory '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/build'
ERROR: oe_runmake failed
make: *** [Makefile:402: all] Error 2
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0/temp/run.do_compile.380' failed with exit code 1
When I checked the sources/poky/meta/recipes-core/kbd, add missing string format patch patch is already available and included in kbd_2.2.0.bb recipe. And same patch is also present in build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/kbd/2.2.0-r0. But still I am getting above error.
I have no idea what this error means and why am I getting this all of a sudden.
Can anyone please let me know how to fix this issue?
Your help will be much appreciated.
Thanks in advance.
You should NOT do the following, its likely your code compiles just fine on an older version of GCC, but GCC adds new warnings and errors for security purposes, you should really look at the code and fix it properly, it is also very likely you just need to use a newer version of kbd that builds contains these fixes (kbd is at 2.4.0 in the latest branch: https://git.yoctoproject.org/poky/tree/meta/recipes-core/kbd/kbd_2.4.0.bb).
But if you want to temporarily disable the GCC error to check if your build works while you either fix the kbd code or upgrade to a new version of kbd, you could set:
CFLAGS += "-Wno-error=format-security"
Which will suppress the compilation error, I cannot stress this enough, the fix is to actually fix the kbd code.
quick fix, thanks to aehs29:
copy file
https://git.yoctoproject.org/poky/tree/meta/recipes-core/kbd/kbd_2.4.0.bb
to the folder .../poky/meta/recipes-core/kbd/
remove file .../poky/meta/recipes-core/kbd/kbd_2.2.0.bb
and rebuild
bitbake -k radxa-minimal-image

Installing Kannel SMS gateway1.5.0 on Ubuntu 20.04.1

I was able to compiled the gateway but I got the error below running the make command.
gcc -D_REENTRANT=1 -I. -Igw -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/mysql -o gwlib/dbpool.o -c gwlib/dbpool.c
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdlib.h:25,
from gwlib/gwlib.h:70,
from gwlib/dbpool.c:70:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
In file included from gwlib/gwlib.h:83,
from gwlib/dbpool.c:70:
gwlib/dbpool_mysql.c: In function ‘mysql_select’:
gwlib/dbpool_mysql.c:224:48: error: ‘my_bool’ undeclared (first use in this function); did you mean ‘xr_bool’?
224 | bind[i].is_null = gw_malloc(sizeof(my_bool));
gwlib/gwmem.h:122:43: note: in definition of macro ‘gw_malloc’
122 | #define gw_malloc(size) (gw_native_malloc(size))|
gwlib/dbpool_mysql.c:224:48: note: each undeclared identifier is reported only once for each function it appears in
224 | bind[i].is_null = gw_malloc(sizeof(my_bool));
gwlib/gwmem.h:122:43: note: in definition of macro ‘gw_malloc’
122 | #define gw_malloc(size) (gw_native_malloc(size))
make: *** [Makefile:230: gwlib/dbpool.o] Error 1`
This error comes when you're compiling with mysql 8
To fix this, add these lines to gwlib/dbpool_mysql.c
/* define my_bool for newer versions because they use the bool or int C type instead */
#if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_BASE_VERSION)
typedef bool my_bool;
#endif

Issue with zlib while running makefile MacOS sierra

I am trying to run a make file in MacOS sierra, but it seems to have trouble with the header of the Zlib (see below).
I have tried to install a separate version with brew and pass the directory of the brew zlib installation in the configure file.
./configure --prefix=/usr/local/etherlab --with-xml-prefix=/usr/local/opt/libxml2 --with-zlib-dir=/usr/local/opt/zlib CXXFLAGS=-std=c++11
However, when I run make I got the error
$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in proto
make[2]: Nothing to be done for `all'.
Making all in lib
Making all in LibDLS
make[3]: Nothing to be done for `all'.
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/etherlab/include -Wall -I/usr/local/include -I/usr/local/opt/zlib/include -I/usr/local/opt/libxml2/include/libxml2 -std=c++11 -MT libdls_la-ZLib.lo -MD -MP -MF .deps/libdls_la-ZLib.Tpo -c -o libdls_la-ZLib.lo `test -f 'ZLib.cpp' || echo './'`ZLib.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/etherlab/include -Wall -I/usr/local/include -I/usr/local/opt/zlib/include -I/usr/local/opt/libxml2/include/libxml2 -std=c++11 -MT libdls_la-ZLib.lo -MD -MP -MF .deps/libdls_la-ZLib.Tpo -c ZLib.cpp -fno-common -DPIC -o .libs/libdls_la-ZLib.o
ZLib.cpp:22:10: warning: non-portable path to file '<ZLib.h>'; specified path differs in case from file name on disk
[-Wnonportable-include-path]
#include <zlib.h>
^~~~~~~~
<ZLib.h>
In file included from ZLib.cpp:22:
./zlib.h:42:17: error: unknown type name 'string'; did you mean 'std::string'?
EZLib(const string &pmsg) : Exception(pmsg) {};
^~~~~~
std::string
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:194:65: note:
'std::string' declared here
typedef basic_string<char, char_traits<char>, allocator<char> > string;
^
ZLib.cpp:90:5: error: unknown type name 'uLongf'
uLongf out_size;
^
ZLib.cpp:104:17: error: use of undeclared identifier 'uLongf'
out_size = (uLongf) (src_size * 1.01 + 12 + 0.5);
^
ZLib.cpp:117:28: error: use of undeclared identifier 'Bytef'
comp_ret = ::compress((Bytef *) _out_buf, &out_size,
^
ZLib.cpp:117:35: error: expected expression
comp_ret = ::compress((Bytef *) _out_buf, &out_size,
^
ZLib.cpp:118:34: error: unknown type name 'Bytef'
(const Bytef *) src, src_size);
^
ZLib.cpp:117:16: error: no member named 'compress' in the global namespace; did you mean simply 'compress'?
comp_ret = ::compress((Bytef *) _out_buf, &out_size,
^~~~~~~~~~
compress
ZLib.cpp:88:12: note: 'compress' declared here
void ZLib::compress(const char *src, unsigned int src_size)
^
ZLib.cpp:120:21: error: use of undeclared identifier 'Z_OK'
if (comp_ret != Z_OK) // Fehler beim Komprimieren
^
ZLib.cpp:123:25: error: use of undeclared identifier 'Z_BUF_ERROR'
if (comp_ret == Z_BUF_ERROR) err << " (BUFFER ERROR)";
^
ZLib.cpp:155:5: error: unknown type name 'uLongf'
uLongf zlib_out_size = out_size;
^
ZLib.cpp:173:32: error: use of undeclared identifier 'Bytef'
uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size,
^
ZLib.cpp:173:39: error: expected expression
uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size,
^
ZLib.cpp:174:38: error: unknown type name 'Bytef'
(const Bytef *) src, src_size);
^
ZLib.cpp:173:18: error: no member named 'uncompress' in the global namespace; did you mean simply 'uncompress'?
uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size,
^~~~~~~~~~~~
uncompress
ZLib.cpp:150:12: note: 'uncompress' declared here
void ZLib::uncompress(const char *src, unsigned int src_size,
^
ZLib.cpp:176:23: error: use of undeclared identifier 'Z_OK'
if (uncomp_ret != Z_OK) // Fehler beim Dekomprimieren
^
ZLib.cpp:179:27: error: use of undeclared identifier 'Z_BUF_ERROR'
if (uncomp_ret == Z_BUF_ERROR) {
^
1 warning and 16 errors generated.
make[3]: *** [libdls_la-ZLib.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Digging a bit more I found that I could try to add
#include <string>
#include <cstring>
to the header zlib.h but this does not work either.
What else can I do to solve this issue?.

gcc : unknown type name

I am trying to install a linear solver called PDSLin on ubuntu16.04 LTS machine. I installed all the dependencies but when running make for PDSLin I got those warnings and errors. I do not understand from where -c in gcc -c come from and whether it is the reason of not identifying "superlu_options_t" variable.
(cd src; make lib;)
make[1]: Entering directory '/home/afrah/pdslin/src'
(make all; cd slu; make lib)
make[2]: Entering directory '/home/afrah/pdslin/src'
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC pdslin_graph.c
pdslin_graph.c: In function ‘a_plus_at_CompRow_loc_with_diag’:
pdslin_graph.c:51:26: warning: variable ‘sz_tcolind_loc’ set but not used [-Wunused-but-set-variable]
int_t sz_tcolind_send, sz_tcolind_loc, sz_tcolind_recv;
^
pdslin_graph.c: In function ‘perm_snodes’:
pdslin_graph.c:898:22: warning: passing argument 1 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
ParMETIS_V3_NodeND(disp, m_rowptr, m_colind, &numflag, options,
^
// similar warnings
pdslin_graph.c:1034:9: warning: variable ‘numflag’ set but not used [-Wunused-but-set-variable]
int numflag;
^
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC pdslin_wrapper.c
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC pdslin_perm.c
pdslin_perm.c: In function ‘comp_perm’:
pdslin_perm.c:113:24: warning: passing argument 1 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
^
In file included from pdslin_perm.c:14:0:
/home/afrah/SuperLU_DIST_5.1.2/SRC/parmetis.h:102:13: note: expected ‘idx_t * {aka long int *}’ but argument is of type ‘int *’
int __cdecl ParMETIS_V3_NodeND(
^
pdslin_perm.c:113:30: warning: passing argument 2 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
^
In file included from pdslin_perm.c:14:0:
/home/afrah/SuperLU_DIST_5.1.2/SRC/parmetis.h:102:13: note: expected ‘idx_t * {aka long int *}’ but argument is of type ‘int *’
int __cdecl ParMETIS_V3_NodeND(
^
pdslin_perm.c:113:40: warning: passing argument 3 of ‘ParMETIS_V3_NodeND’ from incompatible pointer type [-Wincompatible-pointer-types]
ParMETIS_V3_NodeND(disp, rowptr_l, colind_l, &numflag, options,
^
// warnings
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC pdslin_util.c
In file included from pdslin_util.c:11:0:
/home/afrah/pdslin/include/pdslin_slu.h:49:24: error: unknown type name ‘superlu_options_t’
void get_perm_c_dist_t(superlu_options_t *options, int_t pnum, int_t ispec, S
^
/home/afrah/pdslin/include/pdslin_slu.h:70:24: error: unknown type name ‘superlu_options_t’
int_t pdslin_symbfact( superlu_options_t *options, /* input options */
^
pdslin_util.c: In function ‘a_plus_at’:
pdslin_util.c:116:9: warning: variable ‘nnz_loc’ set but not used [-Wunused-but-set-variable]
int_t nnz_loc; /* number of local nonzeros in matrix A */
^
pdslin_util.c:107:26: warning: variable ‘sz_tcolind_loc’ set but not used [-Wunused-but-set-variable]
int_t sz_tcolind_send, sz_tcolind_loc, sz_tcolind_recv;
^
pdslin_util.c: In function ‘pdslin_print_stat’:
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘long long int’ [-Wformat=]
printf( " domain dim : (%.2lf, %.2lf ) %ld / %ld, %ld\n",
^
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘long long int’ [-Wformat=]
pdslin_util.c:1047:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘long long int’ [-Wformat=]
pdslin_util.c:1049:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘long long int’ [-Wformat=]
printf( " domain nnz : (%.2lf, %.2lf ) %ld / %ld, %ld\n",
^
// warnings
makefile:103: recipe for target 'pdslin_util.o' failed
make[2]: *** [pdslin_util.o] Error 1
make[2]: Leaving directory '/home/afrah/pdslin/src'
make[2]: Entering directory '/home/afrah/pdslin/src/slu'
gcc -c -I/home/afrah/pdslin/include -I/home/afrah/SuperLU_5.2.0/SRC -I/usr/include -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I/home/afrah/SuperLU_DIST_5.1.2/SRC -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -Wall -DWITH_HIPS -DWITH_PETSC get_perm_c.c
get_perm_c.c:49:11: error: unknown type name ‘superlu_options_t’
superlu_options_t *options,
^
get_perm_c.c:167:19: error: unknown type name ‘superlu_options_t’
get_perm_c_dist_t(superlu_options_t *options, int_t pnum, int_t ispec, SuperM
^
makefile:41: recipe for target 'get_perm_c.o' failed
make[2]: *** [get_perm_c.o] Error 1
make[2]: Leaving directory '/home/afrah/pdslin/src/slu'
makefile:46: recipe for target 'lib' failed
make[1]: *** [lib] Error 2
make[1]: Leaving directory '/home/afrah/pdslin/src'
makefile:8: recipe for target 'all' failed
make: *** [all] Error 2
This is my makefile:
#
# top directory make.inc
#
# on hopper: % module load cray-petsc which also loads cray-tpsl, including pt-schotch and parmetis.
########################################################################
# home directory, where the software is located
TOP = /home/afrah/pdslin
INCLUDEDIR =/usr/include
########################################################################
# hybrid solver library name
LIB = $(TOP)/lib/libhybrid.a
########################################################################
# Libraries:
#
# MPI/BLAS libraries
L_MPI = /usr/share/mpich-install/lib/libmpi.a -llibmpi
I_MPI = -I/usr/share/mpich-install/include
L_BLAS = -llibblas -lliblapack
########################################################################
# make utility
MAKE = make
########################################################################
# archiver and flags to build the library
ARCH = /usr/bin/ar
ARCHFLAGS = -cr
RANLIB = /usr/bin/ranlib
########################################################################
# C compiler and flags
CC = gcc
FLAGS = -Wall -DWITH_HIPS -DWITH_PETSC
FLAGS = -Wall -DWITH_HIPS -DWITH_PETSC
########################################################################
# fortran compiler and flags
FC = mpif90
FLIB = -pgf90libs
FFLAGS = -fast
FFLAGS = -g
########################################################################
# linker used to link example program with the library
#LINKER = /usr/share/mpich-install/bin/mpicc -Wl,--allow-multiple-definition
LINKER = CC -Wl,--allow-multiple-definition
########################################################################
# C++ compiler (this is not needed for your standard compilation)
CPP = mpicxx
####################################################################
#L_PPART = -L/usr/share/parmetis/lib/libparmetis -lparmetis
#I_PPART = -I/usr/local/include
L_PPART = -L/usr/local/lib -llibscotch -llibptscotch \
-L/usr/local/lib -lptscotcherr -llibscotchmetis -lptscotchparmetis
I_PPART = -DSCOTCH_ORDER -I/usr/local/include
#------------------------------------------------------#
# Metis Library, and its header files
L_METIS = -L/usr/share/parmetis/lib/libmetis -lmetis
I_METIS = -I/usr/share/parmetis/include
#------------------------------------------------------#
# SuperLU_DIST library, and its header files (hopper: module load superlu_dist)
# SLUDIST = /global/common/hopper2/acts/SuperLU/SuperLU_DIST/2.5
# L_SLUDIST = -L$(SLUDIST)/craypgi-xe6_O/lib -lsuperlu_dist_2.5
# I_SLUDIST = -DDEBUGlevel=0 -DPRNTlevel=1 -DAdd_ -DUSE_VENDOR_BLAS -I$(SLUDIST)/SRC
SLUDIST = /home/afrah/SuperLU_DIST_5.1.2
I_SLUDIST = -DDEBUGlevel=0 -DPRNTlevel=0 -DAdd_ -DUSE_VENDOR_BLAS -I$(SLUDIST)/SRC
L_SLUDIST = -L$(SLUDIST)/lib -llibsuperlu_dist.so
#------------------------------------------------------#
# Petsc library, and its header files
# double version
I_PETSC = -I/home/afrah/petsc/include \
-I/home/afrah/petsc/arch-linux2-c-debug/include
L_PETSC = -L/home/afrah/petsc/arch-linux2-c-debug/lib -llibpetsc
#------------------------------------------------------#
# Other optional libraries
# serial SuperLU
L_SLU = -L/home/afrah/SuperLU_5.2.0/lib -llibsuperlu_5.2.a
I_SLU = -I/home/afrah/SuperLU_5.2.0/SRC
########################################################################
########################################################################
# accumulate all includes and libraries
INC = -I$(TOP)/include $(I_SLU) -I$(INCLUDEDIR) $(I_SLUDIST) $(I_PPART) $(I_METIS) $(I_MPI) $(I_PETSC)
LIBS = $(LIB) $(L_SLU) $(L_SLUDIST) $(L_PPART) $(L_METIS) $(L_BLAS) $(L_MPI) $
(L_PETSC)
ZLIBS = $(LIB) $(L_SLUDIST) $(L_PPART) $(L_METIS) $(L_BLAS) $(L_MPI) $(L_SLU) $(L_PETSC)

Resources