compiling ffmpeg on msys2 and mingw32-- error creating ffmpeg_g.exe - ffmpeg

I have compiled ffmpeg from source using MSYS2 and MinGW. The library files were created successfully during the compilation and when make utility proceeds to build ffmpeg_g, I am getting lot of undefined references.Kindly tell me why the compilation fails....
Thanks in advance
The following library files were generated successfully
libavcodec.a
libavdvice.a
libavfilter.a
libavformat.a
libavutil.a
libpostproc.a
libswresample.a
libswscale.a
Command passed for compiling ffmpeg_g.exe output taken by using -d option with mke
g++ -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -o ffmpeg_g.exe ffmpeg_opt.o ffmpeg_filter.o ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lavicap32 -lpsapi -lole32 -lstrmiids -luuid -lws2_32 -lx264 -lvpx -lvpx -lvpx -lvpx -lvorbisenc -lvorbis -logg -lopenjpeg -lmp3lame -lfdk-aac -lfaac -lbluray -L/mingw32/lib -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lglib-2.0 -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -lintl -lfreetype -lz -lbz2 -lm -lbz2 -lz -lpsapi -ladvapi32 -lshell32
The output from gcc is given below
ffmpeg_opt.o: In function new_output_stream:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:1036: undefined reference to avcodec_get_context_defaults3
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:1089: undefined reference to av_get_exact_bits_per_sample
ffmpeg_opt.o: In function find_codec_or_die:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:514: undefined reference to avcodec_find_encoder_by_name
ffmpeg_opt.o: In function choose_encoder:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:965: undefined reference to avcodec_find_encoder
ffmpeg_opt.o: In function find_codec_or_die:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:518: undefined reference to avcodec_find_encoder
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:514: undefined reference to avcodec_find_decoder_by_name
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:518: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:596: undefined reference to av_codec_get_lowres
ffmpeg_opt.o: In function choose_decoder:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:546: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:546: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function open_input_file:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:872: undefined reference to avcodec_get_class
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:631: undefined reference to avcodec_find_decoder
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:595: undefined reference to avcodec_find_decoder
lot of undefined references followed by
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/mlpdsp.c:64: undefined reference to ff_mlpdsp_init_x86
libavcodec/libavcodec.a(mpegaudiodsp.o): In function ff_mpadsp_init:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/mpegaudiodsp.c:46: undefined reference to ff_mpadsp_init_x86
libavcodec/libavcodec.a(cavsdsp.o): In function ff_cavsdsp_init:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/cavsdsp.c:565: undefined reference to ff_cavsdsp_init_x86
collect2.exe: error: ld returned 1 exit status
Make output
LD ffmpeg_g.exe
Reaping losing child 01584DA0 PID 29691080
Makefile:105: recipe for target ffmpeg_g.exe failed
Removing child 01584DA0 PID 29691080 from chain.

Related

/usr/bin/ld: cannot find -lnetcdf?

First of all, this is my first question on here. If I make mistake, I'm sorry about that. By the way I'm a newbie in Fortran. I want to compile the "MMIF" model and the model has a compiler "makefile". I edited my "makefile" but I have an error message. When I used the make command, I'm getting this error:
...
/usr/bin/ld: cannot find -lnetcdf
collect2: error: ld returned 1 exit status
makefile:62: recipe for target 'mmif' failed
make: *** [mmif] Error 1
When I checked the location, I realised libnetcdf.a is missing. I don't know if it is needed in order to run the "makefile". Can you help me with this situation?
...
/usr/lib/x86_64-linux-gnu/libnetcdff.a
/usr/lib/x86_64-linux-gnu/libnetcdff.so
/usr/lib/x86_64-linux-gnu/libnetcdff.so.6
/usr/lib/x86_64-linux-gnu/libnetcdff.so.6.1.1
/usr/lib/x86_64-linux-gnu/libnetcdf.settings
/usr/lib/x86_64-linux-gnu/libnetcdf.so
/usr/lib/x86_64-linux-gnu/libnetcdf.so.13
...
Update 1
Thanks for helping and guiding me. I changed -lnetcdf to -lnetcdff. It works but I have a another problem now. I'm getting so many "undefined reference to..". Now, I'm trying to resolve these problems.
Error Code
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_text_':
(.text+0xb3): undefined reference to `nc_put_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_text_a_':
(.text+0x193): undefined reference to `nc_put_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int1_':
(.text+0x277): undefined reference to `nc_put_att_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int2_':
(.text+0x357): undefined reference to `nc_put_att_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int_':
(.text+0x437): undefined reference to `nc_put_att_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_real_':
(.text+0x517): undefined reference to `nc_put_att_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_double_':
(.text+0x5f7): undefined reference to `nc_put_att_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_text_':
(.text+0x745): undefined reference to `nc_get_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_text_a_':
(.text+0x846): undefined reference to `nc_get_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int1_':
(.text+0x916): undefined reference to `nc_get_att_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int2_':
(.text+0x9e6): undefined reference to `nc_get_att_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int_':
(.text+0xab6): undefined reference to `nc_get_att_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_real_':
(.text+0xb86): undefined reference to `nc_get_att_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_double_':
(.text+0xc56): undefined reference to `nc_get_att_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_create_':
(.text+0xa1): undefined reference to `nc_create'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__create_':
(.text+0x19a): undefined reference to `nc__create'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__create_mp_':
(.text+0x292): undefined reference to `nc__create_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_open_':
(.text+0x371): undefined reference to `nc_open'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__open_':
(.text+0x45d): undefined reference to `nc__open'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__open_mp_':
(.text+0x557): undefined reference to `nc__open_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_open_mem_':
(.text+0x63c): undefined reference to `nc_open_mem'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_inq_path_':
(.text+0x78d): undefined reference to `nc_inq_path'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_fill_':
(.text+0x8ba): undefined reference to `nc_set_fill'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_default_format_':
(.text+0x910): undefined reference to `nc_set_default_format'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_delete_':
(.text+0xa3a): undefined reference to `nc_delete'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_delete_mp_':
(.text+0xb02): undefined reference to `nc_delete_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_inq_base_pe_':
(.text+0xb60): undefined reference to `nc_inq_base_pe'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_redef_':
(.text+0x943): undefined reference to `nc_redef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_enddef_':
(.text+0x953): undefined reference to `nc_enddef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__enddef_':
(.text+0x96f): undefined reference to `nc__enddef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_sync_':
(.text+0x983): undefined reference to `nc_sync'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_abort_':
(.text+0x993): undefined reference to `nc_abort'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_close_':
(.text+0x9a3): undefined reference to `nc_close'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_base_pe_':
(.text+0xb35): undefined reference to `nc_set_base_pe'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_def_dim_':
(.text+0xb7): undefined reference to `nc_def_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dim_':
(.text+0x24c): undefined reference to `nc_inq_dim'
(.text+0x2a6): undefined reference to `nc_inq_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimid_':
(.text+0x45d): undefined reference to `nc_inq_dimid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimlen_':
(.text+0x4c9): undefined reference to `nc_inq_dimlen'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimname_':
(.text+0x63f): undefined reference to `nc_inq_dimname'
(.text+0x691): undefined reference to `nc_inq_dimname'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_rename_dim_':
(.text+0x82e): undefined reference to `nc_rename_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_def_var_':
(.text+0x111): undefined reference to `nc_def_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varndims_':
(.text+0x1a5): undefined reference to `nc_inq_varndims'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_var_':
(.text+0x2f8): undefined reference to `nc_inq_varndims'
(.text+0x363): undefined reference to `nc_inq_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_vardimid_':
(.text+0x550): undefined reference to `nc_inq_varndims'
(.text+0x59a): undefined reference to `nc_inq_vardimid'
(.text+0x611): undefined reference to `nc_inq_vardimid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varid_':
(.text+0x6cf): undefined reference to `nc_inq_varid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varname_':
(.text+0x7e9): undefined reference to `nc_inq_varname'
(.text+0x831): undefined reference to `nc_inq_varname'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_vartype_':
(.text+0x955): undefined reference to `nc_inq_vartype'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varnatts_':
(.text+0x9a5): undefined reference to `nc_inq_varnatts'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_rename_var_':
(.text+0xa6e): undefined reference to `nc_rename_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_copy_var_':
(.text+0xaaa): undefined reference to `nc_copy_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_':
(.text+0x3d): undefined reference to `nc_inq_varndims'
(.text+0x139): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_a_':
(.text+0x1cd): undefined reference to `nc_inq_varndims'
(.text+0x2c9): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int1_':
(.text+0x35d): undefined reference to `nc_inq_varndims'
(.text+0x459): undefined reference to `nc_put_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int2_':
(.text+0x4ed): undefined reference to `nc_inq_varndims'
(.text+0x5e9): undefined reference to `nc_put_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int_':
(.text+0x67d): undefined reference to `nc_inq_varndims'
(.text+0x779): undefined reference to `nc_put_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_real_':
(.text+0x80d): undefined reference to `nc_inq_varndims'
(.text+0x909): undefined reference to `nc_put_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_double_':
(.text+0x99d): undefined reference to `nc_inq_varndims'
(.text+0xa99): undefined reference to `nc_put_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_':
(.text+0xb2d): undefined reference to `nc_inq_varndims'
(.text+0xc29): undefined reference to `nc_put_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_':
(.text+0xd31): undefined reference to `nc_inq_varndims'
(.text+0xe3a): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_a_':
(.text+0xefd): undefined reference to `nc_inq_varndims'
(.text+0xff9): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int1_':
(.text+0x108d): undefined reference to `nc_inq_varndims'
(.text+0x1189): undefined reference to `nc_get_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int2_':
(.text+0x121d): undefined reference to `nc_inq_varndims'
(.text+0x1319): undefined reference to `nc_get_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int_':
(.text+0x13ad): undefined reference to `nc_inq_varndims'
(.text+0x14a9): undefined reference to `nc_get_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_real_':
(.text+0x153d): undefined reference to `nc_inq_varndims'
(.text+0x1639): undefined reference to `nc_get_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_double_':
(.text+0x16cd): undefined reference to `nc_inq_varndims'
(.text+0x17c9): undefined reference to `nc_get_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_':
(.text+0x185d): undefined reference to `nc_inq_varndims'
(.text+0x1959): undefined reference to `nc_get_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_':
(.text+0x7e): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_a_':
(.text+0x20e): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int1_':
(.text+0x39e): undefined reference to `nc_put_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int2_':
(.text+0x52e): undefined reference to `nc_put_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int_':
(.text+0x6be): undefined reference to `nc_put_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_real_':
(.text+0x84e): undefined reference to `nc_put_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_double_':
(.text+0x9de): undefined reference to `nc_put_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_':
(.text+0xb6e): undefined reference to `nc_put_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_':
(.text+0xd72): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_a_':
(.text+0xf3e): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int1_':
(.text+0x10ce): undefined reference to `nc_get_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int2_':
(.text+0x125e): undefined reference to `nc_get_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int_':
(.text+0x13ee): undefined reference to `nc_get_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_real_':
(.text+0x157e): undefined reference to `nc_get_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_double_':
(.text+0x170e): undefined reference to `nc_get_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_':
(.text+0x189e): undefined reference to `nc_get_vara'
collect2: error: ld returned 1 exit status
makefile:62: recipe for target 'mmif' failed
make: *** [mmif] Error 1
makefile
#
# Makefile for MMIF VERSION 3.4.1 2019-03-11
#
# Edit this file to un-comment the section for your compiler.
# You will also need to edit the line that specifies where to find the
# NetCDF libraries, which must be compiled by the same compiler.
# The directory "netcdf.4.1.1-mingw" is used to commpile under MS Windows.
# It was compiled using MinGW version 20110802, see http://www.mingw.org,
# and the script compile_netcdf_mingw.sh.
#
# PGI started linking with the OpenMP library by default in their 11.0 release,
# so that users would be able to use CPU binding even with serial code.
# Adding "-mp=nonuma -nomp" to FFLAGS fixes "can't find libnuma.so" problems.
# PGI Fortran:
# FC = pgf90
# FFLAGS = -g -fast -Mlfs # -Mlfs is default on for x86_64
# FFLAGS += -Mbounds # for bounds checking/debugging
# FFLAGS += -Bstatic_pgi # to use static PGI libraries
# FFLAGS += -Bstatic # to use static netCDF libraries
# FFLAGS += -mp=nonuma -nomp # fix for "can't find libnuma.so"
# NETCDF = /usr/local/src/netcdf-4.1.1.pgi
# GNU gfortran (Windows or Linux, just set NETCDF below correctly)
FC = gfortran
FFLAGS = -g -Wall
FFLAGS += -fbounds-check # for bounds checking/debugging
FFLAGS += -static # to use static libraries
NETCDF = /usr
# Intel Fortran:
#FC = ifort
#FFLAGS = -O2 -align dcommons -ipo
#FFLAGS += -static # to use static libraries
#NETCDF = /path/to/netcdf-4.1.1.ifort
# NETCDF values that are the same for all compilers
INCL = -I$(NETCDF)/include
LIBS = -L/usr/lib/x86_64-linux-gnu -lnetcdff
PROGRAM = mmif
TODAY = 2019-03-11
VERSION = 3.4.1
NEWTAG = 3.4.1 2019-03-11
OLDTAG = 3.4.1 2019-03-01
MODULES = met_fields.f90 functions.f90 module_llxy.f90 wrf_netcdf.f90 \
parse_control.f90
SOURCES = aggregate.f90 avg_zface.f90 cloud_cover.f90 interpolate.f90 \
landuse.f90 mmif.f90 output_aercoare.f90 output_aermet.f90 \
output_calmet.f90 output_onsite.f90 output_scichem.f90 \
pasquill_gifford.f90 pbl_height.f90 read_mm5.f90 read_wrf.f90 \
sfc_layer.f90 timesubs.f90
OBJECTS = $(SOURCES:.f90=.o)
MODOBJS = $(MODULES:.f90=.o)
MODMODS = $(MODULES:.f90=.mod)
$(PROGRAM): $(MODOBJS) $(OBJECTS)
$(FC) $(FFLAGS) $(MODOBJS) $(OBJECTS) $(LIBS) -o $#
%.o : %.f90
$(FC) $(FFLAGS) $(INCL) -c $< -o $#
install: $(PROGRAM)
cp $(PROGRAM) /usr/local/bin
update_version:
sed -i "s|VERSION $(OLDTAG)|VERSION $(NEWTAG)|g" \
*.f90 README.txt makefile makefile.windows mmif_change_log.txt
distro:
mmif --sample > mmif.inp
unix2dos *.f90 *.sh makefile.windows old_compile.bat README*.txt mmif.inp
zip -j MMIFv$(VERSION)_$(TODAY).zip \
mmif.exe mmif mmif.inp *.f90 *.sh makefile \
makefile.windows old_compile.bat README*.txt \
MMIFv$(VERSION)_Users_Manual.pdf \
mmif_change_log.txt test_problems/*/*.inp
dos2unix *.f90
test_pkg:
zip -r MMIFv$(VERSION)_test_problems.zip \
test_problems -x \*/wrf/\* \*/mm5/\*
test_pkg_mm5+wrf:
zip -r MMIF_test_problems_mm5+wrf.zip \
test_problems/wrf \
test_problems/mm5
clean:
rm $(MODMODS) $(MODOBJS) $(OBJECTS) $(PROGRAM)
Library
-------
This netCDF 4.6.0 has been built with the following features:
--cc -> /usr/bin/cc
--cflags -> -I/usr/include -I/usr/include/hdf5/serial
--libs -> -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf -lhdf5_hl -lhdf5 -lpthread -lsz -lz -ldl -lm -lcurl
--has-c++ -> no
--cxx ->
--has-c++4 -> no
--cxx4 ->
--has-fortran-> yes
--fc -> gfortran
--fflags -> -I/usr/include
--flibs -> -L/usr/lib -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf
--has-f90 -> no
--has-f03 -> yes
--has-dap -> yes
--has-dap2 -> yes
--has-dap4 -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> no
--has-logging-> no
--has-pnetcdf-> no
--has-szlib -> no
--has-cdf5 -> no
--has-parallel-> no
--prefix -> /usr
--includedir-> /usr/include
--libdir -> /usr/lib/x86_64-linux-gnu
--version -> netCDF 4.6.0

Crosstool-ng g++ not compiling c++11 std::current_exception

I build a gcc toolchain using Crosstool-ng, but the resulting g++ does not compile and/or link C++11 exceptions.
If I try to compile:
#include <exception>
int main()
{
std::current_exception();
}
via:
arm-none-linux-gnueabihf-g++ -std=c++11 foo.cpp
I get:
foo.cpp: In function 'int main()':
foo.cpp:5:9: error: 'current_exception' is not a member of 'std'
std::current_exception();
^~~
However, if I additionally provide cortex-a9 as cpu the haviour changes:
arm-none-linux-gnueabihf-g++ -mcpu=cortex-a9 -std=c++11 foo.cpp
results in:
/tmp/cc13AEjE.o: In function `main':
foo.cpp:(.text+0x14): undefined reference to `std::current_exception()'
foo.cpp:(.text+0x20): undefined reference to
`std::__exception_ptr::exception_ptr::~exception_ptr()'
collect2: error: ld returned 1 exit status
I greped within the toolchain for current_exception and it seems good for me:
grep -r -e current_exception arm-none-linux-gnueabihf/
Binary file arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/sysroot/lib/libstdc++.so.6.0.22 matches
Binary file arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/sysroot/lib/libstdc++.a matches
Binary file arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/sysroot/lib/libsupc++.a matches
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/cxxabi.h: __cxa_current_exception_type() _GLIBCXX_NOTHROW __attribute__ ((__pure__));
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/future: (*_M_result)->_M_error = current_exception();
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/future: (*_M_result)->_M_error = current_exception();
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/bits/exception_ptr.h: exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT;
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/bits/exception_ptr.h: friend exception_ptr std::current_exception() _GLIBCXX_USE_NOEXCEPT;
arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/include/c++/6.3.0/bits/exception_ptr.h: return current_exception();
arm-none-linux-gnueabihf/arm-none-linux- gnueabihf/include/c++/6.3.0/bits/nested_exception.h: nested_exception() noexcept : _M_ptr(current_exception()) { }
The settings I used for Crosstool-ng are:
arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++ -v
Using built-in specs.
COLLECT_GCC=x-tools/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/home/builduser/x-tools/arm-none-linux-gnueabihf/libexec/gcc/arm-none-linux-gnueabihf/6.3.0/lto-wrapper
Target: arm-none-linux-gnueabihf
Configured with: /home/builduser/build/.build/src/gcc-6.3.0/configure
--build=x86_64-build_pc-linux-gnu
--host=x86_64-build_pc-linux-gnu
--target=arm-none-linux-gnueabihf
--prefix=/home/builduser/x-tools/arm-none-linux-gnueabihf
--with-sysroot=/home/builduser/x-tools/arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/sysroot
--enable-languages=c,c++
--with-float=hard
--with-pkgversion='crosstool-NG crosstool-ng-1.23.0'
--disable-sjlj-exceptions
--enable-__cxa_atexit
--disable-libmudflap
--disable-libgomp
--disable-libssp
--disable-libquadmath
--disable-libquadmath-support
--disable-libsanitizer
--disable-libmpx
--with-gmp=/home/builduser/build/.build/arm-none-linux-gnueabihf/buildtools
--with-mpfr=/home/builduser/build/.build/arm-none-linux-gnueabihf/buildtools
--with-mpc=/home/builduser/build/.build/arm-none-linux-gnueabihf/buildtools
--with-isl=/home/builduser/build/.build/arm-none-linux-gnueabihf/buildtools
--disable-lto
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm'
--enable-threads=posix
--enable-target-optspace
--disable-plugin
--disable-nls
--disable-multilib
--with-local-prefix=/home/builduser/x-tools/arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/sysroot
--enable-long-long
Thread model: posix
gcc version 6.3.0 (crosstool-NG crosstool-ng-1.23.0)
Building a std::array example works fine.
EDIT:
If I include the CT_ARCH_CPU="cortex-a9" option to my crostool-ng configuration (which leads to a --with-cpu=cortex-a9 within g++) the std::current_exception example works fine.
So the question is:
Why does the cpu variant the compiler should generate code for and the way the cpu variant is told to the toolchain (-mcpu at runtime vs. inbuild --with-cpu) is influencing the ability to compile/link std::current_exception?

MPFR 3.1.3 fails with "illegal thread local variable reference to regular symbol" on Mac + Intel 15

I downloaded MPFR 3.1.3 from http://www.mpfr.org/mpfr-current/ and attempted to compile with Intel 15 (icc --version returns icc (ICC) 15.0.3 20150408) on Mac Yosemite (10.10.4).
The build fails at this point:
jrhammon-mac01:build jrhammon$ make
Making all in doc
make[1]: Nothing to be done for `all'.
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
/bin/sh ../libtool --tag=CC --mode=link icc -Wall -Wmissing-prototypes -Wpointer-arith -fp_port -mp -wd1572 -wd265 -wd186 -wd239 -g -O2 -version-info 5:3:1 -Wl,-search_paths_first -o libmpfr.la -rpath /usr/local/lib exceptions.lo extract.lo uceil_exp2.lo uceil_log2.lo ufloor_log2.lo add.lo add1.lo add_ui.lo agm.lo clear.lo cmp.lo cmp_abs.lo cmp_si.lo cmp_ui.lo comparisons.lo div_2exp.lo div_2si.lo div_2ui.lo div.lo div_ui.lo dump.lo eq.lo exp10.lo exp2.lo exp3.lo exp.lo frac.lo frexp.lo get_d.lo get_exp.lo get_str.lo init.lo inp_str.lo isinteger.lo isinf.lo isnan.lo isnum.lo const_log2.lo log.lo modf.lo mul_2exp.lo mul_2si.lo mul_2ui.lo mul.lo mul_ui.lo neg.lo next.lo out_str.lo printf.lo vasprintf.lo const_pi.lo pow.lo pow_si.lo pow_ui.lo print_raw.lo print_rnd_mode.lo reldiff.lo round_prec.lo set.lo setmax.lo setmin.lo set_d.lo set_dfl_prec.lo set_exp.lo set_rnd.lo set_f.lo set_prc_raw.lo set_prec.lo set_q.lo set_si.lo set_str.lo set_str_raw.lo set_ui.lo set_z.lo sqrt.lo sqrt_ui.lo sub.lo sub1.lo sub_ui.lo rint.lo ui_div.lo ui_sub.lo urandom.lo urandomb.lo get_z_exp.lo swap.lo factorial.lo cosh.lo sinh.lo tanh.lo sinh_cosh.lo acosh.lo asinh.lo atanh.lo atan.lo cmp2.lo exp_2.lo asin.lo const_euler.lo cos.lo sin.lo tan.lo fma.lo fms.lo hypot.lo log1p.lo expm1.lo log2.lo log10.lo ui_pow.lo ui_pow_ui.lo minmax.lo dim.lo signbit.lo copysign.lo setsign.lo gmp_op.lo init2.lo acos.lo sin_cos.lo set_nan.lo set_inf.lo set_zero.lo powerof2.lo gamma.lo set_ld.lo get_ld.lo cbrt.lo volatile.lo fits_sshort.lo fits_sint.lo fits_slong.lo fits_ushort.lo fits_uint.lo fits_ulong.lo fits_uintmax.lo fits_intmax.lo get_si.lo get_ui.lo zeta.lo cmp_d.lo erf.lo inits.lo inits2.lo clears.lo sgn.lo check.lo sub1sp.lo version.lo mpn_exp.lo mpfr-gmp.lo mp_clz_tab.lo sum.lo add1sp.lo free_cache.lo si_op.lo cmp_ld.lo set_ui_2exp.lo set_si_2exp.lo set_uj.lo set_sj.lo get_sj.lo get_uj.lo get_z.lo iszero.lo cache.lo sqr.lo int_ceil_log2.lo isqrt.lo strtofr.lo pow_z.lo logging.lo mulders.lo get_f.lo round_p.lo erfc.lo atan2.lo subnormal.lo const_catalan.lo root.lo sec.lo csc.lo cot.lo eint.lo sech.lo csch.lo coth.lo round_near_x.lo constant.lo abort_prec_max.lo stack_interface.lo lngamma.lo zeta_ui.lo set_d64.lo get_d64.lo jn.lo yn.lo rem1.lo get_patches.lo add_d.lo sub_d.lo d_sub.lo mul_d.lo div_d.lo d_div.lo li2.lo rec_sqrt.lo min_prec.lo buildopt.lo digamma.lo bernoulli.lo isregular.lo set_flt.lo get_flt.lo scale2.lo set_z_exp.lo ai.lo gammaonethird.lo grandom.lo -lgmp
libtool: link: icc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libmpfr.4.dylib .libs/exceptions.o .libs/extract.o .libs/uceil_exp2.o .libs/uceil_log2.o .libs/ufloor_log2.o .libs/add.o .libs/add1.o .libs/add_ui.o .libs/agm.o .libs/clear.o .libs/cmp.o .libs/cmp_abs.o .libs/cmp_si.o .libs/cmp_ui.o .libs/comparisons.o .libs/div_2exp.o .libs/div_2si.o .libs/div_2ui.o .libs/div.o .libs/div_ui.o .libs/dump.o .libs/eq.o .libs/exp10.o .libs/exp2.o .libs/exp3.o .libs/exp.o .libs/frac.o .libs/frexp.o .libs/get_d.o .libs/get_exp.o .libs/get_str.o .libs/init.o .libs/inp_str.o .libs/isinteger.o .libs/isinf.o .libs/isnan.o .libs/isnum.o .libs/const_log2.o .libs/log.o .libs/modf.o .libs/mul_2exp.o .libs/mul_2si.o .libs/mul_2ui.o .libs/mul.o .libs/mul_ui.o .libs/neg.o .libs/next.o .libs/out_str.o .libs/printf.o .libs/vasprintf.o .libs/const_pi.o .libs/pow.o .libs/pow_si.o .libs/pow_ui.o .libs/print_raw.o .libs/print_rnd_mode.o .libs/reldiff.o .libs/round_prec.o .libs/set.o .libs/setmax.o .libs/setmin.o .libs/set_d.o .libs/set_dfl_prec.o .libs/set_exp.o .libs/set_rnd.o .libs/set_f.o .libs/set_prc_raw.o .libs/set_prec.o .libs/set_q.o .libs/set_si.o .libs/set_str.o .libs/set_str_raw.o .libs/set_ui.o .libs/set_z.o .libs/sqrt.o .libs/sqrt_ui.o .libs/sub.o .libs/sub1.o .libs/sub_ui.o .libs/rint.o .libs/ui_div.o .libs/ui_sub.o .libs/urandom.o .libs/urandomb.o .libs/get_z_exp.o .libs/swap.o .libs/factorial.o .libs/cosh.o .libs/sinh.o .libs/tanh.o .libs/sinh_cosh.o .libs/acosh.o .libs/asinh.o .libs/atanh.o .libs/atan.o .libs/cmp2.o .libs/exp_2.o .libs/asin.o .libs/const_euler.o .libs/cos.o .libs/sin.o .libs/tan.o .libs/fma.o .libs/fms.o .libs/hypot.o .libs/log1p.o .libs/expm1.o .libs/log2.o .libs/log10.o .libs/ui_pow.o .libs/ui_pow_ui.o .libs/minmax.o .libs/dim.o .libs/signbit.o .libs/copysign.o .libs/setsign.o .libs/gmp_op.o .libs/init2.o .libs/acos.o .libs/sin_cos.o .libs/set_nan.o .libs/set_inf.o .libs/set_zero.o .libs/powerof2.o .libs/gamma.o .libs/set_ld.o .libs/get_ld.o .libs/cbrt.o .libs/volatile.o .libs/fits_sshort.o .libs/fits_sint.o .libs/fits_slong.o .libs/fits_ushort.o .libs/fits_uint.o .libs/fits_ulong.o .libs/fits_uintmax.o .libs/fits_intmax.o .libs/get_si.o .libs/get_ui.o .libs/zeta.o .libs/cmp_d.o .libs/erf.o .libs/inits.o .libs/inits2.o .libs/clears.o .libs/sgn.o .libs/check.o .libs/sub1sp.o .libs/version.o .libs/mpn_exp.o .libs/mpfr-gmp.o .libs/mp_clz_tab.o .libs/sum.o .libs/add1sp.o .libs/free_cache.o .libs/si_op.o .libs/cmp_ld.o .libs/set_ui_2exp.o .libs/set_si_2exp.o .libs/set_uj.o .libs/set_sj.o .libs/get_sj.o .libs/get_uj.o .libs/get_z.o .libs/iszero.o .libs/cache.o .libs/sqr.o .libs/int_ceil_log2.o .libs/isqrt.o .libs/strtofr.o .libs/pow_z.o .libs/logging.o .libs/mulders.o .libs/get_f.o .libs/round_p.o .libs/erfc.o .libs/atan2.o .libs/subnormal.o .libs/const_catalan.o .libs/root.o .libs/sec.o .libs/csc.o .libs/cot.o .libs/eint.o .libs/sech.o .libs/csch.o .libs/coth.o .libs/round_near_x.o .libs/constant.o .libs/abort_prec_max.o .libs/stack_interface.o .libs/lngamma.o .libs/zeta_ui.o .libs/set_d64.o .libs/get_d64.o .libs/jn.o .libs/yn.o .libs/rem1.o .libs/get_patches.o .libs/add_d.o .libs/sub_d.o .libs/d_sub.o .libs/mul_d.o .libs/div_d.o .libs/d_div.o .libs/li2.o .libs/rec_sqrt.o .libs/min_prec.o .libs/buildopt.o .libs/digamma.o .libs/bernoulli.o .libs/isregular.o .libs/set_flt.o .libs/get_flt.o .libs/scale2.o .libs/set_z_exp.o .libs/ai.o .libs/gammaonethird.o .libs/grandom.o -lgmp -mp -g -O2 -Wl,-search_paths_first -mp -install_name /usr/local/lib/libmpfr.4.dylib -compatibility_version 6 -current_version 6.3 -Wl,-single_module
icc: command line remark #10148: option '-mp' not supported
icc: command line remark #10148: option '-mp' not supported
ld: illegal thread local variable reference to regular symbol __tls___mpfr_allocate_func for architecture x86_64
make[2]: *** [libmpfr.la] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
I have never seen this error before. Is it a bug in MPFR, the Intel compiler or the Mac toolchain? I am using the system install of GMP (from Homebrew), which I assume is built with Clang, not Intel. Is there a C ABI incompatibility issue here with TLS?
I found https://github.com/feeley/gambit/issues/109 and https://trac.mpich.org/projects/mpich/ticket/1547, which suggest that it is a Mac issue, but I am able to build with CC=clang so I guess it has something to do with Intel.
I have got MPFR to build in the past with Intel compilers, but (apparently) had to apply this patch: https://github.com/hpcugent/easybuild-easyconfigs/blob/master/easybuild/easyconfigs/m/MPFR/MPFR_ictce_remove-deprecated-mp.patch .
Maybe the warnings you're getting aren't so harmless as they seem.

sparse - Fixing build warnings

I'm compiling the sparse - linux kernel checking tool.
But it throws the following warning:
lovegcy#knltest-VirtualBox:~/git_root/sparse$ make
GEN version.h
/bin/sh: 1: llvm-config: not found
Makefile:63: Your system does not have libxml, disabling c2xml
Makefile:75: Your system does not have libgtk2, disabling test-inspect
Makefile:79: Your system does not have llvm, disabling sparse-llvm
CC test-lexing.o
CC target.o
CC parse.o
CC tokenize.o
CC pre-process.o
CC symbol.o
CC lib.o
CC scope.o
CC expression.o
CC show-parse.o
CC evaluate.o
CC expand.o
CC inline.o
CC linearize.o
CC char.o
CC sort.o
CC allocate.o
CC compat-linux.o
CC ptrlist.o
CC flow.o
CC cse.o
CC simplify.o
CC memops.o
CC liveness.o
CC storage.o
CC unssa.o
CC dissect.o
AR libsparse.a
LINK test-lexing
CC test-parsing.o
LINK test-parsing
CC obfuscate.o
LINK obfuscate
CC compile.o
CC compile-i386.o
compile-i386.c: In function ‘emit_insn_atom’:
compile-i386.c:719:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
LINK compile
CC graph.o
LINK graph
CC sparse.o
LINK sparse
CC test-linearize.o
LINK test-linearize
CC example.o
LINK example
CC test-unssa.o
LINK test-unssa
CC test-dissect.o
LINK test-dissect
CC ctags.o
LINK ctags
GEN sparse.pc
Fix the following
Makefile:63: Your system does not have libxml, disabling c2xml
Makefile:75: Your system does not have libgtk2, disabling test-inspect
by:
$ sudo apt-get install libxml2-dev libgtk2.0-dev
For
/bin/sh: 1: llvm-config: not found
Makefile:79: Your system does not have llvm, disabling sparse-llvm
the llvm-3.2-dev is installed, but it is still there.
I still donot know how to fix the following warning too:
compile-i386.c: In function ‘emit_insn_atom’:
compile-i386.c:719:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
Could anyone give some suggestions?
Thank you very much!
Update : Following TheCodeArtist's suggestion, here is the build error log after llvm installed.
lovegcy#knltest-VirtualBox:~/git_root/sparse$ make
CC test-lexing.o
CC target.o
CC parse.o
CC tokenize.o
CC pre-process.o
CC symbol.o
CC lib.o
CC scope.o
CC expression.o
CC show-parse.o
CC evaluate.o
CC expand.o
CC inline.o
CC linearize.o
CC char.o
CC sort.o
CC allocate.o
CC compat-linux.o
CC ptrlist.o
CC flow.o
CC cse.o
CC simplify.o
CC memops.o
CC liveness.o
CC storage.o
CC unssa.o
CC dissect.o
AR libsparse.a
LINK test-lexing
CC test-parsing.o
LINK test-parsing
CC obfuscate.o
LINK obfuscate
CC compile.o
CC compile-i386.o
compile-i386.c: In function ‘emit_insn_atom’:
compile-i386.c:719:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
LINK compile
CC graph.o
LINK graph
CC sparse.o
LINK sparse
CC test-linearize.o
LINK test-linearize
CC example.o
LINK example
CC test-unssa.o
LINK test-unssa
CC test-dissect.o
LINK test-dissect
CC ctags.o
LINK ctags
CC c2xml.o
LINK c2xml
CC test-inspect.o
CC ast-model.o
CC ast-view.o
CC ast-inspect.o
LINK test-inspect
CC sparse-llvm.o
LINK sparse-llvm
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Signals.o): In function PrintStackTrace(void*)':
(.text+0x74): undefined reference todladdr'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Signals.o): In function PrintStackTrace(void*)':
(.text+0x1fe): undefined reference todladdr'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Mutex.o): In function llvm::sys::MutexImpl::MutexImpl(bool)':
(.text+0x58): undefined reference topthread_mutexattr_init'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Mutex.o): In function llvm::sys::MutexImpl::MutexImpl(bool)':
(.text+0x64): undefined reference topthread_mutexattr_settype'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Mutex.o): In function llvm::sys::MutexImpl::MutexImpl(bool)':
(.text+0x74): undefined reference topthread_mutexattr_setpshared'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Mutex.o): In function llvm::sys::MutexImpl::MutexImpl(bool)':
(.text+0x88): undefined reference topthread_mutexattr_destroy'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Mutex.o): In function llvm::sys::MutexImpl::tryacquire()':
(.text+0x179): undefined reference topthread_mutex_trylock'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::RWMutexImpl()':
(.text+0x3e): undefined reference topthread_rwlock_init'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::~RWMutexImpl()':
(.text+0x80): undefined reference topthread_rwlock_destroy'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::reader_acquire()':
(.text+0xb9): undefined reference topthread_rwlock_rdlock'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::reader_release()':
(.text+0xe9): undefined reference topthread_rwlock_unlock'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::writer_acquire()':
(.text+0x119): undefined reference topthread_rwlock_wrlock'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(RWMutex.o): In function llvm::sys::RWMutexImpl::writer_release()':
(.text+0x149): undefined reference topthread_rwlock_unlock'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(ThreadLocal.o): In function llvm::sys::ThreadLocalImpl::~ThreadLocalImpl()':
(.text+0x25): undefined reference topthread_key_delete'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(ThreadLocal.o): In function llvm::sys::ThreadLocalImpl::ThreadLocalImpl()':
(.text+0xae): undefined reference topthread_key_create'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(ThreadLocal.o): In function llvm::sys::ThreadLocalImpl::setInstance(void const*)':
(.text+0xe2): undefined reference topthread_setspecific'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(ThreadLocal.o): In function llvm::sys::ThreadLocalImpl::getInstance()':
(.text+0x10a): undefined reference topthread_getspecific'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Threading.o): In function llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
(.text+0x1c2): undefined reference topthread_create'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Threading.o): In function llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
(.text+0x1da): undefined reference topthread_join'
/usr/lib/llvm-3.2/lib/libLLVMSupport.a(Threading.o): In function llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
(.text+0x20c): undefined reference topthread_attr_setstacksize'
collect2: error: ld returned 1 exit status
make: * [sparse-llvm] Error 1
Properly installing llvm :
During the build, for make to detect llvm on the system ,llvm-config is required to be installed on your system properly. On Ubuntu, the following command will download(~16MB packages) and install all the dependencies correctly
$ sudo apt-get install llvm
Download the latest source of sparse
$ git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
Build and install sparse
$ cd sparse
$ make
$ make install
(Tested on Ubuntu 10.04)
Fixing the innocuous Warning :
The following error is harmless in the current context as we are not concerned with the result of the call to write() at line 719 of compile-i386.c
compile-i386.c:719:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
Fixing this error is as simple as modifying line 719 of compile-i386.c to
comment[0] = write(STDOUT_FILENO, s, strlen(s));
This warning is triggered during build due to the -Wall (Enable ALL warnings) flag passed to gcc at line 16 of the Makefile
CFLAGS += -Wall -Wwrite-strings

Compiling libshout using QT/qmake

I'm trying to link my QT application to a DLL (libshout), while building for Windows.
I've added the appropriate lines to my .pro file:
LIBS += -L/local/lib -lmp3lame
LIBS += -L/local/lib -lshout
LIBS += -L/local/lib -logg
LIBS += -L/local/lib -lvorbis
LIBS += -lwsock32
I've also successfully built and installed libshout to /local/lib (I'm using mingw and the gcc-dw2 compiler).
However, qmake fails to link successfully. I've pasted the gcc/make output below. I'm not even sure it's trying to link to the right library (isn't .a/.la a static library?).
I've been tearing my hair out for 3 days over this one so any help appreciated :)
g++-dw2 -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPP
ORT -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CO
RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../Qt/4.6.3/include/QtCore' -I
'../../Qt/4.6.3/include/QtNetwork' -I'../../Qt/4.6.3/include/QtGui' -I'../../Qt/
4.6.3/include/QtWebKit' -I'../../Qt/4.6.3/include' -I'../../Qt/4.6.3/include/Act
iveQt' -I'release' -I'../../Qt/4.6.3/mkspecs/win32-g++' -o release/qrc_resources
.o release/qrc_resources.cpp
g++-dw2 -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo
-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o build/release/MyApp.exe ob
ject_script.MyApp.Release -L'c:/Qt/4.6.3/lib' -lmingw32 -lqtmain -L/local/lib -
lmp3lame -L/local/lib -lshout -lwsock32 -lQtWebKit4 -lQtGui4 -lQtNetwork4 -lQtCo
re4
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `free_codec':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:188: undefined reference to `ogg_
stream_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `close_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:144: undefined reference to `ogg_
sync_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:90: undefined reference to `ogg_s
ync_buffer'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:92: undefined reference to `ogg_s
ync_wrote'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s
ync_pageout'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:95: undefined reference to `ogg_p
age_bos'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `open_codec':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_
page_serialno'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_
stream_init'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:155: undefined reference to `ogg_
stream_pagein'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:160: undefined reference to `ogg_
stream_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:117: undefined reference to `ogg_
page_serialno'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:119: undefined reference to `ogg_
stream_pagein'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s
ync_pageout'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `shout_open_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:74: undefined reference to `ogg_s
ync_init'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `free_vorbis_data':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:103: undefined reference to `v
orbis_info_clear'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:104: undefined reference to `v
orbis_comment_clear'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `read_vorbis_page':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:83: undefined reference to `vo
rbis_synthesis_headerin'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:82: undefined reference to `og
g_stream_packetout'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:91: undefined reference to `og
g_stream_packetout'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `vorbis_blocksize':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:110: undefined reference to `v
orbis_packet_blocksize'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `shout_open_vorbis':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:57: undefined reference to `vo
rbis_info_init'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:58: undefined reference to `vo
rbis_comment_init'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:60: undefined reference to `og
g_stream_packetout'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:62: undefined reference to `vo
rbis_synthesis_headerin'
collect2: ld returned 1 exit status
make[1]: *** [build/release/Myapp.exe] Error 1
make[1]: Leaving directory `/c/myapp_app/src'
make: *** [release] Error 2
My first guess would be that libogg and libvorbis aren't installed in /local/lib, did you check that they are there?

Resources