Compile only a few files with a particular flag.

Hi,I would like to know if there is a way to compile only a few modules/functions with a particular flag(Vmix,Baroclinic,Barotropic , not the entire POP module), While others would be done wiht the regular flags provided in the Macros. This is how I would the flags to be mpiifort (CESM related flags) othermodules.F90mpiifort (CESM flags) (my desired flags) mydesiredmodules.F90 It would be great if I could only have a subroutine of choice i.e vmix_coeffs only compiled this way. 
 

jedwards

CSEG and Liaisons
Staff member
Yes, you can use a Depends file.   Put the special instructions into a file called Depends.{machinename} or Depends.{compilername} in your case directory and they will be used in the build.    Here is an example Depends.gnu file, where we have added a -fcray-pointer flag to be applied only to geopk.F90 geopk.o:geopk.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -fcray-pointer $
 
Back
Top