Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
1430 lines (1153 loc) · 57.8 KB
/
Copy pathMakefile
File metadata and controls
1430 lines (1153 loc) · 57.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Test whether required environment variables are set
# If not, attempt to determine them automatically
UNAME := $(shell uname)
# Identify HOST_NAME
ifndef HOST_NAME
ifneq ($(UNAME),Darwin)
# Assuming to work on some HPC cluster
ifeq ($(shell [ -e whereami ] && echo yes || echo no ),yes)
# Identify host from whereami-script
HOST_NAME = $(shell echo `./whereami|tail -1`)
ifneq (,$(findstring UNKNOWN,${HOST_NAME}))
# If no specific host identified, use default settings
HOST_NAME = default
endif
else
# If whereami-script not found, use default settings
HOST_NAME = default
endif
export HOST_NAME
ifeq (${HOST_NAME},default)
$(warning HOST_NAME not recognized. Using ${HOST_NAME})
endif
else
# Using MacOS, so assuming to work on a local device
HOST_NAME = DARWIN
endif
endif
# Identify compiler
ifndef COMPILER
ifeq ($(shell [ -e default_compiler ] && echo yes || echo no ),yes)
# Identify compiler from default_compiler-script
COMPILER = $(shell echo `./default_compiler|tail -1`)
else
# If script not found, use default compiler ifort64
COMPILER = ifort64
$(warning Using default compiler ${COMPILER})
endif
export COMPILER
endif
# Set SOLPSTOP and SOLPSLIB if not already defined in the environment
export SOLPSTOP ?= ${PWD}
export SOLPSLIB ?= ${PWD}/lib/${HOST_NAME}.${COMPILER}
# Include compiler settings
MAKES = ${SOLPSTOP}/Makefile
ifeq ($(shell [ -e SETUP/config.${HOST_NAME}.${COMPILER} ] && echo yes || echo no ),yes)
include SETUP/config.${HOST_NAME}.${COMPILER}
MAKES += ${SOLPSTOP}/SETUP/setup.csh.${HOST_NAME}.${COMPILER} ${SOLPSTOP}/SETUP/config.${HOST_NAME}.${COMPILER}
else
$(warning SETUP/config.${HOST_NAME}.${COMPILER} not found.)
endif
ifeq ($(shell [ -e SETUP/config.common.${COMPILER} ] && echo yes || echo no ),yes)
include SETUP/config.common.${COMPILER}
MAKES += ${SOLPSTOP}/SETUP/config.common.${COMPILER}
endif
# Include local compiler settings, if present
ifeq ($(shell [ -e SETUP/config.${HOST_NAME}.${COMPILER}.local ] && echo yes || echo no ),yes)
include SETUP/config.${HOST_NAME}.${COMPILER}.local
MAKES += ${SOLPSTOP}/SETUP/config.${HOST_NAME}.${COMPILER}.local
endif
ifeq ($(shell [ -e SETUP/setup.csh.${HOST_NAME}.${COMPILER}.local ] && echo yes || echo no ),yes)
MAKES += ${SOLPSTOP}/SETUP/setup.csh.${HOST_NAME}.${COMPILER}.local
endif
MAKETAGS ?= ctags -e -f
export MAKETAGS
# Setup debug flags
EXT_DBG =
ifdef SOLPS_DEBUG
EXT_DBG = .debug
OPT_DBG = -DTRACE=ON
endif
# Setup MPI flags
EXT_MPI =
MPI_OPTS = USE_MPI=-DUSE_MPI SOLPS_MPI=yes
ifdef SOLPS_MPI
EXT_MPI = .mpi
OPT_MPI = -DMPI=ON
else
OPT_MPI = -DMPI=OFF
endif
# Setup OpenMP flag
EXT_OPENMP =
ifdef SOLPS_OPENMP
EXT_OPENMP = .openmp
OPT_OPENMP = -DOPENMP=ON
endif
OMP_OPTB = USE_OPENMP=-D_OPENMP SOLPS_OPENMP=yes
OMP_OPTE = USE_OPENMP=-DUSE_OPENMP SOLPS_OPENMP=yes
OPT_NOX = LD_GR="" LD_GKS=""
TOOLSHORT = ${HOST_NAME}.${COMPILER}
TOOLCHAIN = ${HOST_NAME}.${COMPILER}${EXT_OPENMP}${EXT_MPI}${EXT_DBG}
# Sentinel files for the eirene cmake builds. cmake places libeirene.a in
# the build directory; this real-file target anchors each eirene* build.
# eirene_nox* no longer produces a separate libeirene_nox.a: since
# modules/Eirene/src/CMakeLists.txt always builds both the real-graphics
# (eirobj) and dummy-graphics (eirobjx) executables from the exact same
# EIRENE library in one configure, eirene_nox reduces to a plain alias
# for eirene (see the eirene_nox* recipes below).
LIBEIRENE_A = modules/Eirene/builds/standalone.${TOOLCHAIN}/libeirene.a
LIBEIRENE_A_MPI = modules/Eirene/builds/standalone.${TOOLSHORT}.mpi${EXT_DBG}/libeirene.a
LIBEIRENE_A_OPENMP = modules/Eirene/builds/standalone.${TOOLSHORT}.openmp${EXT_DBG}/libeirene.a
LIBEIRENE_A_OPENMP_MPI = modules/Eirene/builds/standalone.${TOOLSHORT}.openmp.mpi${EXT_DBG}/libeirene.a
ifdef LD_NETCDF
# Use actual exe file paths so parallel b25*/b25eirene* targets share a single
# real-file prerequisite, which GNU Make builds exactly once per invocation
# (unlike phony targets, which are re-run once per dependent in parallel builds).
NC_EXE_DIR = ${SOLPSTOP}/scripts/${TOOLSHORT}
NCEXECS = ${NC_EXE_DIR}/nc2text_simple.exe ${NC_EXE_DIR}/nc_reduce.exe
NCEXEC_NAMES = nc2text_simple nc_reduce
# Debug-mode NC executables. NC_EXE_DIR deliberately omits the debug suffix
# so the two paths form a consistent pair: non-debug = TOOLSHORT,
# debug = TOOLSHORT.debug. The debug NC executables are pre-built via
# real-file targets before b25*_debug / solps*_debug sub-makes start (see the
# b25%_debug / solps%_debug rules below), so those sub-makes find the non-debug
# NCEXECS files already present and skip rebuilding nc_reduce/nc2text_simple.
DEBUG_NC_EXE_DIR = ${SOLPSTOP}/scripts/${TOOLSHORT}.debug
DEBUG_NCEXECS = ${DEBUG_NC_EXE_DIR}/nc_reduce.exe ${DEBUG_NC_EXE_DIR}/nc2text_simple.exe
endif
# B25_SERIAL: targets that must be built serially before the parallel compilation.
# nc exes are excluded here because they are already handled once at the outer
# level via NCEXECS (real file-path targets), before any b25*/b25eirene* recipe
# starts. Including them here would cause b25 and b25eirene to re-invoke
# nc_reduce/nc2text_simple in parallel, racing on the shared standalone.* OBNDIR.
B25_SERIAL = mods
DEFLIBS =
DEGLIBS = -DGRAPHICS=ON
ifdef LIBGRS
DEGLIBS += -DLibGRS=${LIBGRS}
endif
ifdef LIBGKS
DEGLIBS += -DLibGKS=${LIBGKS}
endif
ifdef LIBX11
DEGLIBS += -DLibX11=${LIBX11}
endif
ifdef LIBXT
DEGLIBS += -DLibXt=${LIBXT}
endif
ifdef LIBZ
DEGLIBS += -DLibz=${LIBZ}
endif
ifdef LIBJSON
DEFLIBS += -DLibJSON=${LIBJSON}
endif
ifdef MODJSON
DEFLIBS += -DJSON_MODULES=${MODJSON}
endif
ifdef ADDLIBS
DEGLIBS += -DADD_LIBS="${ADDLIBS}"
endif
DEFOPTS =
ifdef LINK_OPTS
DEFOPTS += -DLINK_OPTIONS=${LINK_OPTS}
endif
ifdef FFLAGSEXTRA
DEFOPTS += -DFLAGS_EXTRA="${FFLAGSEXTRA}"
endif
ifdef SOLPS_DEBUG
DEFOPTS += -DCMAKE_BUILD_TYPE=Debug
endif
DEFMAKES = -DMAKES="${MAKES}"
CPLOPTS = -DB25_EIRENE=ON
DIMENSIONS = 0
ifeq ($(shell [ -s modules/B2.5/src/modules/b2mod_dimensions.F ] && echo yes || echo no ),yes)
DIMENSIONS = 1
CPLOPTS += -DDIMENSIONS_MODULE=yes
endif
ifeq ($(UNAME),Darwin)
NO_CMAKE := 1
endif
# Check if a legacy SOLPS4 directory is present
SOLPS4 ?= ${SOLPSTOP}/../[sS][oO][lL][pP][sS]4.3
ifeq ($(shell [ -d ${SOLPS4} ] && echo yes || echo no ),no)
$(warning No SOLPS4 directory present at '${SOLPS4}'. SOLPS4-to-5 converters will not be built.)
SOLPS4_MISSING := yes
endif
# MAKEO is the recursive-make incantation used by per-module recipes.
# When invoked from a parallel top-level (e.g. `make -j 32 solps_nox`) and no
# explicit MAKE_OPTIONS=-jN was set, ${MAKE} alone propagates GNU make's
# jobserver to sub-makes so that compilation jobs are shared across modules
# rather than being capped to N per module. Setting MAKE_OPTIONS=-jN at the
# top level still works (legacy behaviour) but disables the jobserver and
# only parallelises within each individual sub-make.
MAKEO = ${MAKE} ${MAKE_OPTIONS}
MAKEF = ${MAKEO} -f config/Makefile
ifndef NO_CMAKE
MAKEE = ${MAKEO}
else
MAKEE = ${MAKEF}
endif
ifeq (${DIMENSIONS},1)
MAKEE += DIMENSIONS_MODULE=yes
endif
ifdef NO_CMAKE
MAKEC = ${MAKEE}
MAKEX = ${MAKEE} ${OPT_NOX}
else
ifndef NO_MPI
include ${SOLPSTOP}/modules/Eirene/builds/binRelease/mpi_version.mk
endif
ifdef SOLPS_MPI
OPT_MPI += -DMPI_VERSION=${MPI_VERSION}
ifdef OPEN_MPI
OPT_MPI += -DOPEN_MPI=${OPEN_MPI}
endif
endif
CMAKE_STEM = cmake ../../src -DEIRENE_INTERFACE=SOLPS-ITER -DEIRENE_USER-ROUTINES=iter ${DEFLIBS} ${DEFOPTS} ${DEFMAKES}
MAKEC = FC=${FC} ${CMAKE_STEM} ${DEGLIBS}
MAKEM = FC="${MPI_FC}" ${CMAKE_STEM} ${DEGLIBS} -DMPI=ON -DMPI_VERSION=${MPI_VERSION}
ifdef OPEN_MPI
MAKEM += -DOPEN_MPI=${OPEN_MPI}
endif
# Special treatment to avoid using ifx with OpenMP options when ifort is available
ifneq (${FC},ifx)
MAKEN = ${MAKEC} -DMPI=OFF -DOPENMP=ON
MAKEP = ${MAKEM} -DOPENMP=ON
else
ifneq ($(shell command -v ifort 2>/dev/null),)
MAKEN = FC=ifort ${CMAKE_STEM} ${DEGLIBS} -DMPI=OFF -DOPENMP=ON
MAKEP = FC=ifort ${CMAKE_STEM} ${DEGLIBS} -DMPI=ON -DMPI_VERSION=${MPI_VERSION} -DOPENMP=ON
else
MAKEN = ${MAKEC} -DMPI=OFF -DOPENMP=ON
MAKEP = ${MAKEM} -DOPENMP=ON
endif
ifdef OPEN_MPI
MAKEP += -DOPEN_MPI=${OPEN_MPI}
endif
endif
endif
# ---------------------------------------------------------------------------
# Multi-goal deduplication
# When several composite top-level goals are given on the same command line
# (e.g. "make all all_mpi all_openmp all_mpi_openmp") they share sub-targets
# such as carre, divgeo and manual. Because phony targets are always
# considered out-of-date, parallel make (-jN) can launch those shared
# sub-targets concurrently – one for each goal chain – causing races inside
# sub-makes (e.g. the equtrn LISTOBJ file being written by two processes at
# the same time).
#
# The fix: define the prerequisite list of every composite target as a Make
# variable (_prereqs.<name>). When more than one such target appears on the
# command line, compute the sorted union of all their prerequisites and attach
# a single real-file sentinel (.deduped.stamp) that depends on that union.
# A real-file target is built exactly once per invocation even with -jN, so
# all shared sub-targets are built in one parallel pass before any of the
# composite goals processes its own (now already-finished) prerequisite list.
_prereqs.solps := carre divgeo b25eirene uinp triang amds manual
_prereqs.solps_openmp := carre divgeo b25eirene_openmp uinp_openmp triang amds_openmp manual
_prereqs.solps_mpi := carre divgeo b25eirene_mpi uinp_mpi triang_mpi amds_mpi manual
_prereqs.solps_openmp_mpi := carre divgeo b25eirene_openmp_mpi uinp_openmp_mpi triang_mpi amds_openmp_mpi manual
_prereqs.solps_mpi_openmp := $(_prereqs.solps_openmp_mpi)
_prereqs.nox := carre_nox divgeo_nox b25eirene_nox uinp_nox triang_nox manual
_prereqs.nox_openmp := carre_nox divgeo_nox b25eirene_nox_openmp uinp_nox_openmp triang_nox manual
_prereqs.nox_mpi := carre_nox divgeo_nox b25eirene_nox_mpi uinp_nox_mpi triang_nox_mpi manual
_prereqs.nox_openmp_mpi := carre_nox divgeo_nox b25eirene_nox_openmp_mpi uinp_nox_openmp_mpi triang_nox_mpi manual
_prereqs.nox_mpi_openmp := $(_prereqs.nox_openmp_mpi)
_prereqs.all := carre divgeo b25 eirene b25eirene uinp triang amds manual
_prereqs.all_openmp := carre divgeo b25_openmp eirene_openmp b25eirene_openmp uinp_openmp triang amds_openmp manual
_prereqs.all_mpi := carre divgeo b25_mpi eirene_mpi b25eirene_mpi uinp_mpi triang_mpi amds_mpi manual
_prereqs.all_openmp_mpi := carre divgeo b25_openmp_mpi eirene_openmp_mpi b25eirene_openmp_mpi uinp_openmp_mpi triang_mpi amds_openmp_mpi manual
_prereqs.all_mpi_openmp := $(_prereqs.all_openmp_mpi)
_prereqs.all_nox := carre_nox divgeo_nox b25_nox eirene_nox b25eirene_nox uinp_nox triang_nox manual
_prereqs.all_nox_openmp := carre_nox divgeo_nox b25_nox_openmp eirene_nox_openmp b25eirene_nox_openmp uinp_nox_openmp triang_nox manual
_prereqs.all_nox_mpi := carre_nox divgeo_nox b25_nox_mpi eirene_nox_mpi b25eirene_nox_mpi uinp_nox_mpi triang_nox_mpi manual
_prereqs.all_nox_openmp_mpi := carre_nox divgeo_nox b25_nox_openmp_mpi eirene_nox_openmp_mpi b25eirene_nox_openmp_mpi uinp_nox_openmp_mpi triang_nox_mpi manual
_prereqs.all_openmp_nox := $(_prereqs.all_nox_openmp)
_prereqs.all_mpi_nox := $(_prereqs.all_nox_mpi)
_prereqs.all_nox_mpi_openmp := $(_prereqs.all_nox_openmp_mpi)
_prereqs.all_openmp_mpi_nox := $(_prereqs.all_nox_openmp_mpi)
_prereqs.all_mpi_openmp_nox := $(_prereqs.all_nox_openmp_mpi)
# All composite goals known to this deduplication mechanism
_composite_goals := solps solps_openmp solps_mpi solps_openmp_mpi solps_mpi_openmp \
nox nox_openmp nox_mpi nox_openmp_mpi nox_mpi_openmp \
all all_openmp all_mpi all_openmp_mpi all_mpi_openmp \
all_nox all_nox_openmp all_nox_mpi all_nox_openmp_mpi \
all_openmp_nox all_mpi_nox \
all_nox_mpi_openmp all_openmp_mpi_nox all_mpi_openmp_nox
_active_composite := $(filter $(_composite_goals),$(MAKECMDGOALS))
# Only activate the deduplication when two or more composite goals are given.
ifneq ($(words $(_active_composite)),1)
ifneq ($(words $(_active_composite)),0)
_deduped_union := $(sort $(foreach _g,$(_active_composite),$(_prereqs.$(_g))))
.deduped.stamp: $(_deduped_union)
@touch $@
$(_active_composite): .deduped.stamp
endif
endif
# ---------------------------------------------------------------------------
.PHONY: solps solps_nox solps_openmp solps_mpi solps_openmp_mpi solps_mpi_openmp \
nox nox_openmp nox_mpi nox_openmp_mpi nox_mpi_openmp \
all all_openmp all_mpi all_openmp_mpi all_mpi_openmp \
all_nox all_nox_openmp all_nox_mpi all_nox_openmp_mpi all_nox_mpi_openmp all_mpi_nox \
carre carre_nox divgeo divgeo_nox \
b25 b25_openmp b25_mpi b25_openmp_mpi b25_mpi_openmp \
b25_nox b25_nox_openmp b25_nox_mpi b25_nox_openmp_mpi b25_nox_mpi_openmp \
b25_ig b25_all b25_all_mpi b25_all_openmp b25_all_openmp_mpi b25_all_mpi_openmp \
eirene eirene_mpi eirene_openmp eirene_openmp_mpi \
eirene_nox eirene_nox_mpi eirene_openmp_nox eirene_nox_openmp_mpi \
b25eirene b25eirene_mpi b25eirene_openmp b25eirene_openmp_mpi b25eirene_mpi_openmp \
b25eirene_nox b25eirene_nox_mpi b25eirene_ig b25eirene_all_mpi b25eirene_nox_mpi \
uinp uinp_openmp uinp_mpi uinp_openmp_mpi uinp_mpi_openmp \
uinp_nox uinp_nox_openmp uinp_nox_mpi uinp_nox_openmp_mpi uinp_nox_mpi_openmp \
triang triang_nox triang_mpi triang_nox_mpi \
amds amds_mpi amds_openmp amds_openmp_mpi \
fxdr sonnet-light \
nc2text_simple nc_reduce \
b2sxdr manual local depend depend_nox tags listobj listobj_nox \
clean clean_% debug %_debug \
VERSION VERSION_nox help prereqs prereqs_debug prereqs_nox prereqs_nox_debug \
nox_build nox_build_mpi nox_build_openmp nox_build_openmp_mpi nox_build_mpi_openmp
DEFAULT: solps
# Basic compile targets
#----------------------
solps: carre divgeo b25eirene uinp triang amds manual
solps_nox: nox
solps_openmp: carre divgeo b25eirene_openmp uinp_openmp triang amds_openmp manual
solps_mpi: carre divgeo b25eirene_mpi uinp_mpi triang_mpi amds_mpi manual
solps_openmp_mpi: carre divgeo b25eirene_openmp_mpi uinp_openmp_mpi triang_mpi amds_openmp_mpi manual
solps_mpi_openmp: solps_openmp_mpi
nox: carre_nox divgeo_nox b25eirene_nox uinp_nox triang_nox manual
nox_openmp: carre_nox divgeo_nox b25eirene_nox_openmp uinp_nox_openmp triang_nox manual
solps_nox_openmp: nox_openmp
solps_openmp_nox: nox_openmp
nox_mpi: carre_nox divgeo_nox b25eirene_nox_mpi uinp_nox_mpi triang_nox_mpi manual
solps_nox_mpi: nox_mpi
solps_mpi_nox: nox_mpi
nox_openmp_mpi: carre_nox divgeo_nox b25eirene_nox_openmp_mpi uinp_nox_openmp_mpi triang_nox_mpi manual
nox_mpi_openmp: nox_openmp_mpi
solps_openmp_mpi_nox: nox_openmp_mpi
solps_mpi_openmp_nox: nox_openmp_mpi
solps_nox_openmp_mpi: nox_openmp_mpi
solps_nox_mpi_openmp: nox_openmp_mpi
all: carre divgeo b25 eirene b25eirene uinp triang amds manual
all_nox: carre_nox divgeo_nox b25_nox eirene_nox b25eirene_nox uinp_nox triang_nox manual
all_openmp: carre divgeo b25_openmp eirene_openmp b25eirene_openmp uinp_openmp triang amds_openmp manual
all_mpi: carre divgeo b25_mpi eirene_mpi b25eirene_mpi uinp_mpi triang_mpi amds_mpi manual
all_nox_openmp: carre_nox divgeo_nox b25_nox_openmp eirene_nox_openmp b25eirene_nox_openmp uinp_nox_openmp triang_nox manual
all_openmp_nox: all_nox_openmp
all_nox_mpi: carre_nox divgeo_nox b25_nox_mpi eirene_nox_mpi b25eirene_nox_mpi uinp_nox_mpi triang_nox_mpi manual
all_mpi_nox: all_nox_mpi
all_openmp_mpi: carre divgeo b25_openmp_mpi eirene_openmp_mpi b25eirene_openmp_mpi uinp_openmp_mpi triang_mpi amds_openmp_mpi manual
all_mpi_openmp: all_openmp_mpi
all_nox_openmp_mpi: carre_nox divgeo_nox b25_nox_openmp_mpi eirene_nox_openmp_mpi b25eirene_nox_openmp_mpi uinp_nox_openmp_mpi triang_nox_mpi manual
all_nox_mpi_openmp: all_nox_openmp_mpi
all_openmp_mpi_nox: all_nox_openmp_mpi
all_mpi_openmp_nox: all_nox_openmp_mpi
carre:
cd modules/Carre; ${MAKE}
carre_nox:
cd modules/Carre; ${MAKE} NCARG_ROOT="" LD_NCARG=""
divgeo:
ifndef NO_MOTIF
+cd modules/DivGeo; ${MAKEO}
else
$(warning DivGeo will not be compiled because Motif library is not installed.)
endif
+cd modules/DivGeo/equtrn; ${MAKEO}
+cd modules/DivGeo/convert; ${MAKEO}
divgeo_nox:
+cd modules/DivGeo/equtrn; ${MAKEO}
+cd modules/DivGeo/convert; ${MAKEO}
ifndef NO_CMAKE
# Each eirene* cmake build is anchored to a real-file target (libeirene.a).
# GNU Make builds real-file targets at most once per invocation, so when
# multiple top-level targets (e.g. all: eirene … triang→eirene_nox) run in
# parallel, the cmake build directory is entered only once for the initial
# full build.
#
# The standalone Eirene build directory always produces BOTH the
# real-graphics executable (eirobj) and the dummy-graphics executable
# (eirobjx) from a single cmake configure (see the split of the EIRENE and
# GR-DUMMY libraries in modules/Eirene/src/CMakeLists.txt). Because of
# this, "eirene" and "eirene_nox" now use the exact same cmake configure
# command and share the exact same build directory/library with nothing
# left to toggle between them -- eirene_nox therefore simply reduces to
# eirene below, and there is no longer any race to order between them.
#
# CMAKE_CONFIGURE_IF_NEEDED guards every cmake (re)configure invocation.
# CMake's generated Makefiles make every compiled object depend on
# flags.make, and `cmake <args>` rewrites flags.make (with a fresh mtime)
# on every single configure call -- even when none of the arguments
# actually changed. Left unguarded, that means a second, otherwise
# no-op, "make solps" reconfigures cmake again, touches flags.make, and
# forces GNU Make to consider every Fortran source in Eirene out of
# date, triggering a full rebuild for no reason.
#
# This macro records the exact configure command last used for a given
# build directory (in .cmake_configure_args, inside that directory) and
# only re-runs cmake when the directory has not been configured yet, or
# when the requested arguments differ from the recorded ones. Genuine
# reconfigures (e.g. a real -D... option actually changing) still happen
# because the argument strings differ. Repeating the exact same build
# (e.g. running "make solps" twice in a row) now skips the reconfigure
# step entirely, leaving flags.make untouched and the build a true no-op.
define CMAKE_CONFIGURE_IF_NEEDED
echo $(1) > .cmake_configure_args.new; \
if [ -f CMakeCache.txt ] && cmp -s .cmake_configure_args.new .cmake_configure_args 2>/dev/null; then \
rm -f .cmake_configure_args.new; \
else \
$(1) && mv -f .cmake_configure_args.new .cmake_configure_args; \
fi
endef
${LIBEIRENE_A}:
@-mkdir -p modules/Eirene/builds/standalone.${TOOLCHAIN}
+cd modules/Eirene/builds/standalone.${TOOLCHAIN}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEC} ${OPT_MPI} ${OPT_OPENMP} ${OPT_DBG}); ${MAKEO}
eirene: ${LIBEIRENE_A}
+cd modules/Eirene/builds/standalone.${TOOLCHAIN}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEC} ${OPT_MPI} ${OPT_OPENMP} ${OPT_DBG}); ${MAKEO}
${LIBEIRENE_A_MPI}:
@-mkdir -p modules/Eirene/builds/standalone.${TOOLSHORT}.mpi${EXT_DBG}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEM} ${OPT_DBG}); ${MAKEO}
eirene_mpi: ${LIBEIRENE_A_MPI}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEM} ${OPT_DBG}); ${MAKEO}
${LIBEIRENE_A_OPENMP}:
@-mkdir -p modules/Eirene/builds/standalone.${TOOLSHORT}.openmp${EXT_DBG}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.openmp${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEN} ${OPT_DBG}); ${MAKEO}
eirene_openmp: ${LIBEIRENE_A_OPENMP}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.openmp${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEN} ${OPT_DBG}); ${MAKEO}
${LIBEIRENE_A_OPENMP_MPI}:
@-mkdir -p modules/Eirene/builds/standalone.${TOOLSHORT}.openmp.mpi${EXT_DBG}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.openmp.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEP} ${OPT_DBG}); ${MAKEO}
eirene_openmp_mpi: ${LIBEIRENE_A_OPENMP_MPI}
+cd modules/Eirene/builds/standalone.${TOOLSHORT}.openmp.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEP} ${OPT_DBG}); ${MAKEO}
eirene_nox: eirene
eirene_nox_mpi: eirene_mpi
eirene_nox_openmp: eirene_openmp
eirene_nox_openmp_mpi: eirene_openmp_mpi
else
eirene:
+cd modules/Eirene; ${MAKEE}
eirene_mpi:
+cd modules/Eirene; ${MAKEE} ${MPI_OPTS}
eirene_openmp:
+cd modules/Eirene; ${MAKEE} ${OMP_OPTE}
eirene_openmp_mpi:
+cd modules/Eirene; ${MAKEE} ${OMP_OPTE} ${MPI_OPTS}
eirene_nox:
+cd modules/Eirene; ${MAKEE} ${OPT_NOX}
eirene_nox_mpi:
+cd modules/Eirene; ${MAKEE} ${MPI_OPTS} ${OPT_NOX}
eirene_nox_openmp:
+cd modules/Eirene; ${MAKEE} ${OMP_OPTE} ${OPT_NOX}
eirene_nox_openmp_mpi:
+cd modules/Eirene; ${MAKEE} ${OMP_OPTE} ${MPI_OPTS} ${OPT_NOX}
endif
eirene_mpi_openmp: eirene_openmp_mpi
eirene_nox_mpi_openmp: eirene_nox_openmp_mpi
b25: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO}
b25_all: ${NCEXECS}
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} links
endif
cd modules/B2.5; ${MAKE} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ALL
b25_openmp: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB}
b25_mpi: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${MPI_OPTS}
b25_openmp_mpi: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS}
b25_mpi_openmp: b25_openmp_mpi
b25_nox: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} NOPLOT
b25_ig: ${NCEXECS}
cd modules/B2.5; ${MAKE} USE_IMPGYRO=-DUSE_IMPGYRO ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_IMPGYRO=-DUSE_IMPGYRO
b25_all_openmp: ${NCEXECS}
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_OPENMP=yes links
endif
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB}
b25_nox_openmp: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB} NOPLOT
b25_openmp_nox: b25_nox_openmp
b25_nox_mpi: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${MPI_OPTS} NOPLOT
b25_mpi_nox: b25_nox_mpi
b25_nox_openmp_mpi: ${NCEXECS}
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS} NOPLOT
b25_nox_mpi_openmp: b25_nox_openmp_mpi
b25_mpi_openmp_nox: b25_nox_openmp_mpi
b25_openmp_mpi_nox: b25_nox_openmp_mpi
b25_all_mpi: ${NCEXECS}
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_MPI=yes links
endif
cd modules/B2.5; ${MAKE} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${MPI_OPTS} ALL
b25_all_openmp_mpi: ${NCEXECS}
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_MPI=yes SOLPS_OPENMP=yes links
endif
cd modules/B2.5; ${MAKE} ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS} ALL
b25_all_mpi_openmp: b25_all_openmp_mpi
b25eirene: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEC} ${OPT_MPI} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE
b25eirene_all: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEC} ${OPT_MPI} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE
endif
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} links
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ALL
b25eirene_nox: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLCHAIN}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEC} ${OPT_MPI} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${OPT_NOX}
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE NOPLOT
b25eirene_openmp: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEN} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE SOLPS_OPENMP=yes
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB}
b25eirene_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEM} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${MPI_OPTS}
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS}
b25eirene_openmp_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${MPI_OPTS} SOLPS_OPENMP=yes
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS}
b25eirene_mpi_openmp: b25eirene_openmp_mpi
b25eirene_nox_openmp: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEN} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${OPT_NOX} SOLPS_OPENMP=yes
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} NOPLOT
b25eirene_nox_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEM} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${MPI_OPTS} ${OPT_NOX}
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS} NOPLOT
b25eirene_ig: ${NCEXECS}
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE USE_IMPGYRO=-DUSE_IMPGYRO
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE USE_IMPGYRO=-DUSE_IMPGYRO ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE USE_IMPGYRO=-DUSE_IMPGYRO
b25eirene_all_openmp: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEN} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE SOLPS_OPENMP=yes
endif
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_OPENMP=yes links
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ALL
b25eirene_all_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEM} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${MPI_OPTS}
endif
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_MPI=yes links
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${MPI_OPTS} ALL
b25eirene_all_openmp_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${MPI_OPTS} SOLPS_OPENMP=yes
endif
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} SOLPS_MPI=yes SOLPS_OPENMP=yes links
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS} ALL
b25eirene_all_mpi_openmp: b25eirene_all_openmp_mpi
b25eirene_nox_openmp_mpi: ${NCEXECS}
ifndef NO_CMAKE
@-mkdir -p modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}
+cd modules/Eirene/builds/couple_SOLPS-ITER.${TOOLSHORT}.openmp.mpi${EXT_DBG}; $(call CMAKE_CONFIGURE_IF_NEEDED,${MAKEP} ${OPT_OPENMP} ${CPLOPTS} ${OPT_DBG}); ${MAKEO}
else
+cd modules/Eirene; ${MAKEE} USE_B25=-DB25_EIRENE ${OPT_NOX} ${MPI_OPTS} SOLPS_OPENMP=yes
endif
cd modules/B2.5; ${MAKE} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS} ${B25_SERIAL}
+cd modules/B2.5; ${MAKEO} USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS} NOPLOT
b25eirene_nox_mpi_openmp: b25eirene_nox_openmp_mpi
uinp: b25eirene
+cd modules/Uinp; ${MAKEO}
uinp_nox: b25eirene_nox
+cd modules/Uinp; ${MAKEO}
uinp_openmp: b25eirene_openmp
+cd modules/Uinp; ${MAKEO} ${OMP_OPTB}
uinp_mpi: b25eirene_mpi
+cd modules/Uinp; ${MAKEO} ${MPI_OPTS}
uinp_openmp_mpi: b25eirene_openmp_mpi
+cd modules/Uinp; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS}
uinp_mpi_openmp: uinp_openmp_mpi
uinp_nox_openmp: b25eirene_nox_openmp
+cd modules/Uinp; ${MAKEO} ${OMP_OPTB}
uinp_openmp_nox: uinp_nox_openmp
uinp_nox_mpi: b25eirene_nox_mpi
+cd modules/Uinp; ${MAKEO} ${MPI_OPTS}
uinp_mpi_nox: uinp_nox_mpi
uinp_nox_openmp_mpi: b25eirene_nox_openmp_mpi
+cd modules/Uinp; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS}
uinp_nox_mpi_openmp: uinp_nox_openmp_mpi
uinp_mpi_openmp_nox: uinp_nox_openmp_mpi
uinp_openmp_mpi_nox: uinp_nox_openmp_mpi
triang: eirene_nox
cd modules/Triang; ${MAKE} -j1
triang_mpi: eirene_nox_mpi
cd modules/Triang; ${MAKE} -j1 ${MPI_OPTS}
triang_nox: eirene_nox
cd modules/Triang; ${MAKE} ${OPT_NOX} mods
cd modules/Triang; ${MAKE} -j1 ${OPT_NOX}
triang_nox_mpi: eirene_nox_mpi
cd modules/Triang; ${MAKE} ${MPI_OPTS} ${OPT_NOX} mods
cd modules/Triang; ${MAKE} -j1 ${MPI_OPTS} ${OPT_NOX}
ifndef NO_MOTIF
amds: b25eirene
+cd modules/amds; ${MAKEO}
amds_mpi: b25eirene_mpi
+cd modules/amds; ${MAKEO} ${MPI_OPTS}
amds_openmp: b25eirene_openmp
+cd modules/amds; ${MAKEO} ${OMP_OPTB}
amds_openmp_mpi: b25eirene_openmp_mpi
+cd modules/amds; ${MAKEO} ${OMP_OPTB} ${MPI_OPTS}
else
amds:
amds_mpi:
amds_openmp:
amds_openmp_mpi:
$(warning AMDS will not be compiled because Motif library file is not installed.)
endif
fxdr: sonnet-light
+cd modules/fxdr; ${MAKEO}
sonnet-light:
@-mkdir -p ${SOLPSLIB}
cd modules/Sonnet-light; ${MAKE} all INSTALL_USERAREA=${SOLPSLIB}
nc2text: nc2text_simple
nc2text_simple:
@-mkdir -p ${SOLPSTOP}/scripts/${TOOLCHAIN}
cd modules/B2.5; ${MAKE} nc2text
nc_reduce:
@-mkdir -p ${SOLPSTOP}/scripts/${TOOLCHAIN}
cd modules/B2.5; ${MAKE} nc_reduce
# File-path rules matching B2.5's NCODIR. These are the real targets that
# b25*/b25eirene* depend on via NCEXECS, ensuring a single build per invocation.
ifdef LD_NETCDF
${NC_EXE_DIR}/nc_reduce.exe:
@-mkdir -p ${NC_EXE_DIR}
cd modules/B2.5; ${MAKE} nc_reduce
# nc2text_simple shares the same B2.5 OBNDIR (standalone.*) as nc_reduce.
# Serialize via order-only prerequisite to prevent a parallel race on that directory.
${NC_EXE_DIR}/nc2text_simple.exe: | ${NC_EXE_DIR}/nc_reduce.exe
@-mkdir -p ${NC_EXE_DIR}
cd modules/B2.5; ${MAKE} nc2text_simple
# Debug-mode NC executables: real-file targets pre-built before b25*_debug /
# solps*_debug sub-makes start (see b25%_debug / solps%_debug rules).
# Building them here (outer make, no SOLPS_DEBUG) keeps the debug and non-debug
# B2.5 utility objects in separate directories, avoiding any parallel race.
${DEBUG_NC_EXE_DIR}/nc_reduce.exe:
@-mkdir -p ${DEBUG_NC_EXE_DIR}
cd modules/B2.5; ${MAKE} nc_reduce SOLPS_DEBUG=yes
${DEBUG_NC_EXE_DIR}/nc2text_simple.exe: | ${DEBUG_NC_EXE_DIR}/nc_reduce.exe
@-mkdir -p ${DEBUG_NC_EXE_DIR}
cd modules/B2.5; ${MAKE} nc2text_simple SOLPS_DEBUG=yes
endif
ifndef SOLPS4_MISSING
b2sxdr: b25eirene sonnet-light
cd modules/solps4-5; ${MAKE} links
cd modules/solps4-5; ${MAKE} tags
cd modules/solps4-5; ${MAKE} listobj
cd modules/solps4-5; ${MAKE} depend
cd modules/solps4-5; ${MAKE}
endif
manual:
ifndef NO_MANUAL
ifeq ($(shell [ -e ${SOLPSTOP}/doc/solps/b2cdci.F ] && echo yes || echo no ),no)
cd doc/solps; ${MAKE} complete
else
cd doc/solps; ${MAKE}
endif
cd modules/Eirene/Manual; latexmk -f -pdfdvi eirene.tex
else
$(warning SOLPS-ITER and Eirene manuals will not be produced because NO_MANUAL switch is activated.)
endif
# prereqs runs all preliminary, non-parallel-safe steps once in order.
# Call this before a large parallel build (e.g. `make prereqs && make -j32 all ...`)
# to ensure local stubs, version headers, LISTOBJ files, and dependency files
# are all generated once rather than redundantly inside each parallel sub-make.
prereqs:
${MAKE} local
${MAKE} VERSION
${MAKE} tags
${MAKE} listobj
${MAKE} depend
prereqs_debug:
${MAKE} local
${MAKE} VERSION
${MAKE} tags
${MAKE} listobj SOLPS_DEBUG=yes
${MAKE} depend SOLPS_DEBUG=yes
# Targeted variants for nox (no-X11) builds, used by CI scripts.
prereqs_nox:
${MAKE} local
${MAKE} VERSION_nox
${MAKE} tags
${MAKE} listobj_nox
${MAKE} depend_nox
prereqs_nox_debug:
${MAKE} local
${MAKE} VERSION_nox
${MAKE} tags
${MAKE} listobj_nox SOLPS_DEBUG=yes
${MAKE} depend_nox SOLPS_DEBUG=yes
local:
cd modules/Eirene; ${MAKEF} local links
cd modules/B2.5; ${MAKE} local
ifndef SOLPS4_MISSING
cd modules/solps4-5; ${MAKE} local
endif
tags:
cd modules/Carre; ${MAKE} tags
cd modules/Eirene; ${MAKEF} tags
cd modules/B2.5; ${MAKE} tags
cd modules/Uinp; ${MAKE} tags
cd modules/Triang; ${MAKE} tags
cd modules/DivGeo; ${MAKE} tags
cd modules/DivGeo/convert; ${MAKE} tags
cd modules/DivGeo/equtrn; ${MAKE} tags
# cd modules/solps4-5; ${MAKE} tags
ifndef SOLPS4_MISSING
rm -f TAGS ; ${MAKETAGS} TAGS modules/Carre/src.local/*.F modules/Carre/src/*/*.F modules/Carre/src/include/*.* modules/Eirene/src.local/*.[Ff] modules/Eirene/src/*/*.[Ff] modules/Eirene/src/interfaces/couple_SOLPS-ITER/*.[Ff] modules/Eirene/src/user-routines/user_iter/*.[Ff] modules/Eirene/src/geometry/time-routines/*.F modules/Eirene/src/*/*.[Ff]90 modules/Eirene/src/interfaces/couple_SOLPS-ITER/*.[Ff]90 modules/B2.5/src.local/*.F modules/B2.5/src/*/*.F modules/B2.5/src/*/*.F90 modules/B2.5/src/*/*.[Hh] modules/B2.5/src/common/*.* modules/B2.5/src/common/COUPLE/*.F modules/B2.5/src/documentation/*.xml modules/B2.5/src/documentation/*.py modules/Uinp/src/*.F modules/Uinp/src/*.inc modules/Uinp/src/*.h modules/Triang/src/*/*.f modules/DivGeo/equtrn/src/*.f modules/DivGeo/equtrn/src/*.f90 modules/DivGeo/equtrn/src/*.inc modules/DivGeo/convert/src/*.f modules/DivGeo/src/*.[ch] modules/DivGeo/dg.dgc modules/amds/src/*.[ch] modules/solps4-5/src/*.F scripts/nc2text_simple/*.F90 doc/solps/solps.tex modules/Eirene/Manual/eirene.tex modules/Eirene/Manual/tex/*.tex || touch TAGS
else
rm -f TAGS ; ${MAKETAGS} TAGS modules/Carre/src.local/*.F modules/Carre/src/*/*.F modules/Carre/src/include/*.* modules/Eirene/src.local/*.[Ff] modules/Eirene/src/*/*.[Ff] modules/Eirene/src/interfaces/couple_SOLPS-ITER/*.[Ff] modules/Eirene/src/user-routines/user_iter/*.[Ff] modules/Eirene/src/geometry/time-routines/*.F modules/Eirene/src/*/*.[Ff]90 modules/Eirene/src/interfaces/couple_SOLPS-ITER/*.[Ff]90 modules/B2.5/src.local/*.F modules/B2.5/src/*/*.F modules/B2.5/src/*/*.F90 modules/B2.5/src/*/*.[Hh] modules/B2.5/src/common/*.* modules/B2.5/src/common/COUPLE/*.F modules/B2.5/src/documentation/*.xml modules/B2.5/src/documentation/*.py modules/Uinp/src/*.F modules/Uinp/src/*.inc modules/Uinp/src/*.h modules/Triang/src/*/*.f modules/DivGeo/equtrn/src/*.f modules/DivGeo/equtrn/src/*.f90 modules/DivGeo/equtrn/src/*.inc modules/DivGeo/convert/src/*.f modules/DivGeo/src/*.[ch] modules/DivGeo/dg.dgc modules/amds/src/*.[ch] scripts/nc2text_simple/*.F90 doc/solps/solps.tex modules/Eirene/Manual/eirene.tex modules/Eirene/Manual/tex/*.tex || touch TAGS
endif
listobj:
cd modules/Carre; ${MAKE} listobj
cd modules/Eirene; ${MAKEF} listobj
cd modules/B2.5; ${MAKE} listobj
cd modules/Uinp; ${MAKE} listobj
cd modules/Triang; ${MAKE} listobj
cd modules/DivGeo; ${MAKE} listobj
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE
ifeq (,$(findstring ifx,${FC}))
cd modules/Eirene; ${MAKEF} listobj ${OMP_OPTE}
cd modules/B2.5; ${MAKE} listobj ${OMP_OPTB}
cd modules/Uinp; ${MAKE} listobj ${OMP_OPTB}
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE ${OMP_OPTE}
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE ${OMP_OPTB}
endif
ifndef NO_MPI
cd modules/Eirene; ${MAKEF} listobj ${MPI_OPTS}
cd modules/B2.5; ${MAKE} listobj ${MPI_OPTS}
cd modules/Uinp; ${MAKE} listobj ${MPI_OPTS}
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE ${MPI_OPTS}
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE ${MPI_OPTS}
ifeq (,$(findstring ifx,${FC}))
cd modules/Eirene; ${MAKEF} listobj ${OMP_OPTE} ${MPI_OPTS}
cd modules/B2.5; ${MAKE} listobj ${OMP_OPTB} ${MPI_OPTS}
cd modules/Uinp; ${MAKE} listobj ${OMP_OPTB} ${MPI_OPTS}
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE ${OMP_OPTE} ${MPI_OPTS}
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${MPI_OPTS}
endif
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE USE_IMPGYRO=-DUSE_IMPGYRO
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE USE_IMPGYRO=-DUSE_IMPGYRO
endif
# cd modules/solps4-5; ${MAKE} listobj
listobj_nox:
cd modules/Carre; ${MAKE} listobj NCARG_ROOT="" LD_NCARG=""
cd modules/Eirene; ${MAKEF} listobj ${OPT_NOX}
cd modules/B2.5; ${MAKE} listobj ${OPT_NOX}
cd modules/Triang; ${MAKE} listobj ${OPT_NOX}
cd modules/Uinp; ${MAKE} listobj
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE ${OPT_NOX}
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE ${OPT_NOX}
ifeq (,$(findstring ifx,${FC}))
cd modules/Eirene; ${MAKEF} listobj ${OMP_OPTE} ${OPT_NOX}
cd modules/B2.5; ${MAKE} listobj ${OMP_OPTB} ${OPT_NOX}
cd modules/Uinp; ${MAKE} listobj ${OMP_OPTB}
cd modules/Eirene; ${MAKEF} listobj USE_B25=-DB25_EIRENE ${OMP_OPTE} ${OPT_NOX}
cd modules/B2.5; ${MAKE} listobj USE_EIRENE=-DB25_EIRENE ${OMP_OPTB} ${OPT_NOX}
endif
ifndef NO_MPI