Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis-CI and AppVeyor support #34

Merged
merged 9 commits into from
Nov 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
language: generic

env:
global:
- CXXFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wimplicit -Wimplicit-function-declaration -Wimplicit-int"
- CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wimplicit -Wimplicit-function-declaration -Wimplicit-int"
- LD_LIBRARY_PATH='/usr/local/lib'
- PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'

matrix:
include:
- os: linux
dist: trusty
addons:
apt:
sources:
- sourceline: 'deb [arch=amd64] http://xmi-apt.tomschoonjans.eu/ubuntu trusty stable'
key_url: 'http://xmi-apt.tomschoonjans.eu/xmi.packages.key'
packages:
- libxrl7-dev
- os: linux
dist: trusty
env: WITH_XMI_MSIM='yes' EXTRA_ARGS='--enable-xmi-msim'
addons:
apt:
sources:
- sourceline: 'deb [arch=amd64] http://xmi-apt.tomschoonjans.eu/ubuntu trusty stable'
key_url: 'http://xmi-apt.tomschoonjans.eu/xmi.packages.key'
packages:
- libxmimsim0-dev
- libgsl0-dev # this line shouldn't be here and is an error in the fgsl debbuild files...
- os: osx
sudo: required
env: BREW_EXTRA='llvm' CC='/usr/local/opt/llvm/bin/clang' CXX='/usr/local/opt/llvm/bin/clang++'
- os: osx
sudo: required
env: BREW_EXTRA='gcc@7' CC='/usr/local/opt/gcc@7/bin/gcc-7' CXX='/usr/local/opt/gcc@7/bin/g++-7'

before_install:
- |
if [ "$TRAVIS_OS_NAME" == "osx" ] ; then
brew cask uninstall --force oclint
brew uninstall --force --ignore-dependencies $(brew list) || exit 1
brew update || exit 1
brew cleanup -s || exit 1
rm -rf $(brew --cache) || exit 1
brew install pkg-config gettext autoconf automake libtool homebrew/science/xraylib || exit 1
brew install $BREW_EXTRA || exit 1
brew cleanup -s || exit 1
rm -rf $(brew --cache) || exit 1
fi

script:
- autoreconf -fi || exit 1
- ./configure ${EXTRA_ARGS} || exit 1
- make || exit 1
- if [ "$WITH_XMI_MSIM" != "yes" ] ; then make check || exit 1 ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$WITH_XMI_MSIM" != "yes" ] ; then make distcheck || exit 1 ; fi

notifications:
email:
recipients:
- Tom.Schoonjans@me.com
- golosio@unica.it
on_success: never
on_failure: always

branches:
only:
- master
30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 1.0.{build}

environment:
matrix:
- compiler: msvc_msys2
ARCH: x64
MSYS2_ARCH: x86_64
MSYS2_DIR: msys64
MSYSTEM: MINGW64
- compiler: msvc_msys2
ARCH: x86
MSYS2_ARCH: i686
MSYS2_DIR: msys64
MSYSTEM: MINGW32

before_build:
- set PATH=C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%
- bash -lc "for i in {1..3}; do update-core && break || sleep 15; done"
- bash -lc "for i in {1..3}; do pacman --noconfirm -Su mingw-w64-%MSYS2_ARCH%-{gcc,libtool} automake autoconf make wget tar && break || sleep 15; done"
- bash -lc "wget https://xraylib.tomschoonjans.eu/xraylib-3.3.0.tar.gz && tar xvfz xraylib-3.3.0.tar.gz && cd xraylib-3.3.0 && ./configure --prefix=/usr/local --disable-all-bindings && make && make check && make install && cd .."

build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- echo %cd%
- dir
- bash -lc "cd $APPVEYOR_BUILD_FOLDER && exec 0</dev/null && ACLOCAL_PATH=/usr/local/share/aclocal autoreconf -fi && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig ./configure && make && make check && make distcheck"

branches:
only:
- master
2 changes: 1 addition & 1 deletion examples/anisotropicsource/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/beamsource/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/cylind_shell/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/fluor_layers/detector_0deg.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 2000 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
;AsciiFlag 0 ; binary(0) or ascii(1) file format
PixelType 2 ; Pixel content type:
; 0: fluence, 1: energy fluence,
Expand Down
2 changes: 1 addition & 1 deletion examples/materials/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/phasecontrast/phcdetector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/quadrics/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/star1/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/star2/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
2 changes: 1 addition & 1 deletion examples/wheel/detector.dat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PhotonNum 1 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable Poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 0 ; Use header in output file (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 0 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Expand Down
6 changes: 2 additions & 4 deletions src/composition/composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ int composition::ReduceMap(vector<string> used_phases) {

delete []Ph;
Ph = Ph_new;
PhaseMap.clear();
PhaseMap = PhaseMap_new;

for (it = PhaseMap_new.begin(); it != PhaseMap_new.end() ; it++) {
PhaseMap.insert(phase_map_pair(it->first, it->second));
}
return 0;
}
6 changes: 5 additions & 1 deletion src/geom3d/geom3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
using namespace std;
using namespace xrmc_algo;

bool geom3d::MapReduced = false;
// destructor
geom3d::~geom3d() {
for (int i=0; i<NQVol; i++) {
Expand Down Expand Up @@ -61,6 +60,9 @@ geom3d::geom3d(string dev_name) {
QVolMap = NULL;
QVol = NULL;
NQVol = 0;

MapReduced = false;

SetDevice(dev_name, "geom3d");
}

Expand Down Expand Up @@ -213,6 +215,8 @@ geom3d *geom3d::Clone(string dev_name) {
for (int j = 0 ; j < QVol[i].NQuadr ; j++)
clone->QVolMap[i][j] = QVolMap[i][j];
}
clone->used_phases = used_phases;
clone->MapReduced = MapReduced;
clone->RunInit();

return clone;
Expand Down
2 changes: 1 addition & 1 deletion src/geom3d/xrmc_geom3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class geom3d : public xrmc_device
composition *Comp; // input composition device
std::string CompName;
vector<string> used_phases;
static bool MapReduced;
bool MapReduced;

int NQVol; // number of 3d objects used in the geometric description
int MaxNQVol; // maximum number of 3d objects in the geometric description
Expand Down