Skip to content

Commit

Permalink
Bump to 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gsleap committed Jun 26, 2020
1 parent 9278c44 commit 516d8be
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:

- name: Get cfitsio
run: |
wget "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" -O cfitsio.tar.gz;
wget "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.48.tar.gz" -O cfitsio.tar.gz;
tar -xvf cfitsio.tar.gz;
cd cfitsio-3.47
cd cfitsio-3.48
./configure --prefix=/usr/local --enable-reentrant;
make clean && make;
sudo make install;
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
Changes in each release are listed below.

## 0.3.2 25-June-2020 (Pre-release)
* libmwalib.so now has statically linked libcfitsio library as cfitsio's ABI keeps changing making linking difficult for users.

## 0.3.1 08-June-2020 (Pre-release)
* Bugfix: Fixed panic when all 24 coarse channels are using receiver channel numbers >128.
* Added more inline documentation for mwalib.h.
Expand Down
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mwalib"
version = "0.3.0"
version = "0.3.2"
homepage = "https://github.com/MWATelescope/mwalib"
authors = ["Greg Sleap <[email protected]>",
"Christopher H. Jordan <[email protected]>"]
Expand All @@ -19,21 +19,21 @@ codegen-units = 1 # Set this to 1 in Cargo.toml to allow for maximum size redu
crate-type = ["rlib", "staticlib", "cdylib"]

[dependencies]
anyhow = "1.0.28"
chrono = "0.4.11"
fitsio = "0.15.0"
fitsio-sys = "0.3.0"
lazy_static = "1.4.0"
libc = "0.2.69"
rayon = "1.3.0"
regex = "1.3.7"
anyhow = "1.0.*"
chrono = "0.4.*"
fitsio = "0.15.*"
fitsio-sys = "0.3.*"
lazy_static = "1.4.*"
libc = "0.2.*"
rayon = "1.3.*"
regex = "1.3.*"

[dev-dependencies]
criterion = "0.3.2"
csv = "1.1.3"
float-cmp = "0.7.0"
structopt = "0.3.14"
tempdir = "0.3.7"
criterion = "0.3.*"
csv = "1.1.*"
float-cmp = "0.7.*"
structopt = "0.3.*"
tempdir = "0.3.*"

[[bench]]
name = "bench"
Expand Down
24 changes: 24 additions & 0 deletions LICENSE-cfitsio
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CFITSIO (See: https://heasarc.gsfc.nasa.gov/fitsio/)

Copyright (Unpublished--all rights reserved under the copyright laws of
the United States), U.S. Government as represented by the Administrator
of the National Aeronautics and Space Administration. No copyright is
claimed in the United States under Title 17, U.S. Code.
Permission to freely use, copy, modify, and distribute this software
and its documentation without fee is hereby granted, provided that this
copyright notice and disclaimer of warranty appears in all copies.
DISCLAIMER:
THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NASA BE LIABLE FOR ANY
DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
SERVICES PROVIDED HEREUNDER.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ the rendered documentation.
presented in the data is calculated as `n/2 * (n+1)` (where `n` is the
number of antennas).

## Installation
It is possible that a dynamic-shared and/or static objects can be provided on
GitHub in the future, but for now, `mwalib` should be compiled from source.

## Building From Source
You can build mwalib from source:
- Install rust

`https://www.rust-lang.org/tools/install`
Expand Down Expand Up @@ -96,6 +94,28 @@ GitHub in the future, but for now, `mwalib` should be compiled from source.
Install `cbindgen` with your package manager or via `cargo` with `cargo
install cbindgen`.

## Installation
As an alternative to building from source, we produce github releases whenever features or bug fixes are completed as tarballs. In the release you will find everything you need to use mwalib from C/C++/Python or any other language that can utilise shared libraries:
* lib/libmwalib.a (Statically compiled library)
* lib/libmwalib.so (Dynamic library)
* include/mwalib.h (C Header file)
* CHANGELOG.md (Change log for this and previous relases)
* LICENSE (License for using mwalib in your projects)
* LICENSE-cfitsio (Since libcfitsio is statically compiled into our static and dynamic libraries, we also include it's license)

To install on a regular linux x86/64 distribution, the following would be all that is needed:
- Download release from mwalib [github releases](https://github.com/MWATelescope/mwalib/releases).
`wget "https://github.com/MWATelescope/mwalib/releases/download/v0.3.1/libmwalib-0.3.1-linux_x86_64.tar.gz" -O mwalib.tar.gz`

- Untar the tarball
`mkdir mwalib; tar xvf mwalib.tar.gz -C mwalib`

- Install
`sudo cp mwalib/lib/libmwalib.* /usr/local/lib`
`sudo cp mwalib/include/libmwalib.h /usr/local/include`

- Register the library with ldconfig
'sudo ldconfig'

## Consistency checks
(TODO: This is non-exhaustive!)
Expand Down
28 changes: 28 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use std::env;

fn main() {
//
// Link to shared or static CFITSIO
//
// Check if we have this environment variable
// If we do, then we will link to cfitsio statically
// But if so, you need to have:
// 1. libcfitsio.a in your LD_LIBRARY_PATH or PATH
// AND
// 2. libcfitsio.a needs to have been built with the following ./configure statement:
// ./configure --disable-curl --prefix=/usr/local --enable-reentrant
match env::var("MWALIB_LINK_STATIC_CFITSIO") {
Ok(val) => {
match val.as_str() {
"0" => {
println!("cargo:warning=rustc will link with the shared libcfitsio.so library. Set MWALIB_LINK_STATIC_CFITSIO=1 in your environment to link statically.")
},
_ => {
println!("cargo:rustc-link-lib=static=cfitsio");
println!("cargo:warning=rustc will link with the static libcfitsio.a library. Remove MWALIB_LINK_STATIC_CFITSIO from your environment (or set to 0) to link dynamically.");
}
}
},
Err(_) => println!("cargo:warning=rustc will link with the shared libcfitsio.so library. Set MWALIB_LINK_STATIC_CFITSIO=1 in your environment to link statically."),
}
}
22 changes: 22 additions & 0 deletions tools/make_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
echo "Making release..."
echo "Cleaning up previous release files..."
rm -rf ../target
rm -rf release
echo "Building mwalib..."
cargo build --release -v
cbindgen -l c .. > ../include/mwalib.h
echo "mwalib.h has been regenerated in ../include/mwalib.h"
echo "Packaging up mwalib..."
mkdir -p release
mkdir -p release/lib
mkdir -p release/include
cp ../target/release/libmwalib.a release/lib/.
cp ../target/release/libmwalib.so release/lib/.
cp ../LICENSE release/.
cp ../LICENSE-cfitsio release/.
cp ../CHANGELOG.md release/.
cp ../include/mwalib.h release/include/.
cd release
echo "Taring files..."
tar -czvf libmwalib-0.3.2-linux_x86_64.tar.gz lib/libmwalib.a lib/libmwalib.so include/mwalib.h LICENSE LICENSE-cfitsio CHANGELOG.md
echo "Release complete!"

0 comments on commit 516d8be

Please sign in to comment.