When trying to link phantom with libmcfost, the following error occurs:
Undefined symbols for architecture x86_64:
"___atom_type_MOD_atoms", referenced from:
___output_MOD_deallocate_atom_maps in libmcfost.a(output.o)
___output_MOD_allocate_atom_maps in libmcfost.a(output.o)
___read_params_MOD_read_para4 in libmcfost.a(read_param.o)
"___atom_type_MOD_n_atoms", referenced from:
___output_MOD_deallocate_atom_maps in libmcfost.a(output.o)
___output_MOD_allocate_atom_maps in libmcfost.a(output.o)
___read_params_MOD_read_para4 in libmcfost.a(read_param.o)
"___atom_type_MOD_nactiveatoms", referenced from:
___read_params_MOD_read_para4 in libmcfost.a(read_param.o)
"___atom_type_MOD_npassiveatoms", referenced from:
___read_params_MOD_read_para4 in libmcfost.a(read_param.o)
"___elements_type_MOD_read_abundance", referenced from:
___sph2mcfost_MOD_hydro_to_voronoi_atomic in libmcfost.a(SPH2mcfost.o)
___mhd2mcfost_MOD_read_spheregrid_ascii in libmcfost.a(mhd2mcfost.o)
___mhd2mcfost_MOD_setup_model1d_to_mcfost in libmcfost.a(mhd2mcfost.o)
"___elements_type_MOD_wght_per_h", referenced from:
___sph2mcfost_MOD_hydro_to_voronoi_atomic in libmcfost.a(SPH2mcfost.o)
___stars_MOD_star_rad in libmcfost.a(stars.o)
___mhd2mcfost_MOD_read_spheregrid_ascii in libmcfost.a(mhd2mcfost.o)
___mhd2mcfost_MOD_setup_model1d_to_mcfost in libmcfost.a(mhd2mcfost.o)
"___opacity_atom_MOD_contopac_atom_loc", referenced from:
___optical_depth_MOD_integ_ray_atom in libmcfost.a(optical_depth.o)
"___opacity_atom_MOD_itot", referenced from:
___optical_depth_MOD_integ_ray_atom in libmcfost.a(optical_depth.o)
"___opacity_atom_MOD_opacity_atom_bb_loc", referenced from:
___optical_depth_MOD_integ_ray_atom in libmcfost.a(optical_depth.o)
"___opacity_atom_MOD_psi", referenced from:
___optical_depth_MOD_integ_ray_atom in libmcfost.a(optical_depth.o)
"___wavelengths_gas_MOD_tab_lambda_nm", referenced from:
___output_MOD_write_total_flux in libmcfost.a(output.o)
___output_MOD_write_atomic_maps in libmcfost.a(output.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [phantom] Error 1
make[1]: *** [phantom] Error 2
make: *** [again] Error 2
the underlying cause was that .o files with explicit paths in the OBJECTS list (e.g. gas/atom_type.o) were not being included in the library when created with ar/ranlib. The pull request fixes this by using the VPATH variable to specify that one should also look in the gas/ directory for source files. The only side-effect of this is that all .o and .mod files will be created in the src directory even for files that are notionally in the gas directory. However this fixes the compile problem in a clean, simple way and also simplifies the Makefile.
When trying to link phantom with libmcfost, the following error occurs:
the underlying cause was that .o files with explicit paths in the OBJECTS list (e.g. gas/atom_type.o) were not being included in the library when created with ar/ranlib. The pull request fixes this by using the VPATH variable to specify that one should also look in the gas/ directory for source files. The only side-effect of this is that all .o and .mod files will be created in the src directory even for files that are notionally in the gas directory. However this fixes the compile problem in a clean, simple way and also simplifies the Makefile.