Skip to content

Commit

Permalink
Collect 3rd party LIBS information in dedicated variables so they can…
Browse files Browse the repository at this point in the history
… be placed

ahead of the standard C++ and Fortran link libraries during linking.
  • Loading branch information
theurich committed Nov 14, 2024
1 parent 66a3877 commit 669e46a
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ endif
ifeq ($(origin ESMF_F90LINKLIBS_ENV), environment)
ESMF_F90LINKLIBS = $(ESMF_F90LINKLIBS_ENV)
endif
ESMF_F90LINKLIBS +=
ESMF_F90LINKLIBS += $(ESMF_F90LINKLIBSTHIRD)
ESMF_F90ESMFLINKLIBS += -lesmf $(ESMF_F90LINKLIBS)
ESMF_F90ESMFPRELOADLINKLIBS += -lesmf $(ESMF_TRACE_DYNAMICLINKLIBS) $(ESMF_F90LINKLIBS)

Expand Down Expand Up @@ -1068,7 +1068,7 @@ endif
ifeq ($(origin ESMF_CXXLINKLIBS_ENV), environment)
ESMF_CXXLINKLIBS = $(ESMF_CXXLINKLIBS_ENV)
endif
ESMF_CXXLINKLIBS +=
ESMF_CXXLINKLIBS += $(ESMF_CXXLINKLIBSTHIRD)
ESMF_CXXESMFLINKLIBS += -lesmf $(ESMF_CXXLINKLIBS)

# - CLINKER
Expand Down Expand Up @@ -1331,9 +1331,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_MOAB_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_MOAB_INCLUDE)
endif
ifdef ESMF_MOAB_LIBS
ESMF_CXXLINKLIBS += $(ESMF_MOAB_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_MOAB_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_MOAB_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_MOAB_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_MOAB_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_MOAB_LIBS))))
endif
ifdef ESMF_MOAB_LIBPATH
Expand Down Expand Up @@ -1400,9 +1400,9 @@ ifdef ESMF_LAPACK_INTERNAL
ESMF_CPPFLAGS += -DESMF_LAPACK_INTERNAL=1
endif
ifdef ESMF_LAPACK_LIBS
ESMF_CXXLINKLIBS += $(ESMF_LAPACK_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_LAPACK_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_LAPACK_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_LAPACK_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_LAPACK_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_LAPACK_LIBS))))
endif
ifdef ESMF_LAPACK_LIBPATH
Expand Down Expand Up @@ -1446,9 +1446,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_ACC_SOFTWARE_STACK_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_ACC_SOFTWARE_STACK_INCLUDE)
endif
ifdef ESMF_ACC_SOFTWARE_STACK_LIBS
ESMF_CXXLINKLIBS += $(ESMF_ACC_SOFTWARE_STACK_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_ACC_SOFTWARE_STACK_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_ACC_SOFTWARE_STACK_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_ACC_SOFTWARE_STACK_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_ACC_SOFTWARE_STACK_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_ACC_SOFTWARE_STACK_LIBS))))
endif
ifdef ESMF_ACC_SOFTWARE_STACK_LIBPATH
Expand Down Expand Up @@ -1580,12 +1580,12 @@ ifdef ESMF_NETCDF
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_NETCDFF_INCLUDE)
endif
ifdef ESMF_NETCDF_LIBS
ESMF_CXXLINKLIBS += $(ESMF_NETCDF_LIBS)
ESMF_F90LINKLIBS += $(ESMF_NETCDF_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_NETCDF_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_NETCDF_LIBS)
endif
ifdef ESMF_NETCDFF_LIBS
ESMF_CXXLINKLIBS += $(ESMF_NETCDFF_LIBS)
ESMF_F90LINKLIBS += $(ESMF_NETCDFF_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_NETCDFF_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_NETCDFF_LIBS)
endif
ifdef ESMF_NETCDF_LIBPATH
ESMF_CXXLINKPATHSTHIRD += $(addprefix -L,$(ESMF_NETCDF_LIBPATH))
Expand Down Expand Up @@ -1623,9 +1623,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_PNETCDF_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_PNETCDF_INCLUDE)
endif
ifdef ESMF_PNETCDF_LIBS
ESMF_CXXLINKLIBS += $(ESMF_PNETCDF_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_PNETCDF_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PNETCDF_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_PNETCDF_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_PNETCDF_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PNETCDF_LIBS))))
endif
ifdef ESMF_PNETCDF_LIBPATH
Expand All @@ -1652,9 +1652,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_XERCES_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_XERCES_INCLUDE)
endif
ifdef ESMF_XERCES_LIBS
ESMF_CXXLINKLIBS += $(ESMF_XERCES_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_XERCES_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_XERCES_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_XERCES_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_XERCES_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_XERCES_LIBS))))
endif
ifdef ESMF_XERCES_LIBPATH
Expand Down Expand Up @@ -1690,9 +1690,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_YAMLCPP_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_YAMLCPP_INCLUDE)
endif
ifdef ESMF_YAMLCPP_LIBS
ESMF_CXXLINKLIBS += $(ESMF_YAMLCPP_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_YAMLCPP_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_YAMLCPP_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_YAMLCPP_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_YAMLCPP_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_YAMLCPP_LIBS))))
endif
ifdef ESMF_YAMLCPP_LIBPATH
Expand Down Expand Up @@ -1737,9 +1737,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_PIO_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_PIO_INCLUDE)
endif
ifdef ESMF_PIO_LIBS
ESMF_CXXLINKLIBS += $(ESMF_PIO_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_PIO_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PIO_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_PIO_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_PIO_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PIO_LIBS))))
endif
ifdef ESMF_PIO_LIBPATH
Expand Down Expand Up @@ -1776,9 +1776,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_PROJ4_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_PROJ4_INCLUDE)
endif
ifdef ESMF_PROJ4_LIBS
ESMF_CXXLINKLIBS += $(ESMF_PROJ4_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_PROJ4_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PROJ4_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_PROJ4_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_PROJ4_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_PROJ4_LIBS))))
endif
ifdef ESMF_PROJ4_LIBPATH
Expand All @@ -1805,9 +1805,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_BABELTRACE_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_BABELTRACE_INCLUDE)
endif
ifdef ESMF_BABELTRACE_LIBS
ESMF_CXXLINKLIBS += $(ESMF_BABELTRACE_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_BABELTRACE_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_BABELTRACE_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_BABELTRACE_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_BABELTRACE_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_BABELTRACE_LIBS))))
endif
ifdef ESMF_BABELTRACE_LIBPATH
Expand Down Expand Up @@ -1841,9 +1841,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_NUMA_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_NUMA_INCLUDE)
endif
ifdef ESMF_NUMA_LIBS
ESMF_CXXLINKLIBS += $(ESMF_NUMA_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_NUMA_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_NUMA_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_NUMA_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_NUMA_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_NUMA_LIBS))))
endif
ifdef ESMF_NUMA_LIBPATH
Expand Down Expand Up @@ -1877,9 +1877,9 @@ ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_NVML_INCLUDE)
ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_NVML_INCLUDE)
endif
ifdef ESMF_NVML_LIBS
ESMF_CXXLINKLIBS += $(ESMF_NVML_LIBS)
ESMF_CXXLINKLIBSTHIRD += $(ESMF_NVML_LIBS)
ESMF_CXXLINKRPATHSTHIRD += $(addprefix $(ESMF_CXXRPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_NVML_LIBS))))
ESMF_F90LINKLIBS += $(ESMF_NVML_LIBS)
ESMF_F90LINKLIBSTHIRD += $(ESMF_NVML_LIBS)
ESMF_F90LINKRPATHSTHIRD += $(addprefix $(ESMF_F90RPATHPREFIX),$(subst -L,,$(filter -L%,$(ESMF_NVML_LIBS))))
endif
ifdef ESMF_NVML_LIBPATH
Expand Down

0 comments on commit 669e46a

Please sign in to comment.