Error while loading DSTNEE i sagemaker terminal - amazon-sagemaker

I got this error can someone help?
This error I got while building docker image in the sagemaker terminal , i tried to resolve by changing ubuntu and the cuda version ut still error is persistent can someone tell the reason of error?
In file included from NcExcptionWrap.h:2:0,
from NNNetwork.cpp:14:
/usr/include/ncException.h:26:7: note: candidate: netCDF::exceptions::NcException::NcException(const string&, const string&, const char*, int)
NcException(const std::string& exceptionName,const std::string& complaint,const char* fileName,int lineNumber);
^
/usr/include/ncException.h:26:7: note: candidate expects 4 arguments, 3 provided
/usr/include/ncException.h:24:11: note: candidate: netCDF::exceptions::NcException::NcException(const netCDF::exceptions::NcException&)
class NcException : public std::exception {
^
/usr/include/ncException.h:24:11: note: candidate expects 1 argument, 3 provided
make[1]: *** [/opt/amazon/dsstne/build/tmp/engine/cpp/NNNetwork.o] Error 1

Related

vulkan_win32.h is not "recognized"

I'm following this Vulkan tutorial: https://youtu.be/dHPuU-DJoBM, in particular, this video https://youtu.be/6Kj3O2Ov1RU
when I run in VS code, this errors shows (there are a lot of them, but all of the same type), i think is something with Windows implementation(?): log of VS code terminal:
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:30:5: error: unknown type name 'HINSTANCE'
HINSTANCE hinstance;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:31:5: error: unknown type name 'HWND'
HWND hwnd;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:57:5: error: unknown type name 'HANDLE'
HANDLE handle;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:58:5: error: unknown type name 'LPCWSTR'
LPCWSTR name;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:64:11: error: unknown type name 'SECURITY_ATTRIBUTES'
const SECURITY_ATTRIBUTES* pAttributes;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:65:5: error: unknown type name 'DWORD'
DWORD dwAccess;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:66:5: error: unknown type name 'LPCWSTR'
LPCWSTR name;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:82:136: error: unknown type name 'HANDLE'
...*PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* ... ^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:83:135: error: unknown type name 'HANDLE'
...*PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE ha... ^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:89:5: error: unknown type name 'HANDLE'
HANDLE* pHandle);
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:94:5: error: unknown type name 'HANDLE'
HANDLE handle,
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:125:5: error: unknown type name 'HANDLE'
HANDLE handle;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:126:5: error: unknown type name 'LPCWSTR'
LPCWSTR name;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:132:11: error: unknown type name 'SECURITY_ATTRIBUTES'
const SECURITY_ATTRIBUTES* pAttributes;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:133:5: error: unknown type name 'DWORD'
DWORD dwAccess;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:134:5: error: unknown type name 'LPCWSTR'
LPCWSTR name;
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:154:142: error: unknown type name 'HANDLE'
...device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:164:5: error: unknown type name 'HANDLE'
HANDLE* pHandle);
^
C:\VulkanSDK\1.3.239.0/Include\vulkan/vulkan_win32.h:177:5: error: unknown type name 'HANDLE'
HANDLE handle;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Error:1
this is what is shown if I run vulkaninfo:
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_api_dump.json invalid layer manifest file version 1.2.0. May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_gfxreconstruct.json invalid layer manifest file version 1.2.0. May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_khronos_synchronization2.json invalid layer manifest file version 1.2.0. May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_khronos_validation.json invalid layer manifest file version 1.2.0. May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_screenshot.json invalid layer manifest file version 1.2.0. May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: C:\VulkanSDK\1.3.239.0\Bin\VkLayer_khronos_profiles.json invalid layer manifest file version 1.2.1. May cause errors.
this is my Vulkan config:
Vulkan Instance Version: 1.2.162
Instance Extensions: count = 11
===============================
VK_EXT_debug_report : extension revision 9
VK_EXT_debug_utils : extension revision 2
VK_EXT_swapchain_colorspace : extension revision 4
VK_KHR_device_group_creation : extension revision 1
VK_KHR_external_fence_capabilities : extension revision 1
VK_KHR_external_memory_capabilities : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2 : extension revision 1
VK_KHR_surface : extension revision 25
VK_KHR_win32_surface : extension revision 6
I've tried to follow this (How to make VK_LAYER_KHRONOS_validation available?) but Windows doesn't let me delete the register
I installed the latest Vulkan SDK so it doesn't seem to be the problem. Can someone help me?

C compiler error: expected parameter declarator

https://github.com/noyesno/awka
For the above repo, I got the following error when I try to compile it on macOS (gcc is just clang). I have no idea how to fix the problem according to the error message. It compiles fine on Linux.
I also tried the real gcc from Homebrew to compile the package. It also show the same error. How can I fix this problem on macOS?
$ ./configure
$ make
...
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\" -c -o print.o print.c
print.c:52:11: error: expected parameter declarator
int PROTO(sprintf, (char *, const char *,...)) ;
^
print.c:52:11: error: expected ')'
print.c:52:11: note: to match this '('
print.c:52:11: error: conflicting types for '__builtin___sprintf_chk'
int PROTO(sprintf, (char *, const char *,...)) ;
^
print.c:52:11: note: '__builtin___sprintf_chk' is a builtin with type 'int (char *, int, unsigned long, const char *, ...)'
3 errors generated.
make[1]: *** [<builtin>: print.o] Error 1
make[1]: Leaving directory '/private/tmp/awka/awka'
make: *** [Makefile:48: awka_exe] Error 2
I'm not going to spend ages on this, but it looks as though configure is gripping stdio.h looking for sprintf. It is unable to find it in the header, and so it adds the #define:
NO_SPRINTF_IN_STDIO
which it sets to 1, and uses it to add its own prototype for sprintf. Unfortunately, this appears to be a macro in this case, which replaces sprintf with '__builtin___sprintf_chk' instead (which has additional string length checks by the looks of it).
Possible solutions:
Comment out the line in print.c, and make sure stdio.h is included somewhere.
After running configure, search for where it defines NO_SPRINTF_IN_STDIO and set that var to 1?
Fix the configure to so a more rigorous test?

How to enable clang static analyzer's "alpha.security.taint check" checker

I am trying to execute clang static analyzer (version 3.8) on some of the examples shown in its documentation (https://clang-analyzer.llvm.org/alpha_checks.html#security_alpha_checkers).
I created a small C program, as follows:
// note: requires alpha.security.taint check turned on.
void test() {
char s[] = "abc";
int x = getchar();
char c = s[x]; // warn: index is tainted
}
I am executing following command to analyze the above code:
/usr/lib/llvm-3.8/bin/scan-build -enable-checker alpha.security.taint.TaintPropagation clang -c example.c
The above command generates following error report:
scan-build: Using '/usr/lib/llvm-3.8/bin/clang' for static analysis
example.c:5:8: warning: Value stored to 'c' during its initialization is never read
char c = s[x]; // warn: index is tainted
^ ~~~~
1 warning generated.
scan-build: 1 bug found.
scan-build: Run 'scan-view /tmp/scan-build-2018-04-09-143549-15413-1' to examine bug reports.
I was expecting clang SA will complain about possible buffer overflow and buffer underflow at line 5, but it seems like taint analysis is not performed.
Can someone please suggest how to enable "alpha.security.taint" check?
To get a warning when using a tainted array index, you have to enable alpha.security.ArrayBoundV2 and alpha.security.taint.TaintPropagation:
$ ~/bld/llvm-project/build/bin/scan-build -enable-checker \
alpha.security.taint.TaintPropagation,alpha.security.ArrayBoundV2 \
gcc -c taint2.c
scan-build: Using '/home/scott/bld/llvm-project/build/bin/clang-9' for static analysis
taint2.c:6:10: warning: Value stored to 'c' during its initialization is never read
char c = s[x]; // warn: index is tainted
^ ~~~~
taint2.c:6:14: warning: Out of bound memory access (index is tainted)
char c = s[x]; // warn: index is tainted
^~~~
2 warnings generated.
scan-build: 2 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2019-09-11-204837-97704-1' to examine bug reports.
The TaintPropagation checker reports some things by itself, for example, passing tainted data to system(). It also exports tainting information for other checkers to use.
(I discovered this information primarily by looking at the source code, and secondarily through trial and error. The documentation isn't much help.)

Error compiling PJSIP on Ubuntu

I am trying to compile PJSIP 2.1 with Video support on Ubuntu but I get the following error when running 'make' :
In file included from ../src/pjmedia/ffmpeg_util.c:26:0:
../src/pjmedia/ffmpeg_util.h:50:12: warning: ‘enum CodecID’ declared inside parameter list [enabled by default]
enum CodecID *codec_id);
^
../src/pjmedia/ffmpeg_util.h:50:12: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
../src/pjmedia/ffmpeg_util.h:53:7: warning: ‘enum CodecID’ declared inside parameter list [enabled by default]
pjmedia_format_id *fmt_id);
^
../src/pjmedia/ffmpeg_util.c:65:18: error: field ‘codec_id’ has incomplete type
enum CodecID codec_id;
^
../src/pjmedia/ffmpeg_util.c:167:13: error: conflicting types for ‘pjmedia_format_id_to_CodecID’
pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id,
^
In file included from ../src/pjmedia/ffmpeg_util.c:26:0:
../src/pjmedia/ffmpeg_util.h:49:13: note: previous declaration of ‘pjmedia_format_id_to_CodecID’ was here
pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id,
^
../src/pjmedia/ffmpeg_util.c: In function ‘pjmedia_format_id_to_CodecID’:
../src/pjmedia/ffmpeg_util.c:173:35: warning: comparison between pointer and integer [enabled by default]
if (t->id==fmt_id && t->codec_id != PIX_FMT_NONE) {
^
../src/pjmedia/ffmpeg_util.c:174:6: error: dereferencing pointer to incomplete type
*codec_id = t->codec_id;
^
../src/pjmedia/ffmpeg_util.c:174:6: warning: statement with no effect [-Wunused-value]
../src/pjmedia/ffmpeg_util.c:179:5: error: dereferencing pointer to incomplete type
*codec_id = PIX_FMT_NONE;
^
../src/pjmedia/ffmpeg_util.c:179:5: warning: statement with no effect [-Wunused-value]
../src/pjmedia/ffmpeg_util.c: At top level:
../src/pjmedia/ffmpeg_util.c:183:55: error: parameter 1 (‘codec_id’) has incomplete type
pj_status_t CodecID_to_pjmedia_format_id(enum CodecID codec_id,
^
make[2]: *** [output/pjmedia-i686-pc-linux-gnu/ffmpeg_util.o] Error 1
make[2]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make[1]: *** [pjmedia] Error 2
make[1]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make: *** [all] Error 1
I have installed the required dependencies and have no idea what the problem is. Reading the error messages it looks like it comes from error in the PJSIP code?
EDIT : I renamed enum CodecID to enum AVCodecID according to Getting “field has incomplete type” and "conflicting types" but now i'm getting the following error :
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(ffmpeg_vid_codecs.o): In function `ffmpeg_codec_encode_whole.isra.7':
ffmpeg_vid_codecs.c:(.text+0x1374): undefined reference to `avcodec_encode_video2'
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/pjmedia-test-i686-pc-linux-gnu] Error 1
make[2]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make[1]: *** [pjmedia-test] Error 2
make[1]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make: *** [all] Error 1
Seems that you miss libavcodec/avcodec.h and, most probably, also libavformat/avformat.h. This should be because ffmpeg include folder is not into gcc's list of directories to look for header files.
From your update seems that pjsip is building against a newer ffmpeg version that the one available in Ubuntu's repositories. As you've built it yourself, you can configure pjsip to use your version by running:
./configure --with-ffmpeg=<YOUR_FFMPEG_FOLDER>
or
#Copy all library ffmpeg library files into one folder
CFLAGS="-I<YOUR_FFMPEG_FOLDER>" LDFLAGS="-L<YOUR_FFMPEG_LIB_FOLDER>" ./configure
The answer to the original question :
While compiling PJSIP I find that CodecID enum has been deprecated from ffmpeg. However it's been replaced by AV_CodecID and also the enum values have a leading AV_ added to them.
Thus after changing CodecID to AV_CodecID, please change the enums in ffmpeg_util.c.
For example this is what the table looks like after the change :
/* Conversion table between pjmedia_format_id and CodecID */
static const struct ffmpeg_codec_table_t
{
pjmedia_format_id id;
enum AVCodecID codec_id;
} ffmpeg_codec_table[] =
{
{PJMEDIA_FORMAT_H261, AV_CODEC_ID_H261},
{PJMEDIA_FORMAT_H263, AV_CODEC_ID_H263},
{PJMEDIA_FORMAT_H263P, AV_CODEC_ID_H263P},
{PJMEDIA_FORMAT_H264, AV_CODEC_ID_H264},
{PJMEDIA_FORMAT_MPEG1VIDEO, AV_CODEC_ID_MPEG1VIDEO},
{PJMEDIA_FORMAT_MPEG2VIDEO, AV_CODEC_ID_MPEG2VIDEO},
{PJMEDIA_FORMAT_MPEG4, AV_CODEC_ID_MPEG4},
{PJMEDIA_FORMAT_MJPEG, AV_CODEC_ID_MJPEG}
};

Exit Value 1 when returning 0

I've searched up and down Google and I cannot find a reason why this code is still failing.
void returnSeven();
int main() {
returnSeven();
return 0;
}
void returnSeven(){
printf("Hello");
}
It builds properly but gives me the
RUN FAILED (exit value 1, total time: 21ms)
error. Any possible ideas how to get rid of this? I've run it from command line and it gives me the same error. I've even had a friend run it and it seemed to work just fine for him. Any ideas would be appreciated.
Your code are ok after adding #include <stdio.h>. So, have you add that line in your code?
In the C programming language, if you haven't define printf, it can also be compiled just with a warning like this : incompatible implicit declaration of built-in function ‘printf’ [enabled by default]

Resources