|
365 | 365 | # general defaults |
366 | 366 | #----------------------------------------------------------------- |
367 | 367 |
|
| 368 | +# Check if the user has set environment variables for the Fortran compiler and math libraries. |
| 369 | +# If not, throw an error. |
| 370 | + |
| 371 | +ifndef FC |
| 372 | + $(error "Must set environment variable FC to a Fortran compiler (e.g. gfortran, ifort, pgfortran)") |
| 373 | +else ifeq ($(findstring ifort,$(FC)),ifort) |
| 374 | + $(info Using Legacy Intel Fortran compiler) |
| 375 | +else ifeq ($(findstring ifx,$(FC)),ifx) |
| 376 | + $(info Using Intel Fortran compiler) |
| 377 | +else ifeq ($(findstring gfortran,$(FC)),gfortran) |
| 378 | + $(info Using GNU Fortran compiler) |
| 379 | +else ifeq ($(findstring pgfortran,$(FC)),pgfortran) |
| 380 | + $(info Using PGI Fortran compiler) |
| 381 | +else |
| 382 | + $(error "Unsupported Fortran compiler. Must set environment variable FC to a Fortran compiler (e.g. gfortran, ifort, pgfortran)") |
| 383 | +endif |
| 384 | +ifndef CC |
| 385 | + $(error "Must set environment variable CC to a C compiler (e.g. gcc, icc, pgcc)") |
| 386 | +else ifeq ($(findstring gcc,$(CC)),gcc) |
| 387 | + $(info Using GNU C compiler) |
| 388 | +else ifeq ($(findstring icc,$(CC)),icc) |
| 389 | + $(info Using Legacy Intel C compiler) |
| 390 | +else ifeq ($(findstring icx,$(CC)),icx) |
| 391 | + $(info Using Intel C compiler) |
| 392 | +else ifeq ($(findstring pgcc,$(CC)),pgcc) |
| 393 | + $(info Using PGI C compiler) |
| 394 | +else |
| 395 | + $(error "Unsupported C compiler. Must set environment variable CC to a C compiler (e.g. gcc, icc, pgcc)") |
| 396 | +endif |
| 397 | + |
368 | 398 | # List of needed dependencies, will be appended if math or netcdf |
369 | 399 | # libraries are not found |
370 | 400 | NEEDED_DEPS = harvest |
|
0 commit comments