Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncl source code install with Segmentation fault, C99, C90 errors #198

Open
junkai38 opened this issue Feb 9, 2023 · 1 comment
Open

Comments

@junkai38
Copy link

junkai38 commented Feb 9, 2023

Describe the bug
Now, I install ncl using the source code on linux-aarch64 platform with gcc-7.3.0 and gfortran-7.3.0.
But, It occurs many errors and don't get the ncl exe file.

The bin directory only has these following exe files:
cgm2ncgm idt ncargworld nhlcc ras2ccir601 tlocal
ConvertMapData med ncarlogo2ps nhlf77 rascat WRAPIT
ctlib ncargcc ncarvversion nhlf90 rasgetpal WriteLineFile
ctrans ncargex ncgm2cgm nnalg rasls WriteNameFile
ezmapdemo ncargf77 ncgmstat pre2ncgm rassplit WritePlotcharData
fcaps ncargf90 ncl_convert2nc pre2ncgm.prog rasstat
findg ncargfile ncl_filedump psblack rasview
fontc ncargpath ncl_grib2nc psplit scrip_check_input
gcaps ncargrun ncl_quicklook pswhite tdpackdemo
graphc ncargversion ng4ex pwritxnt tgks0a

Provide the following:

  1. ERROR 1
    ncargpath.c:64:2: 附注:include ‘<stdlib.h>’ or provide a declaration of ‘exit’
    gcc -std=c99 -ansi -fPIC -fopenmp -lstdc++ -O -o ncargpath ncargpath.o -L../../../.././common/src/libncarg_c -lncarg_c -L/home/nriet/software_install/ncl-6.6.2/lib -L/usr/lib64
    make[5]: 离开目录“/home/nriet/software_source/ncl_ncarg-6.6.2/common/src/bin/ncargpath”
    make[4]: 离开目录“/home/nriet/software_source/ncl_ncarg-6.6.2/common/src/bin”
    Making ./common/src/fontcap
    make[4]: 进入目录“/home/nriet/software_source/ncl_ncarg-6.6.2/common/src/fontcap”
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c cfaamn.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o cfrdln.o cfrdln.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o cfwrit.o cfwrit.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffgttk.o ffgttk.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffinfo.o ffinfo.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffphol.o ffphol.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffppkt.o ffppkt.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffprcf.o ffprcf.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o ffprsa.o ffprsa.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o fftbkd.o fftbkd.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o fftkin.o fftkin.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sffndc.o sffndc.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sfgtin.o sfgtin.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sfgtkw.o sfgtkw.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sfprcf.o sfprcf.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sfskbk.o sfskbk.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -c -o sftbkd.o sftbkd.f
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -o fontc cfaamn.o cfrdl
    gfortran -fno-range-check -fPIC -fno-f2c -fno-second-underscore -fopenmp -O -o fontc cfaamn.o cfrdl
    n.o cfwrit.o ffgttk.o ffinfo.o ffphol.o ffppkt.o ffprcf.o ffprsa.o fftbkd.o fftkin.o sffndc.o sfgtin.o sfgtkw.o sfprcf.o sfskbk.o sftbkd.o -L../../.././common/src/libncarg_c -lncarg_c -L/home/nriet/software_install/ncl-6.6.2/lib -L/usr/lib64
    Processing fontcap font1

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0xfffd65678763
#1 0xfffd656777a3
#2 0xfffd657d07bf
#3 0x403bfc
#4 0x403c83
#5 0x4032cf
#6 0x400f1b
#7 0x401233
#8 0xfffd65353f3f
#9 0x400d43
make[4]: *** [Makefile:545: font1]

  1. ERROR 2

gcc -std=c99 -ansi -fPIC -fopenmp -lstdc++ -O -o ictrans main.o ../../../.././ncarview/src/lib/libictrans/libictrans.o ../../../.././ncarview/src/lib/libctrans/libctrans.o -L../../../.././ncarview/src/lib/libcgm -lcgm -L../../../.././ncarview/src/lib/libncarg_ras -lncarg_ras -L../../../.././common/src/libncarg_c -lncarg_c -L/home/nriet/software_install/ncl-6.6.2/lib -L/usr/lib64 -lX11 -lXext -lgfortran
/usr/bin/ld: ../../../.././ncarview/src/lib/libcgm/libcgm.a(meta_edit.o): in function CGM_initMetaEdit': meta_edit.c:(.text+0x1394): 警告:the use of mktemp' is dangerous, better use mkstemp' or mkdtemp'
/usr/bin/ld: ../../../.././ncarview/src/lib/libctrans/libctrans.o: undefined reference to symbol 'sqrt@@GLIBC_2.17'
/usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing from command line

  1. ERROR 3
    gcc -std=c99 -ansi -fPIC -fopenmp -lstdc++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O -I../../.././include -I/usr/include/X11 -DLinux -DMAJOR=4 -DBuildHDF5 -DUSE_NETCDF4_FEATURES -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -DNeedFuncProto -I/home/nriet/software_install/netcdf-4.4.1/include -c -o NclApi.o NclApi.c
    In file included from NclApi.c:39:0:
    /home/nriet/software_install/netcdf-4.4.1/include/netcdf.h:1951:3: error:C++ comment format is not allowed in ISO C90
    //EXTERNL int nc_finalize();
    ^
    /home/nriet/software_install/netcdf-4.4.1/include/netcdf.h:1951:3: error
    )
    make[4]: *** [in:NclApi.o]

  2. ERROR 4
    gcc -std=c99 -ansi -fPIC -fopenmp -lstdc++ -O -I../../../.././include -I/usr/include/X11 -DLinux -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -DNeedFuncProto -I/home/nriet/software_install/netcdf-4.4.1/include -c -o CnStdRenderer.o CnStdRenderer.c
    CnStdRenderer.c: in function ‘CnStdGetIsoLines’:
    CnStdRenderer.c:2301:5: error:‘for’ loop initial declarations are only allowed in C99 or C11 mode
    for (int j = 0; j < npoints; j++) {
    ^~~
    CnStdRenderer.c:2301:5: 附注:use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
    make[5]: *** [>:CnStdRenderer.o] error 1

@MicroTed
Copy link

Please see if #191 is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants