-
Notifications
You must be signed in to change notification settings - Fork 18
10582 lines (10581 loc) · 481 KB
/
cicd.yml
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
name: 'CI/CD'
on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'
paths:
- 'Makefile'
- 'source/**'
- 'source/Bivar/**'
- 'source/ISO_Varying_String/**'
- 'source/gslODEInitVal2/**'
- 'source/NSWC/**'
- 'source/pFq/**'
- 'source/gslSpecFuncApprox/**'
- 'source/FFTlog/**'
- 'perl/**'
- 'perl/File/**'
- 'perl/Galacticus/**'
- 'perl/Galacticus/Launch/**'
- 'perl/Galacticus/Constraints/**'
- 'perl/Galacticus/Build/**'
- 'perl/Galacticus/Build/Components/**'
- 'perl/Galacticus/Build/Components/Classes/**'
- 'perl/Galacticus/Build/Components/Implementations/**'
- 'perl/Galacticus/Build/Components/Properties/**'
- 'perl/Galacticus/Build/Components/TreeNodes/**'
- 'perl/Galacticus/Build/Components/Hierarchy/**'
- 'perl/Galacticus/Build/SourceTree/**'
- 'perl/Galacticus/Build/SourceTree/Parse/**'
- 'perl/Galacticus/Build/SourceTree/Analyze/**'
- 'perl/Galacticus/Build/SourceTree/Process/**'
- 'perl/Galacticus/Build/SourceTree/Process/FunctionClass/**'
- 'perl/List/**'
- 'perl/Sort/**'
- 'perl/LaTeX/**'
- 'perl/IO/**'
- 'perl/IO/Compress/**'
- 'perl/System/**'
- 'perl/Fortran/**'
- 'scripts/build/**'
- 'schema/**'
concurrency:
group: cicd-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
# Build and deploy
## Linux
### Static executable and test codes
Build-Executable-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository analysis-perl
uses: actions/checkout@v4
with:
repository: galacticusorg/analysis-perl
path: analysis-perl
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS=$GALACTICUS_FCFLAGS -static" >> $GITHUB_ENV
echo "GALACTICUS_ANALYSIS_PERL_PATH=$GITHUB_WORKSPACE/analysis-perl" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
export BUILDPATH=./work/build
set -o pipefail
make GALACTICUS_BUILD_OPTION=compileprof -j2 all 2>&1 | tee build.log
set +o pipefail
chmod u=wrx ./scripts/build/buildProfiler.pl
./scripts/build/buildProfiler.pl build.log buildProfile.html --durationMinimum 20
- name: Upload Galacticus executable
uses: actions/upload-artifact@v3
with:
name: galacticus-exec
path: 'Galacticus.exe'
- name: Upload test code executables
uses: actions/upload-artifact@v3
with:
name: test-execs
path: 'tests.*.exe'
- name: Upload build profile
uses: actions/upload-artifact@v3
with:
name: build-profile
path: 'buildProfile.html'
- run: echo "This job's status is ${{ job.status }}."
### Non-static executable
Build-Executable-Linux-Non-Static:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository analysis-perl
uses: actions/checkout@v4
with:
repository: galacticusorg/analysis-perl
path: analysis-perl
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_ANALYSIS_PERL_PATH=$GITHUB_WORKSPACE/analysis-perl" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
export BUILDPATH=./work/build
set -o pipefail
make -j2 Galacticus.exe 2>&1 | tee build.log
set +o pipefail
! grep -n -C 5 Error: build.log
! grep -n -C 5 Warning: build.log
! grep -v 'is up to date' build.log | grep -n -C 5 make:
- name: Upload Galacticus executable
uses: actions/upload-artifact@v3
with:
name: galacticus-exec-non-static
path: 'Galacticus.exe'
- run: echo "This job's status is ${{ job.status }}."
### Executable instrumented
Build-Executables-Instrumented-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
export GALACTICUS_FCFLAGS="$GALACTICUS_FCFLAGS -pg"
export GALACTICUS_CFLAGS="$GALACTICUS_CFLAGS -pg"
export GALACTICUS_CPPFLAGS="$GALACTICUS_CPPFLAGS -pg"
make -j2 Galacticus.exe
- name: Upload executables
uses: actions/upload-artifact@v3
with:
name: galacticus-exec-instrumented
path: 'Galacticus.exe'
- run: echo "This job's status is ${{ job.status }}."
### Executable MPI
Build-Executables-MPI-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
make -j2 GALACTICUS_BUILD_OPTION=MPI Galacticus.exe tests.MPI.exe tests.radiative_transfer.atomic_matter.state_solver.exe
- name: Upload Galacticus executable
uses: actions/upload-artifact@v3
with:
name: galacticus-exec-MPI
path: 'Galacticus.exe'
- name: Upload test code executables
uses: actions/upload-artifact@v3
with:
name: test-execs-MPI
path: 'tests.*.exe'
- run: echo "This job's status is ${{ job.status }}."
### Executable debugging
Build-Executables-Debugging-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS+=\ -DDEBUGGING" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
make -j2 Galacticus.exe tests.debugging.exe
- name: Upload test code executables
uses: actions/upload-artifact@v3
with:
name: test-execs-debugging
path: 'tests.*.exe'
- run: echo "This job's status is ${{ job.status }}."
### Library
Build-Library-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max-old-space-size=5120" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Build the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
make -j2 GALACTICUS_BUILD_OPTION=lib libgalacticus.so
- name: Package the code
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
mkdir galacticus
mkdir galacticus/lib
mkdir galacticus/python
# Find all dynamic libraries needed (filtering out some system libs) and copy to our folder.
ldd libgalacticus.so | awk '{if (NF == 4) print $3}' | grep -v -e /libc.so -e /libdl.so -e /libm.so -e /libpthread.so -e /librt.so | xargs -n 1 -i{} cp {} galacticus/lib/
mv galacticus.py galacticus/python/
mv libgalacticus.so galacticus/lib/
tar cvfj libgalacticus.tar.bz2 galacticus
- name: Upload library
uses: actions/upload-artifact@v3
with:
name: galacticus-library
path: 'libgalacticus.tar.bz2'
- run: echo "This job's status is ${{ job.status }}."
### Docker image
Build-Docker-Linux:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: "Detect PR build"
id: detectBranch
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo Running on a PR - will build, but not push
echo "doPush=false" >> "$GITHUB_OUTPUT"
else
echo Running on a non-PR - will build and push
echo "doPush=true" >> "$GITHUB_OUTPUT"
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: galacticusorg/galacticus
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
push: ${{ steps.detectBranch.outputs.doPush }}
tags: ghcr.io/galacticusorg/galacticus:latest
labels: ${{ steps.meta.outputs.labels }}
### Documentation
Build-Documentation-Linux:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Build the docs
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
./scripts/doc/Build_Documentation.sh -f yes -p 2
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: galacticus-docs
path: |
./doc/Galacticus_Usage.pdf
./doc/Galacticus_Physics.pdf
./doc/Galacticus_Development.pdf
./doc/Galacticus_Source.pdf
- run: echo "This job's status is ${{ job.status }}."
### Tools
Build-Tools:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
needs: Build-Executable-Linux
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository datasets
uses: actions/checkout@v4
with:
repository: galacticusorg/datasets
path: datasets
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS+=\ -static" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Download executables
uses: actions/download-artifact@v3
with:
name: galacticus-exec
- name: Build tools
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
mkdir -p $GALACTICUS_DATA_PATH/dynamic
chmod u=wrx ./Galacticus.exe
./Galacticus.exe parameters/buildTools.xml
cd $GALACTICUS_DATA_PATH
classVersion=`awk '{if ($1 == "class:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
cambVersion=`awk '{if ($1 == "camb:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
forutilsVersion=`awk '{if ($1 == "forutils:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
fspsVersion=`awk '{if ($1 == "fsps:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
cloudyVersion=`awk '{if ($1 == "cloudy:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
tar cfj tools.tar.bz2 \
dynamic/CAMB-${cambVersion}/fortran/camb \
dynamic/AxionCAMB/camb \
dynamic/class_public-${classVersion}/class \
dynamic/RecFast/recfast.exe \
dynamic/RecFast/currentVersion \
dynamic/c${cloudyVersion}/source/cloudy.exe \
dynamic/c${cloudyVersion}/data \
dynamic/fsps-${fspsVersion}/src/autosps.exe \
dynamic/fsps-${fspsVersion}/dust \
dynamic/fsps-${fspsVersion}/data \
dynamic/fsps-${fspsVersion}/nebular \
dynamic/fsps-${fspsVersion}/SPECTRA \
dynamic/fsps-${fspsVersion}/OUTPUTS \
dynamic/fsps-${fspsVersion}/ISOCHRONES
- name: Upload tools
uses: actions/upload-artifact@v3
with:
name: galacticus-tools
path: ./datasets/tools.tar.bz2
- run: echo "This job's status is ${{ job.status }}."
## MacOS
### Static executable
Build-Executable-MacOS:
runs-on: macos-11
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS=\"$GALACTICUS_FCFLAGS -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib\"" >> $GITHUB_ENV
echo "PATH=$PATH:/opt/local/bin:/usr/local/bin" >> $GITHUB_ENV
echo "PERL_MM_USE_DEFAULT=1" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Install MacPorts
run: |
curl -L https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg --output MacPorts-2.7.1-11-BigSur.pkg
sudo installer -pkg ./MacPorts-2.7.1-11-BigSur.pkg -target /
rm ./MacPorts-2.7.1-11-BigSur.pkg
- name: Install guile
run: sudo port install guile18
- name: Install libmatheval
run: |
curl -L https://github.com/galacticusorg/libmatheval/releases/download/latest/libmatheval-1.1.12.tar.gz --output libmatheval-1.1.12.tar.gz
tar xvfz libmatheval-1.1.12.tar.gz
cd libmatheval-1.1.12
# Patch following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
sed -E -i~ s/"#undef HAVE_SCM_T_BITS"/"#define HAVE_SCM_T_BITS 1"/ config.h.in
sed -E -i~ s/"-lguile"/"-lguile18"/ configure
sed -E -i~ s/"libguile.h"/"libguile18.h"/g configure tests/matheval.c
# Set guile paths following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
CC=gcc-11 GUILE=/opt/local/bin/guile18 GUILE_CONFIG=/opt/local/bin/guile18-config GUILE_TOOLS=/opt/local/bin/guile18-tools ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf libmatheval-1.1.12.tar.gz libmatheval-1.1.12
- name: Install qhull
run: |
curl -L http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz --output qhull-2020-src-8.0.2.tgz
tar xvfz qhull-2020-src-8.0.2.tgz
cd qhull-2020.2
make -j3 CC=gcc-11 CXX=g++-11
sudo make install
cd ..
rm -rf qhull-2020-src-8.0.2.tgz qhull-2020.2
- name: Install GSL
run: |
curl -L ftp://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz --output gsl-2.6.tar.gz
tar xvfz gsl-2.6.tar.gz
cd gsl-2.6
CC=gcc-11 ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf gsl-2.6 gsl-2.6.tar.gz
- name: Install HDF5
run: |
curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz --output hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
make -j3
sudo make install
cd ..
rm -rf hdf5-1.8.20 hdf5-1.8.20.tar.gz
- name: Install FoX
run: |
curl -L https://github.com/andreww/fox/archive/refs/tags/4.1.0.tar.gz --output FoX-4.1.0.tar.gz
tar xvfz FoX-4.1.0.tar.gz
cd fox-4.1.0
FC=gfortran-11 ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf fox-4.1.0 FoX-4.1.0.tar.gz
- name: Install FFTW3
run: |
curl -L ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz --output fftw-3.3.4.tar.gz
tar xvfz fftw-3.3.4.tar.gz
cd fftw-3.3.4
F77=gfortran-11 CC=gcc-11 ./configure --prefix=/usr/local
make -j4
sudo make install
cd ..
rm -rf fftw-3.3.4 fftw-3.3.4.tar.gz
- name: Install ANN
run: |
curl -L http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ann_1.1.2.tar.gz --output ann_1.1.2.tar.gz
tar xvfz ann_1.1.2.tar.gz
cd ann_1.1.2
sed -E -i~ s/"C\+\+ = g\+\+"/"C\+\+ = g\+\+\-11"/ Make-config
make macosx-g++
cp bin/* /usr/local/bin/.
cp lib/* /usr/local/lib/.
cp -R include/* /usr/local/include/.
- name: Install IO::Socket::SSL
run: |
curl -L https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.90.tar.gz --output Net-SSLeay-1.90.tar.gz
tar xvfz Net-SSLeay-1.90.tar.gz
cd Net-SSLeay-1.90
perl Makefile.PL
make -j3
sudo make install
cd ..
curl -L https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-1.966.tar.gz --output IO-Socket-SSL-1.966.tar.gz
tar xvfz IO-Socket-SSL-1.966.tar.gz
cd IO-Socket-SSL-1.966
perl Makefile.PL
make -j3
sudo make install
cd ..
curl -L https://cpan.metacpan.org/authors/id/M/MK/MKODERER/Sys-CPU-0.52.tar.gz --output Sys-CPU-0.52.tar.gz
tar xvfz Sys-CPU-0.52.tar.gz
cd Sys-CPU-0.52
perl Makefile.PL
make -j3
sudo make install
cd ..
- name: Install CPAN
run: |
sudo perl -MCPAN -e shell
sudo perl -MCPAN -e 'install Bundle::CPAN'
- name: Install Perl modules
run: |
export CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
sudo perl -MCPAN -e 'force("install","NestedMap")'
sudo perl -MCPAN -e 'force("install","Scalar::Util")'
sudo perl -MCPAN -e 'force("install","Term::ANSIColor")'
sudo perl -MCPAN -e 'force("install","Text::Table")'
sudo perl -MCPAN -e 'force("install","ExtUtils::ParseXS")'
sudo perl -MCPAN -e 'install Path::Tiny'
sudo perl -MCPAN -e 'install PkgConfig'
sudo perl -MCPAN -e 'install Alien::Base::Wrapper'
sudo perl -MCPAN -e 'force("install","Alien::Libxml2")'
sudo perl -MCPAN -e 'install XML::LibXML::SAX'
sudo perl -MCPAN -e 'force("install","XML::SAX::ParserFactory")'
sudo perl -MCPAN -e 'force("install","XML::Validator::Schema")'
sudo perl -MCPAN -e 'force("install","Text::Template")'
sudo perl -MCPAN -e 'force("install","List::Uniq")'
sudo perl -MCPAN -e 'force("install","IO::Util")'
sudo perl -MCPAN -e 'force("install","Class::Util")'
sudo perl -MCPAN -e 'force("install","CGI::Builder")'
sudo perl -MCPAN -e 'force("install","Simple")'
sudo perl -MCPAN -e 'force("install","Readonly")'
sudo perl -MCPAN -e 'force("install","File::Slurp")'
sudo perl -MCPAN -e 'force("install","XML::Simple")'
sudo perl -MCPAN -e 'force("install","List::MoreUtils")'
sudo perl -MCPAN -e 'force("install","Clone")'
sudo perl -MCPAN -e 'force("install","IO::Scalar")'
sudo perl -MCPAN -e 'force("install","Regexp::Common")'
sudo perl -MCPAN -e 'install LaTeX::Encode'
sudo perl -MCPAN -e 'install Sub::Identify'
- name: Build Galacticus
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include -I/usr/local/include/libqhullcpp"
export BUILDPATH=./work/build
set -o pipefail
make -j3 Galacticus.exe tests.hashes.cryptographic.exe 2>&1 | tee build.log
./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log`
./scripts/build/staticRelinker.pl `grep '\-o tests.hashes.cryptographic.exe' build.log`
dsymutil -o Galacticus.exe.dSYM Galacticus.exe
zip -r debugSymbolsMacOS.zip Galacticus.exe.dSYM
mv Galacticus.exe Galacticus_MacOS.exe
- name: Upload Galacticus executable
uses: actions/upload-artifact@v3
with:
name: galacticus-exec-MacOS
path: 'Galacticus_MacOS.exe'
- name: Upload test code executables
uses: actions/upload-artifact@v3
with:
name: test-execs-MacOS
path: 'tests.*.exe'
- name: Upload Galacticus debug symbols
uses: actions/upload-artifact@v3
with:
name: galacticus-debug-MacOS
path: 'debugSymbolsMacOS.zip'
## Library
Build-Library-MacOS:
runs-on: macos-11
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS=\"$GALACTICUS_FCFLAGS -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib\"" >> $GITHUB_ENV
echo "PATH=$PATH:/opt/local/bin:/usr/local/bin" >> $GITHUB_ENV
echo "PERL_MM_USE_DEFAULT=1" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max-old-space-size=5120" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Install MacPorts
run: |
curl -L https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg --output MacPorts-2.7.1-11-BigSur.pkg
sudo installer -pkg ./MacPorts-2.7.1-11-BigSur.pkg -target /
rm ./MacPorts-2.7.1-11-BigSur.pkg
- name: Install guile
run: sudo port install guile18
- name: Install libmatheval
run: |
curl -L https://github.com/galacticusorg/libmatheval/releases/download/latest/libmatheval-1.1.12.tar.gz --output libmatheval-1.1.12.tar.gz
tar xvfz libmatheval-1.1.12.tar.gz
cd libmatheval-1.1.12
# Patch following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
sed -E -i~ s/"#undef HAVE_SCM_T_BITS"/"#define HAVE_SCM_T_BITS 1"/ config.h.in
sed -E -i~ s/"-lguile"/"-lguile18"/ configure
sed -E -i~ s/"libguile.h"/"libguile18.h"/g configure tests/matheval.c
# Set guile paths following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
CC=gcc-11 GUILE=/opt/local/bin/guile18 GUILE_CONFIG=/opt/local/bin/guile18-config GUILE_TOOLS=/opt/local/bin/guile18-tools ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf libmatheval-1.1.12.tar.gz libmatheval-1.1.12
- name: Install qhull
run: |
curl -L http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz --output qhull-2020-src-8.0.2.tgz
tar xvfz qhull-2020-src-8.0.2.tgz
cd qhull-2020.2
make -j3 CC=gcc-11 CXX=g++-11
sudo make install
cd ..
rm -rf qhull-2020-src-8.0.2.tgz qhull-2020.2
- name: Install GSL
run: |
curl -L ftp://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz --output gsl-2.6.tar.gz
tar xvfz gsl-2.6.tar.gz
cd gsl-2.6
CC=gcc-11 ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf gsl-2.6 gsl-2.6.tar.gz
- name: Install HDF5
run: |
curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz --output hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
make -j3
sudo make install
cd ..
rm -rf hdf5-1.8.20 hdf5-1.8.20.tar.gz
- name: Install FoX
run: |
curl -L https://github.com/andreww/fox/archive/refs/tags/4.1.0.tar.gz --output FoX-4.1.0.tar.gz
tar xvfz FoX-4.1.0.tar.gz
cd fox-4.1.0
FC=gfortran-11 ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf fox-4.1.0 FoX-4.1.0.tar.gz
- name: Install FFTW3
run: |
curl -L ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz --output fftw-3.3.4.tar.gz
tar xvfz fftw-3.3.4.tar.gz
cd fftw-3.3.4
F77=gfortran-11 CC=gcc-11 ./configure --prefix=/usr/local
make -j4
sudo make install
cd ..
rm -rf fftw-3.3.4 fftw-3.3.4.tar.gz
- name: Install ANN
run: |
curl -L http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ann_1.1.2.tar.gz --output ann_1.1.2.tar.gz
tar xvfz ann_1.1.2.tar.gz
cd ann_1.1.2
sed -E -i~ s/"C\+\+ = g\+\+"/"C\+\+ = g\+\+\-11"/ Make-config
make macosx-g++
cp bin/* /usr/local/bin/.
cp lib/* /usr/local/lib/.
cp -R include/* /usr/local/include/.
- name: Install IO::Socket::SSL
run: |
curl -L https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.90.tar.gz --output Net-SSLeay-1.90.tar.gz
tar xvfz Net-SSLeay-1.90.tar.gz
cd Net-SSLeay-1.90
perl Makefile.PL
make -j3
sudo make install
cd ..
curl -L https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-1.966.tar.gz --output IO-Socket-SSL-1.966.tar.gz
tar xvfz IO-Socket-SSL-1.966.tar.gz
cd IO-Socket-SSL-1.966
perl Makefile.PL
make -j3
sudo make install
cd ..
cd ..
curl -L https://cpan.metacpan.org/authors/id/M/MK/MKODERER/Sys-CPU-0.52.tar.gz --output Sys-CPU-0.52.tar.gz
tar xvfz Sys-CPU-0.52.tar.gz
cd Sys-CPU-0.52
perl Makefile.PL
make -j3
sudo make install
- name: Install CPAN
run: |
sudo perl -MCPAN -e shell
sudo perl -MCPAN -e 'install Bundle::CPAN'
- name: Install Perl modules
run: |
export CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
sudo perl -MCPAN -e 'force("install","NestedMap")'
sudo perl -MCPAN -e 'force("install","Scalar::Util")'
sudo perl -MCPAN -e 'force("install","Term::ANSIColor")'
sudo perl -MCPAN -e 'force("install","Text::Table")'
sudo perl -MCPAN -e 'force("install","ExtUtils::ParseXS")'
sudo perl -MCPAN -e 'install Path::Tiny'
sudo perl -MCPAN -e 'install PkgConfig'
sudo perl -MCPAN -e 'install Alien::Base::Wrapper'
sudo perl -MCPAN -e 'force("install","Alien::Libxml2")'
sudo perl -MCPAN -e 'install XML::LibXML::SAX'
sudo perl -MCPAN -e 'force("install","XML::SAX::ParserFactory")'
sudo perl -MCPAN -e 'force("install","XML::Validator::Schema")'
sudo perl -MCPAN -e 'force("install","Text::Template")'
sudo perl -MCPAN -e 'force("install","List::Uniq")'
sudo perl -MCPAN -e 'force("install","IO::Util")'
sudo perl -MCPAN -e 'force("install","Class::Util")'
sudo perl -MCPAN -e 'force("install","CGI::Builder")'
sudo perl -MCPAN -e 'force("install","Simple")'
sudo perl -MCPAN -e 'force("install","Readonly")'
sudo perl -MCPAN -e 'force("install","File::Slurp")'
sudo perl -MCPAN -e 'force("install","XML::Simple")'
sudo perl -MCPAN -e 'force("install","List::MoreUtils")'
sudo perl -MCPAN -e 'force("install","Clone")'
sudo perl -MCPAN -e 'force("install","IO::Scalar")'
sudo perl -MCPAN -e 'force("install","Regexp::Common")'
sudo perl -MCPAN -e 'install LaTeX::Encode'
sudo perl -MCPAN -e 'install Sub::Identify'
- name: Build Galacticus
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include -I/usr/local/include/libqhullcpp"
make -j3 GALACTICUS_BUILD_OPTION=lib libgalacticus.so
- name: Package the code
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include -I/usr/local/include/libqhullcpp"
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
mkdir galacticus
mkdir galacticus/lib
mkdir galacticus/python
# Find all dynamic libraries needed (filtering out any non-"local" ones) and copy to our folder.
otool -L libgalacticus.so | awk '{if (NR > 1) print $1}' | grep -e /usr/local -e /opt/local | xargs -n 1 -I{} cp {} galacticus/lib/
mv galacticus.py galacticus/python/
mv libgalacticus.so galacticus/lib/
zip -r libgalacticusMacOS.zip galacticus
- name: Upload library
uses: actions/upload-artifact@v3
with:
name: galacticus-library-MacOS
path: 'libgalacticusMacOS.zip'
### Tools
Build-Tools-MacOS:
runs-on: macos-11
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository datasets
uses: actions/checkout@v4
with:
repository: galacticusorg/datasets
path: datasets
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
echo "GALACTICUS_FCFLAGS=\"$GALACTICUS_FCFLAGS -static -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib\"" >> $GITHUB_ENV
echo "PATH=$PATH:/opt/local/bin:/usr/local/bin" >> $GITHUB_ENV
echo "PERL_MM_USE_DEFAULT=1" >> $GITHUB_ENV
echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Install MacPorts
run: |
curl -L https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg --output MacPorts-2.7.1-11-BigSur.pkg
sudo installer -pkg ./MacPorts-2.7.1-11-BigSur.pkg -target /
rm ./MacPorts-2.7.1-11-BigSur.pkg
- name: Install guile
run: sudo port install guile18
- name: Install libmatheval
run: |
curl -L https://github.com/galacticusorg/libmatheval/releases/download/latest/libmatheval-1.1.12.tar.gz --output libmatheval-1.1.12.tar.gz
tar xvfz libmatheval-1.1.12.tar.gz
cd libmatheval-1.1.12
# Patch following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
sed -E -i~ s/"#undef HAVE_SCM_T_BITS"/"#define HAVE_SCM_T_BITS 1"/ config.h.in
sed -E -i~ s/"-lguile"/"-lguile18"/ configure
sed -E -i~ s/"libguile.h"/"libguile18.h"/g configure tests/matheval.c
# Set guile paths following the approach used in MacPorts (https://github.com/macports/macports-ports/tree/master/math/libmatheval).
CC=gcc-11 GUILE=/opt/local/bin/guile18 GUILE_CONFIG=/opt/local/bin/guile18-config GUILE_TOOLS=/opt/local/bin/guile18-tools ./configure --prefix=/usr/local
make -j3
sudo make install
cd ..
rm -rf libmatheval-1.1.12.tar.gz libmatheval-1.1.12
- name: Install md5sum
run: sudo port install md5sha1sum
- name: Install GSL
run: |
curl -L ftp://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz --output gsl-2.6.tar.gz
tar xvfz gsl-2.6.tar.gz
cd gsl-2.6
CC=gcc-11 ./configure --prefix=/usr/local
make -j3
sudo make install
rm -rf gsl-2.6 gsl-2.6.tar.gz
- name: Install HDF5
run: |
curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz --output hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
make -j3
sudo make install
rm -rf hdf5-1.8.20 hdf5-1.8.20.tar.gz
- name: Install FoX
run: |
curl -L https://github.com/andreww/fox/archive/refs/tags/4.1.0.tar.gz --output FoX-4.1.0.tar.gz
tar xvfz FoX-4.1.0.tar.gz
cd fox-4.1.0
FC=gfortran-11 ./configure --prefix=/usr/local
make -j3
sudo make install
rm -rf fox-4.1.0 FoX-4.1.0.tar.gz
- name: Install FFTW3
run: |
curl -L ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz --output fftw-3.3.4.tar.gz
tar xvfz fftw-3.3.4.tar.gz
cd fftw-3.3.4
F77=gfortran-11 CC=gcc-11 ./configure --prefix=/usr/local
make -j4
sudo make install
rm -rf fftw-3.3.4 fftw-3.3.4.tar.gz
- name: Install ANN
run: |
curl -L http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ann_1.1.2.tar.gz --output ann_1.1.2.tar.gz
tar xvfz ann_1.1.2.tar.gz
cd ann_1.1.2
sed -E -i~ s/"C\+\+ = g\+\+"/"C\+\+ = g\+\+\-11"/ Make-config
make macosx-g++
cp bin/* /usr/local/bin/.
cp lib/* /usr/local/lib/.
cp -R include/* /usr/local/include/.
- name: Install IO::Socket::SSL
run: |
curl -L https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.90.tar.gz --output Net-SSLeay-1.90.tar.gz
tar xvfz Net-SSLeay-1.90.tar.gz
cd Net-SSLeay-1.90
perl Makefile.PL
make -j3
sudo make install
cd ..
curl -L https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-1.966.tar.gz --output IO-Socket-SSL-1.966.tar.gz
tar xvfz IO-Socket-SSL-1.966.tar.gz
cd IO-Socket-SSL-1.966
perl Makefile.PL
make -j3
sudo make install
cd ..
- name: Install CPAN
run: |
sudo perl -MCPAN -e shell
sudo perl -MCPAN -e 'install Bundle::CPAN'
- name: Install Perl modules
run: |
export CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
sudo perl -MCPAN -e 'force("install","NestedMap")'
sudo perl -MCPAN -e 'force("install","Scalar::Util")'
sudo perl -MCPAN -e 'force("install","Term::ANSIColor")'
sudo perl -MCPAN -e 'force("install","Text::Table")'
sudo perl -MCPAN -e 'force("install","ExtUtils::ParseXS")'
sudo perl -MCPAN -e 'install Path::Tiny'
sudo perl -MCPAN -e 'install PkgConfig'
sudo perl -MCPAN -e 'install Alien::Base::Wrapper'
sudo perl -MCPAN -e 'force("install","Alien::Libxml2")'
sudo perl -MCPAN -e 'install XML::LibXML::SAX'
sudo perl -MCPAN -e 'force("install","XML::SAX::ParserFactory")'
sudo perl -MCPAN -e 'force("install","XML::Validator::Schema")'
sudo perl -MCPAN -e 'force("install","Text::Template")'
sudo perl -MCPAN -e 'force("install","List::Uniq")'
sudo perl -MCPAN -e 'force("install","IO::Util")'
sudo perl -MCPAN -e 'force("install","Class::Util")'
sudo perl -MCPAN -e 'force("install","CGI::Builder")'
sudo perl -MCPAN -e 'force("install","Simple")'
sudo perl -MCPAN -e 'force("install","Readonly")'
sudo perl -MCPAN -e 'force("install","File::Slurp")'
sudo perl -MCPAN -e 'force("install","XML::Simple")'
sudo perl -MCPAN -e 'force("install","List::MoreUtils")'
sudo perl -MCPAN -e 'force("install","Clone")'
sudo perl -MCPAN -e 'force("install","IO::Scalar")'
sudo perl -MCPAN -e 'force("install","Regexp::Common")'
sudo perl -MCPAN -e 'install LaTeX::Encode'
sudo perl -MCPAN -e 'install Sub::Identify'
sudo perl -MCPAN -e 'install Sys::CPU'
- name: Build Galacticus
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/lib/gfortran/modules -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include"
make -j3 Galacticus.exe
- name: Build tools
run: |
export GALACTICUS_EXEC_PATH=`pwd`
export FCCOMPILER=gfortran-11
export CCOMPILER=gcc-11
export CPPCOMPILER=g++-11
export GALACTICUS_FCFLAGS="-fintrinsic-modules-path /usr/local/include -L/usr/local/lib -L/opt/local/lib"
export GALACTICUS_CFLAGS="-I/usr/local/include -I/opt/local/include"
export GALACTICUS_CPPFLAGS="-I/usr/local/include -I/opt/local/include"
classVersion=`awk '{if ($1 == "class:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
cambVersion=`awk '{if ($1 == "camb:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
forutilsVersion=`awk '{if ($1 == "forutils:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
fspsVersion=`awk '{if ($1 == "fsps:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
cloudyVersion=`awk '{if ($1 == "cloudy:") print $2}' ${GALACTICUS_EXEC_PATH}/aux/dependencies.yml`
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
mkdir -p $GALACTICUS_DATA_PATH/dynamic
set -o pipefail
./Galacticus.exe parameters/buildTools.xml 2>&1 | tee build.log
cd $GALACTICUS_DATA_PATH/dynamic/CAMB-${cambVersion}/fortran/
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl gfortran-11 -cpp -Ofast -fopenmp -fintrinsic-modules-path /usr/local/include -L/usr/local/lib -L/opt/local/lib -JRelease -IRelease/ -I"/Users/runner/work/galacticus/galacticus/datasets/dynamic/CAMB-${cambVersion}/fortran/../forutils/Release/" Release/inidriver.o Release/libcamb.a -L"/Users/runner/work/galacticus/galacticus/datasets/dynamic/CAMB-${cambVersion}/fortran/../forutils/Release/" -lforutils -o camb
cd $GALACTICUS_DATA_PATH/dynamic/AxionCAMB/
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl gfortran-11 -O3 -fintrinsic-modules-path /usr/local/include -L/usr/local/lib -L/opt/local/lib constants.o utils.o subroutines.o inifile.o power_tilt.o recfast_axion.o reionization.o modules.o bessels.o equations_ppf.o halofit_ppf.o lensing.o SeparableBispectrum.o cmbmain.o camb.o axion_background.o inidriver_axion.F90 -o camb
cd $GALACTICUS_DATA_PATH/dynamic/class_public-${classVersion}/
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl `grep -E '\-o class ' $GALACTICUS_EXEC_PATH/build.log`
cd $GALACTICUS_DATA_PATH/dynamic/RecFast/
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl gfortran-11 recfast.for -o recfast.exe -O3 -ffixed-form -ffixed-line-length-none
cd $GALACTICUS_DATA_PATH/dynamic/c${cloudyVersion}/source/
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl `grep -E '\-o cloudy.exe' $GALACTICUS_EXEC_PATH/build.log`
cd $GALACTICUS_DATA_PATH/dynamic/fsps-${fspsVersion}/src
$GALACTICUS_EXEC_PATH/scripts/build/staticRelinker.pl `grep -E '\-o autosps.exe' $GALACTICUS_EXEC_PATH/build.log`
cd $GALACTICUS_DATA_PATH
zip -r toolsMacOS.zip \
dynamic/CAMB-${cambVersion}/fortran/camb \
dynamic/AxionCAMB/camb \
dynamic/class_public-${classVersion}/class \
dynamic/RecFast/recfast.exe \
dynamic/RecFast/currentVersion \
dynamic/c${cloudyVersion}/source/cloudy.exe \
dynamic/c${cloudyVersion}/data \
dynamic/fsps-${fspsVersion}/src/autosps.exe \
dynamic/fsps-${fspsVersion}/dust \
dynamic/fsps-${fspsVersion}/data \
dynamic/fsps-${fspsVersion}/nebular \
dynamic/fsps-${fspsVersion}/SPECTRA \
dynamic/fsps-${fspsVersion}/OUTPUTS \
dynamic/fsps-${fspsVersion}/ISOCHRONES
- name: Upload Galacticus executable
uses: actions/upload-artifact@v3
with:
name: galacticus-tools-MacOS
path: './datasets/toolsMacOS.zip'
- run: echo "This job's status is ${{ job.status }}."
# Benchmarks
Benchmark-Dark-Matter-Only-Subhalos:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
needs: Build-Executable-Linux
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository datasets
uses: actions/checkout@v4
with:
repository: galacticusorg/datasets
path: datasets
- run: echo "The $githubrepository repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
- name: Download executables
uses: actions/download-artifact@v3
with:
name: galacticus-exec
- name: Install tools
run: |