- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am trying to compile a code in a linux machine with intel compiler and i get the following warning message. the code compiles and the executable id created. the executable works for some cases and do not for others and i suspect that it might be due this compilation problem. what does this message mean? i am attaching my compilation log.
thank you
Ulas Im
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The undefined references means something (presumably a library) isn't getting linked in, perhaps those routines are from the netcdf library. Adding -c doesn't correct those errors, that simply causes the link to never occur so you never see the undefined references. Do not add -c to the $(EXE) rule. Resolving the undefined references is just a matter of getting the needed libraries on the ifort command line. The$(EXE) rule seems correct, but the $(ARC) rule has a problem which caused the ifort error you showed.
Inthe $(ARC) rule, remove the second $(F_COMMAND) (just above the 'rm' command). That is causing the ifort error you showed above. After removing, retry the make.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have a mistake in your makefile where the ifort command is executed using the -c "compile-only" option but where it was also supplied a static archive library name of libnetcdf.a. With this option the compiler expects to see Fortran source files but encountered the static archive, hence the warning.
These two ifort invocations in your makefile should not include the highlighted static archive reference:
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include /opt/netcdf/lib/libnetcdf.a../chem1_list.f90 ../var_tables.f90 ../grid_dims.f90 ../io_params.f90 ../vtab_fill.f90 ../node_mod.f90 ../mem_grid.f90 ../rconstants.f90 ../rams_grid.f90 ../lllc_utils.f90 ../adap_init_prepchem.f90 ../gridset_prepchem.f90 ../grid_dims_output.f90 ../anheader.f90 ../AeM_emission_factors.f90 ../3bem_plumerise.f90 ../emission_fields.f90 ../cetesb_update.f90 ../extrapolacao_update.f90 ../retro_emissions.f90 ../gfedv2_8days_emissions.f90 ../edgar_emissions.f90 ../gocart_emissions.f90 ../gocart_background.f90 ../fwb_awb_emissions.f90 ../biogenic_emissions.f90 ../fire_properties.f90 ../3bem_emissions.f90 ../convert_retro_to_racm.f90 ../convert_AeM_to_racm.f90 ../convert_bioge_to_racm.f90 ../prep_chem_sources_utils.f90 ../prep_chem_sources.f90
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include /opt/netcdf/lib/libnetcdf.a
Look in the makefile for a variable that is perhaps included in the associated rules for these ifort compile-only invocations and don't use the variable for those rules. The variable should only be used for the rule in your makefile that is producing the executable prep_chem_sources
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have a mistake in your makefile where the ifort command is executed using the -c "compile-only" option but where it was also supplied a static archive library name of libnetcdf.a. With this option the compiler expects to see Fortran source files but encountered the static archive, hence the warning.
These two ifort invocations in your makefile should not include the highlighted static archive reference:
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include /opt/netcdf/lib/libnetcdf.a../chem1_list.f90 ../var_tables.f90 ../grid_dims.f90 ../io_params.f90 ../vtab_fill.f90 ../node_mod.f90 ../mem_grid.f90 ../rconstants.f90 ../rams_grid.f90 ../lllc_utils.f90 ../adap_init_prepchem.f90 ../gridset_prepchem.f90 ../grid_dims_output.f90 ../anheader.f90 ../AeM_emission_factors.f90 ../3bem_plumerise.f90 ../emission_fields.f90 ../cetesb_update.f90 ../extrapolacao_update.f90 ../retro_emissions.f90 ../gfedv2_8days_emissions.f90 ../edgar_emissions.f90 ../gocart_emissions.f90 ../gocart_background.f90 ../fwb_awb_emissions.f90 ../biogenic_emissions.f90 ../fire_properties.f90 ../3bem_emissions.f90 ../convert_retro_to_racm.f90 ../convert_AeM_to_racm.f90 ../convert_bioge_to_racm.f90 ../prep_chem_sources_utils.f90 ../prep_chem_sources.f90
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include /opt/netcdf/lib/libnetcdf.a
Look in the makefile for a variable that is perhaps included in the associated rules for these ifort compile-only invocations and don't use the variable for those rules. The variable should only be used for the rule in your makefile that is producing the executable prep_chem_sources
Hello
in my makefile, i set a variable called NCDF_LIB, where i define the paths to netcdf include and lib paths as well as the lib file. when i define this as the following:
NCDF_LIBS=-I$(NETCDF)/include -L$(NETCDF)/lib -lnetcdf
i get an error during compilation saying :
.....
ar r prep_chem_sources.a *.o
ar: creating prep_chem_sources.a
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include -L/opt/netcdf/lib -lnetcdf
ifort: command line error: no files specified; for help type "ifort -help"
make: *** [prep_chem_sources.a] Error 1
the only way i could manage the code to compile was toset the static libnetcdf.a file, where this time i have the executable compiled with the warning i ve posted in my previous mail.
any ideas about this?
thanks a lot
Ulas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue with the ifort command line here is that no input files were provided to the compiler.If that's intended to be the final ifort command to produce the prep-chem_sources executable then you should not be using the -c option either. Not seeing the makefile, I don't know what else changed from what was used to produce the make.out attached earlier.
Ifcompilation of the source files requires accessing netcdf headers, then define a variable containing the path to the netcdf include component and use that and not NCDF_LIBS when compiling the source files. Next,remove the include component from NCDF_LIBS and only use that on the ifort command that produces theprep_chem_sources executable.
So define variables like:
NCDF_INC=-I$(NETCDF)/include
NCDF_LIBS=-L$(NETCDF)/lib -lnetcdf
and then use them as I indicated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue with the ifort command line here is that no input files were provided to the compiler.If that's intended to be the final ifort command to produce the prep-chem_sources executable then you should not be using the -c option either. Not seeing the makefile, I don't know what else changed from what was used to produce the make.out attached earlier.
Ifcompilation of the source files requires accessing netcdf headers, then define a variable containing the path to the netcdf include component and use that and not NCDF_LIBS when compiling the source files. Next,remove the include component from NCDF_LIBS and only use that on the ifort command that produces theprep_chem_sources executable.
So define variables like:
NCDF_INC=-I$(NETCDF)/include
NCDF_LIBS=-L$(NETCDF)/lib -lnetcdf
and then use them as I indicated.
Hello
i tried the above recommndations. However, when i remove the -c flag, i get netcdf errors like following:
/tmp/ifortKfy0aK.o: In function `vtables_scalar_new_':
../vtab_fill.f90:(.text+0x3c): undefined reference to `tokenize1_'
/tmp/ifortKfy0aK.o: In function `vtables_scalar_':
../vtab_fill.f90:(.text+0x175): undefined reference to `tokenize1_'
/tmp/ifortKfy0aK.o: In function `vtables2_':
../vtab_fill.f90:(.text+0x7ac): undefined reference to `tokenize1_'
/tmp/ifortZ132yP.o: In function `polarst_':
../rams_grid.f90:(.text+0x3128): undefined reference to `xy_ll_'
../rams_grid.f90:(.text+0x319b): undefined reference to `ae0_'
../rams_grid.f90:(.text+0x31bf): undefined reference to `ae0_'
../rams_grid.f90:(.text+0x31e6): undefined reference to `ae0_'
../rams_grid.f90:(.text+0x320d): undefined reference to `ae0_'
../rams_grid.f90:(.text+0x3234): undefined reference to `ae0_'
i defined a NCDF_INC and included that to the compiler options in my include_prep_chem_src.mk file (attached) and removed the inlude part of the NCDF_LIBS which is used in the Makefile (attached). that way i keep getting the error :
ifort -c -FR -O2 -convert big_endian -I/opt/netcdf/include
ifort: command line error: no files specified; for help type "ifort -help"
make: *** [prep_chem_sources.a] Error 1
Ulas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The undefined references means something (presumably a library) isn't getting linked in, perhaps those routines are from the netcdf library. Adding -c doesn't correct those errors, that simply causes the link to never occur so you never see the undefined references. Do not add -c to the $(EXE) rule. Resolving the undefined references is just a matter of getting the needed libraries on the ifort command line. The$(EXE) rule seems correct, but the $(ARC) rule has a problem which caused the ifort error you showed.
Inthe $(ARC) rule, remove the second $(F_COMMAND) (just above the 'rm' command). That is causing the ifort error you showed above. After removing, retry the make.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The undefined references means something (presumably a library) isn't getting linked in, perhaps those routines are from the netcdf library. Adding -c doesn't correct those errors, that simply causes the link to never occur so you never see the undefined references. Do not add -c to the $(EXE) rule. Resolving the undefined references is just a matter of getting the needed libraries on the ifort command line. The$(EXE) rule seems correct, but the $(ARC) rule has a problem which caused the ifort error you showed.
Inthe $(ARC) rule, remove the second $(F_COMMAND) (just above the 'rm' command). That is causing the ifort error you showed above. After removing, retry the make.
it finally worked...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're welcome. Glad to hear this is now working.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page