Skip to content

Commit 8967737

Browse files
committed
Merge branch 'fixes' into 'main'
Adds Explicit CMake files for libra.so See merge request ardg/libra!107
2 parents 0a43ff6 + bb08a5d commit 8967737

38 files changed

+812
-578
lines changed

.gitlab-ci.yml

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
11
stages:
22
- build
33
- test
4-
- production
54

65
variables:
76
CCACHE_BASEDIR: $CI_PROJECT_DIR
87
CCACHE_DIR: $CI_PROJECT_DIR/ccache
98
GIT_CLEAN_FLAGS: none
109

1110
cache:
12-
key: ccache_main
11+
key: ccache
1312
paths:
1413
- $CCACHE_DIR
1514

16-
1715
build-job:
1816
stage: build
1917
rules:
2018
- changes:
21-
- (exclude)README.md
22-
- (exclude)scripts/**/*
23-
- (exclude)doc/**/*
24-
when: never
25-
- if: '$CI_COMMIT_MESSAGE =~ /\[ci.skip\]/'
26-
when: never
27-
- if: '$CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/'
28-
when: always
29-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
30-
when: always
31-
- if: '$CI_COMMIT_REF_NAME == "main" && ($CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/) && $CI_COMMIT_MESSAGE !~ /\[ci.skip\]/'
32-
when: always
19+
- (exclude)README.md
20+
- (exclude)scripts/**/*
21+
- (exclude)doc/**/*
3322

3423
before_script:
3524
- export CCACHE_BASEDIR="$PWD"
3625
- export CCACHE_DIR="$PWD/ccache"
3726
- export CCACHE_COMPILERCHECK=content
27+
- if [ -f "$CI_PROJECT_DIR/ccache.tar.gz" ]; then tar -xzf "$CI_PROJECT_DIR/ccache.tar.gz" -C $CCACHE_DIR; fi
28+
- mkdir -p $CCACHE_DIR
3829
- ccache --zero-stats || true
3930
- ccache --show-stats || true
4031
- git clean -ffdx
@@ -44,53 +35,50 @@ build-job:
4435
- echo $PATH
4536
- nvidia-smi
4637
- which nvcc
47-
- mkdir build
38+
- mkdir -p build
4839
- cd build
4940
- cmake -DApps_BUILD_TESTS=ON -DKokkos_CUDA_ARCH_NAME=Kokkos_ARCH_VOLTA70 ..
5041
- make
51-
- echo "Compile complete."
52-
42+
5343
after_script:
5444
- export CCACHE_DIR="$PWD/ccache"
5545
- ccache --show-stats || true
46+
- tar -czf ${CCACHE_DIR}/ccache.tar.gz $CCACHE_DIR
47+
- mv ${CCACHE_DIR}/ccache.tar.gz $CI_PROJECT_DIR/
48+
49+
artifacts:
50+
paths:
51+
- build
52+
- ${CCACHE_DIR}/ccache.tar.gz
5653

5754
test-job:
5855
stage: test
5956
rules:
6057
- changes:
61-
- (exclude)README.md
62-
- (exclude)scripts/**/*
63-
- (exclude)doc/**/*
64-
when: never
65-
- if: '$CI_COMMIT_MESSAGE =~ /\[ci.skip\]/'
58+
- (exclude)README.md
59+
- (exclude)scripts/**/*
60+
- (exclude)doc/**/*
6661
when: never
67-
- if: '$CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/'
68-
when: always
69-
- if: '$CI_COMMIT_MESSAGE =~ /\[ci test\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.test\]/'
70-
when: always
71-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
72-
when: always
73-
- if: '$CI_COMMIT_REF_NAME == "main" && ($CI_COMMIT_MESSAGE =~ /\[ci test\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.test\]/) && ($CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/) && $CI_COMMIT_MESSAGE !~ /\[ci.skip\]/'
74-
when: always
62+
63+
dependencies:
64+
- build-job
65+
66+
before_script:
67+
- export CCACHE_DIR="$PWD/ccache"
68+
- mkdir -p $CCACHE_DIR
69+
- tar -xzf ${CCACHE_DIR}/ccache.tar.gz -C $CCACHE_DIR || true
7570

7671
script:
7772
- echo $PWD
7873
- base_path=$PWD
7974
- echo "Entering $PWD/apps/src/tests to run apps unit tests"
8075
- cd ${base_path}/apps/src/tests
81-
- ${base_path}/build/Libra/apps/src/tests/LibRATests --gtest_output="report.xml"
82-
- python -m pytest --junitxml=pytest_report.xml
76+
- ${base_path}/install/bin/tests/LibRATests --gtest_output="xml:${base_path}/apps/src/tests/report.xml"
77+
- python -m pytest --junitxml=${base_path}/apps/src/tests/pytest_report.xml
8378

8479
artifacts:
8580
when: always
8681
reports:
87-
junit: ./report.xml
88-
junit: ./pytest_report.xml
89-
90-
production-job:
91-
stage: production
92-
only:
93-
- manual
94-
script:
95-
- echo "Deploying to production..."
96-
# Add your deployment commands here
82+
junit:
83+
- ${base_path}/apps/src/tests/report.xml
84+
- ${base_path}/apps/src/tests/pytest_report.xml

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ does not required RA-specific software stack and dependencies.
5151

5252
A containerized means of building the LibRA project is available
5353
[here](https://gitlab.nrao.edu/ardg/libra-containers). This is mirrored [here](https://github.com/ARDG-NRAO/libra-containers).
54+
Please create a ticket on github to interact with us.
5455

5556

5657
The `main` branch of this project is also mirrored [here](https://github.com/ARDG-NRAO/LibRA).

apps/CMakeLists.txt

Lines changed: 96 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ set(CMAKE_C_FLAGS "${OPT} -std=c++11 -DUseCasacoreNamespace -Wno-deprecated \
7070
set(APP_LINK_LIBRARIES
7171
casacpp_synthesis
7272
casacpp_msvis
73+
librautils
74+
libracore
7375
hpg
7476
kokkoscore
7577
casa_msfits
@@ -114,15 +116,99 @@ set(CMAKE_BUILD_TYPE "${BUILD_TYPE}")
114116

115117

116118
# add and build each APP
117-
set(APP_LIST Coyote Hummbee RoadRunner Dale Chip MSSplit SubMS TableInfo Asp Asp_mdspan Restore Restore_mdspan Acme)
118-
119-
foreach(APP IN LISTS APP_LIST)
120-
set(APP_DIR ${APP})
121-
string(TOLOWER ${APP_DIR} APP_NAME)
122-
list(APPEND APP_SOURCES "${APP_DIR}/${APP_NAME}.cc")
123-
file(GLOB APP_SOURCE "${APP_DIR}/*.h")
124-
list(APPEND APP_SOURCES)
125-
endforeach()
119+
set(APP_LIST Coyote Hummbee RoadRunner Chip Dale Acme MSSplit SubMS TableInfo Asp Asp_mdspan Restore Restore_mdspan)
120+
121+
set (ACME_SOURCES
122+
Acme/acme.cc
123+
Acme/acme.h
124+
)
125+
126+
set (ASP_SOURCES
127+
Asp/asp.cc
128+
Asp/asp.h
129+
)
130+
131+
set (ASP_MDSPAN_SOURCES
132+
Asp_mdspan/asp_mdspan.cc
133+
Asp_mdspan/asp_mdspan.h
134+
)
135+
136+
set (CHIP_SOURCES
137+
Chip/chip.cc
138+
Chip/chip.h
139+
)
140+
141+
set (COYOTE_SOURCES
142+
Coyote/coyote.cc
143+
Coyote/coyote.h
144+
)
145+
146+
set (DALE_SOURCES
147+
Dale/dale.cc
148+
Dale/dale.h
149+
)
150+
151+
set (HUMMBEE_SOURCES
152+
Hummbee/hummbee.cc
153+
Hummbee/hummbee.h
154+
)
155+
156+
set (MSSPLIT_SOURCES
157+
MSSplit/mssplit.cc
158+
MSSplit/mssplit.h
159+
)
160+
161+
set (RESTORE_SOURCES
162+
Restore/restore.cc
163+
Restore/restore.h
164+
)
165+
166+
set (RESTORE_MDSPAN_SOURCES
167+
Restore_mdspan/restore_mdspan.cc
168+
Restore_mdspan/restore_mdspan.h
169+
)
170+
171+
set (ROADRUNNER_SOURCES
172+
RoadRunner/roadrunner.cc
173+
RoadRunner/roadrunner.h
174+
# RoadRunner/DataBase.h
175+
# RoadRunner/DataIterations.h
176+
# RoadRunner/MakeComponents.h
177+
# RoadRunner/rWeightor.h
178+
# RoadRunner/ThreadCoordinator.h
179+
)
180+
181+
set (SUBMS_SOURCES
182+
SubMS/subms.cc
183+
SubMS/subms.h
184+
)
185+
186+
set (TABLEINFO_SOURCES
187+
TableInfo/tableinfo.cc
188+
TableInfo/tableinfo.h
189+
)
190+
191+
# set(UTILITIES_SOURCES
192+
# Utilities/backup.cc
193+
# Utilities/backup.h
194+
# )
195+
196+
set (LIBRA_SOURCES
197+
${ACME_SOURCES}
198+
${ASP_SOURCES}
199+
${ASP_MDSPAN_SOURCES}
200+
${CHIP_SOURCES}
201+
${COYOTE_SOURCES}
202+
${HUMMBEE_SOURCES}
203+
${MSSPLIT_SOURCES}
204+
${RESTORE_SOURCES}
205+
${RESTORE_MDSPAN_SOURCES}
206+
${ROADRUNNER_SOURCES}
207+
${SUBMS_SOURCES}
208+
${TABLEINFO_SOURCES}
209+
# ${UTILITIES_SOURCES}
210+
${DALE_SOURCES}
211+
)
126212

127213
# add and build googletest
128214
if(Apps_BUILD_TESTS)
@@ -134,3 +220,4 @@ add_subdirectory(src/translation)
134220

135221
add_subdirectory(src)
136222

223+

apps/src/Acme/acme.cc

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,14 @@
3232
#include <casacore/casa/OS/DirectoryIterator.h>
3333
#include <casacore/casa/OS/File.h>
3434
#include <casacore/casa/OS/Path.h>
35+
#include <librautils/utils.h>
3536

3637

3738
//
3839
//-------------------------------------------------------------------------
3940

4041
namespace Acme
4142
{
42-
bool imageExists(const string& imagename)
43-
{
44-
Directory image(imagename);
45-
return image.exists();
46-
}
47-
48-
void checkImageMax(const string& name,
49-
const ImageInterface<Float>& target,
50-
LogIO& logio)
51-
{
52-
float mim = max(target.get());
53-
54-
{
55-
stringstream os;
56-
os << fixed << setprecision(numeric_limits<float>::max_digits10)
57-
<< "Image stats: "
58-
<< " max(" << name << ") = " << mim;
59-
logio << os.str() << LogIO::POST;
60-
}
61-
62-
float threshold = 1e20;
63-
if (mim >= threshold)
64-
throw(AipsError("Image amplitude is out of range."));
65-
}
66-
6743

6844
void acme(std::string& imageName, const string& stats)
6945
{
@@ -95,15 +71,15 @@ namespace Acme
9571
LatticeBase *targetPtr;
9672
ImageInterface<Float> *targetImage;
9773

98-
if (! imageExists(imageName))
74+
if (! librautils::imageExists(imageName))
9975
throw(AipsError(string("Image ") + imageName + string(" does not exist.")));
10076

10177
targetPtr = ImageOpener::openImage (imageName);
10278
targetImage = dynamic_cast<ImageInterface<Float>*>(targetPtr);
10379

10480
if (stats=="checkamp")
10581
{
106-
checkImageMax(imageName, *targetImage, logio);
82+
librautils::checkImageMax(imageName, *targetImage, logio);
10783
}
10884
else if (stats=="all")
10985
{

apps/src/Acme/acme_py_interface.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <pybind11/pybind11.h>
2-
#include "acme.h"
2+
#include <acme.h>
33

44
using namespace Acme;
55

0 commit comments

Comments
 (0)