Skip to content

Instantly share code, notes, and snippets.

@maasencioh
Created October 20, 2016 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maasencioh/9f4d5cee721aba35c5be701188c97af3 to your computer and use it in GitHub Desktop.
Save maasencioh/9f4d5cee721aba35c5be701188c97af3 to your computer and use it in GitHub Desktop.
netcdf.h functions unresolved
DEBUG:root:PYTHON not defined in /home/maasencioh/.emscripten, using "/usr/bin/python"
DEBUG:root:JAVA not defined in /home/maasencioh/.emscripten, using "java"
WARNING:root:invocation: /home/maasencioh/Downloads/emsdk_portable/emscripten/master/emcc real.c -I/usr/include/ -I/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/ -o netfile.js -v (in /home/maasencioh/testNetCDF)
INFO:root:(Emscripten: Running sanity checks)
INFO:root:(Emscripten: Running sanity checks)
DEBUG:root:compiling to bitcode
DEBUG:root:emcc step "parse arguments and setup" took 0.11 seconds
DEBUG:root:compiling source file: real.c
DEBUG:root:running: /home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin/clang -target asmjs-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=36 -D__EMSCRIPTEN_tiny__=0 -Werror=implicit-function-declaration -nostdinc -Xclang -nobuiltininc -Xclang -nostdsysteminc -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/local/include -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/compat -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/emscripten -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libc -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/lib/libc/musl/arch/emscripten -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libcxx -v -I/usr/include/ -I/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/ real.c -Xclang -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/SDL -emit-llvm -c -o /tmp/tmp9367TP/real_0.o
clang version 3.9.0 (https://github.com/kripken/emscripten-fastcomp-clang/ 271ce598c3d1fe74efadc254f5be1b57edea9f41) (https://github.com/kripken/emscripten-fastcomp/ 61acfb230665464544f2e8db292f8999fc3c628c) (emscripten 1.36.0 : 1.36.0)
Target: asmjs-unknown-emscripten
Thread model: posix
InstalledDir: /home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin
"/home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin/clang-3.9" -cc1 -triple asmjs-unknown-emscripten -emit-llvm-bc -emit-llvm-uselists -disable-free -disable-llvm-verifier -main-file-name real.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -no-integrated-as -mconstructor-aliases -v -dwarf-column-info -debugger-tuning=gdb -coverage-file /tmp/tmp9367TP/real_0.o -nostdsysteminc -nobuiltininc -resource-dir /home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin/../lib/clang/3.9.0 -D __EMSCRIPTEN_major__=1 -D __EMSCRIPTEN_minor__=36 -D __EMSCRIPTEN_tiny__=0 -I /usr/include/ -I /usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/ -Werror=implicit-function-declaration -fno-dwarf-directory-asm -fdebug-compilation-dir /home/maasencioh/testNetCDF -ferror-limit 19 -fmessage-length 211 -fobjc-runtime=gnustep -fdiagnostics-show-option -nobuiltininc -nostdsysteminc -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/local/include -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/compat -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/emscripten -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libc -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/lib/libc/musl/arch/emscripten -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libcxx -isystem/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/SDL -o /tmp/tmp9367TP/real_0.o -x c real.c
clang -cc1 version 3.9.0 based upon LLVM 3.9.0svn default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
/usr/include
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/local/include
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/compat
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/emscripten
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libc
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/lib/libc/musl/arch/emscripten
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/libcxx
/home/maasencioh/Downloads/emsdk_portable/emscripten/master/system/include/SDL
End of search list.
DEBUG:root:emcc step "bitcodeize inputs" took 0.01 seconds
DEBUG:root:emcc step "process inputs" took 0.00 seconds
DEBUG:root:will generate JavaScript
DEBUG:root:including libc.bc
DEBUG:root:including dlmalloc.bc
DEBUG:root:emcc step "calculate system libraries" took 0.01 seconds
DEBUG:root:linking: ['/tmp/tmp9367TP/real_0.o', '/home/maasencioh/.emscripten_cache/libc.bc', '/home/maasencioh/.emscripten_cache/dlmalloc.bc']
DEBUG:root:emcc step "link" took 0.00 seconds
DEBUG:root:saving intermediate processing steps to /tmp/emscripten_temp
DEBUG:root:(not saving intermediate /tmp/emscripten_temp/emcc-0-basebc.bc because deferring linking)
DEBUG:root:emcc: LLVM opts: -strip-debug -internalize -internalize-public-api-list=main,malloc,free,__errno_location,fflush -globaldce -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -vectorize-slp-aggressive=false [num inputs: 3]
DEBUG:root:emcc step "post-link" took 0.09 seconds
DEBUG:root:LLVM => JS
DEBUG:root:emscript: llvm backend: /home/maasencioh/Downloads/emsdk_portable/clang/fastcomp/build_master_64/bin/llc /tmp/tmp9367TP/netfile.bc -march=js -filetype=asm -o /tmp/emscripten_temp/tmpWhSw7a.4.js -emscripten-assertions=1 -emscripten-no-aliasing-function-pointers -O0 -enable-emscripten-cxx-exceptions
DEBUG:root: emscript: llvm backend took 0.0223169326782 seconds
DEBUG:root:emscript: js compiler glue
DEBUG:root:very limited syscalls (6, 146, 54, 140) so disabling full filesystem support
warning: unresolved symbol: nc_open
warning: unresolved symbol: nc_close
warning: unresolved symbol: nc_strerror
warning: unresolved symbol: nc_inq
warning: unresolved symbol: nc_inq_format
DEBUG:root: emscript: glue took 0.189977884293 seconds
DEBUG:root:asm text sizes[[199173, 17062], 2008, 159, 1582, 0, 402, 435, 542, 268, 920, 3973]
DEBUG:root: emscript: final python processing took 0.00168991088867 seconds
DEBUG:root:emcc step "emscript (llvm=>js)" took 0.23 seconds
DEBUG:root:emcc step "source transforms" took 0.00 seconds
DEBUG:root:emcc step "js opts" took 0.00 seconds
DEBUG:root:emcc step "final emitting" took 0.00 seconds
DEBUG:root:total time: 0.34 seconds
#include <netcdf.h>
#include <stdlib.h>
#include <stdio.h>
#define FILE_NAME "P071.CDF"
#define ERRCODE 2
#define ERR(e) {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);}
int main() {
int ncid, retval, ndims, nvars, ngatts, unlimdimid, format;
char name;
nc_type type;
size_t size;
// opens the file
if ((retval = nc_open(FILE_NAME, NC_NOWRITE, &ncid))) {
ERR(retval);
}
// reads general parameters
if ((retval = nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid))) {
ERR(retval);
}
printf("Number of dimensions: %d\n", ndims);
printf("Number of variables: %d\n", nvars);
printf("Number of global attributes: %d\n", ngatts);
// http://www.unidata.ucar.edu/software/netcdf/docs/netcdf_8h_source.html#l00174
if ((retval = nc_inq_format(ncid, &format))) {
ERR(retval);
}
printf("Format of file: %d\n", format);
// closes the file
if ((retval = nc_close(ncid))) {
ERR(retval);
}
printf("*** SUCCESS reading example file %s!\n", FILE_NAME);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment