Skip to content

Commit

Permalink
update SDF
Browse files Browse the repository at this point in the history
  • Loading branch information
JunCEEE committed Sep 24, 2020
1 parent f1fe3fa commit 54c17f1
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FIND_PACKAGE(Python
set (LIBDIR lib)
set (INCLUDEDIR include)
set (BINDIR bin)
set (PYPATH ${LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR})
set (PYPATH ${LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
message( "PYPATH=${PYPATH}" )

set (DOCDIR share/doc)
Expand Down
5 changes: 4 additions & 1 deletion Modules/Diffractors/CrystFELPhotonDiffractor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ MESSAGE("HDF5_VERSION= ${HDF5_VERSION}")
MESSAGE("HDF5_LIBRARY_DIRS= ${HDF5_LIBRARY_DIRS}")

FIND_PACKAGE (GSL REQUIRED)

find_package(ZLIB)
include_directories(${ZLIB_INCLUDE_DIRS})
# TARGET_LINK_LIBRARIES( ${ZLIB_LIBRARIES})
# This macro invokes the HDF5 compiler wrapper, it parses the output and
# extracts the path where library are stored.
# Usage:
Expand Down Expand Up @@ -103,6 +105,7 @@ ExternalProject_Add( crystfel
)

# Install needed crystfel binaries, scripts and doc material.
ExternalProject_Get_Property(crystfel BINARY_DIR)
ExternalProject_Get_Property(crystfel SOURCE_DIR)
ExternalProject_Get_Property(crystfel BINARY_DIR)
#
Expand Down
5 changes: 3 additions & 2 deletions Modules/Others/sdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ INCLUDE(ExternalProject)

ExternalProject_Add(
sdf
GIT_REPOSITORY https://github.com/PaNOSC-ViNYL/SDF.git
GIT_REPOSITORY https://cfsa-pmw.warwick.ac.uk/SDF/SDF.git
GIT_TAG 642be14ccae3bc7db53995f3fa8ea831bbbd3c6a
GIT_SUBMODULES C utilities
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PYPATH}
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ SimEx

Software platform for **Sim**ulation of advanced photon **Ex**periments.

[![Build Status](https://travis-ci.org/PaNOSC-ViNYL/SimEx.svg?branch=master)](https://travis-ci.org/PaNOSC-ViNYL/SimEx)
[![Build Status](https://travis-ci.org/PaNOSC-ViNYL/SimEx.svg?branch=develop)](https://travis-ci.org/PaNOSC-ViNYL/SimEx)
[![Build Status master](https://travis-ci.org/PaNOSC-ViNYL/SimEx.svg?branch=master)](https://travis-ci.org/github/panosc-vinyl/simex/branches)
[![Build Status develop](https://travis-ci.org/PaNOSC-ViNYL/SimEx.svg?branch=develop)](https://travis-ci.org/github/panosc-vinyl/simex/branches)


## Purpose of SimEx
Expand Down
8 changes: 5 additions & 3 deletions Sources/python/SimEx/Analysis/DiffractionAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,13 @@ def photonStatistics(stack):


print("*************************")
print ("Photon number statistics per pattern"
print("avg = %6.5e" % (avg_photons))
print("std = %6.5e" % (rms_photons))
print("avg_mean = %6.5e" % (avg_mean))
print("avg_max = %6.5e" % (avg_max))
print("avg_min = %6.5e" % (avg_min))
print ("Photon number statistics per pixel"
print("avg_mean_pixel = %6.5e" % (avg_mean))
print("avg_max_pixel = %6.5e" % (avg_max))
print("avg_min_pixel = %6.5e" % (avg_min))
print("*************************")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def testConstructor(self):
self.assertIsInstance(interact, AbstractIonInteractor)

def testRun(self):
input_file = TestUtilities.generateTestFilePath('00101.sdf')
input_file = TestUtilities.generateTestFilePath('0010.sdf')
mysource = TNSAIonMatterInteractor(parameters=self.params,
input_path=input_file,
output_path='Data/NeutronData.h5')
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

name: simex
channels:
- defaults
- conda-forge
- ondateam
dependencies:
- Cython
- cmake>=3.12.1
Expand All @@ -46,6 +46,7 @@ dependencies:
- openpmd-api
- python>=3.5
- nomkl
- cfelpyutils
- pip
- pip:
- xraydb
38 changes: 31 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ usage: $0 MODE
MODE includes:
conda-env: create conda simex virtual environment
conda: install SimEx in current conda environment
conda-develop: install SimEx in current conda environment with DEVELOPER_MODE=ON
maxwell
develop
EOF
Expand Down Expand Up @@ -55,13 +56,31 @@ then
PYLIB=${PYVERSION%.*}
DEVELOPER_MODE=ON
XCSIT=OFF
export ZLIB_ROOT=$CONDA_PREFIX
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
#export PYTHONPATH=$CONDA_PREFIX/lib/$PYLIB:$CONDA_PREFIX/lib/$PYLIB/site-packages:$PYTHONPATH
#echo "PYTHONPATH="$PYTHONPATH
# THIRD_PARTY_ROOT=/gpfs/exfel/data/group/spb-sfx/spb_simulation/simex
# export PYTHONPATH=$CONDA_PREFIX/lib/$PYLIB:$CONDA_PREFIX/lib/$PYLIB/site-packages:$PYTHONPATH
# echo "PYTHONPATH="$PYTHONPATH
fi

elif [ $MODE = "conda-develop" ]
then
echo $MODE
CONDA_BIN=`which conda`
CONDA_BIN=${CONDA_BIN%/*}
source ${CONDA_BIN%/*}/etc/profile.d/conda.sh
INSTALL_PREFIX=$CONDA_PREFIX
PYVERSION=`python -V | tr '[:upper:]' '[:lower:]' | tr -d ' '`
PYLIB=${PYVERSION%.*}
DEVELOPER_MODE=ON
XCSIT=OFF
export ZLIB_ROOT=$CONDA_PREFIX
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
# THIRD_PARTY_ROOT=/gpfs/exfel/data/group/spb-sfx/spb_simulation/simex
# export PYTHONPATH=$CONDA_PREFIX/lib/$PYLIB:$CONDA_PREFIX/lib/$PYLIB/site-packages:$PYTHONPATH
# echo "PYTHONPATH="$PYTHONPATH
fi

XCSIT=ON
THIRD_PARTY_ROOT=/gpfs/exfel/data/group/spb-sfx/spb_simulation/simex

# Check for existing build directory, remove if found
if [ -d build ]
Expand Down Expand Up @@ -109,15 +128,20 @@ cmake -DSRW_OPTIMIZED=ON \
-DBOOST_ROOT=$BOOST_ROOT \
..
# Build the project.
make -j32
make -j32

# Install the project.
make install

# Back to root dir.
cd ..

# Revert
git checkout -- CMakeLists.txt
# make and make install should be exec'ed not in this script (crystfel fails to compile).
if [ $MODE = "conda" ] || [ $MODE = "conda-env " ]
then
echo "In case of error in compiling crystfel, rerun make in the build dir."
fi

if [ $MODE = "develop" ]; then
echo "Please run 'source build/simex_vars.sh' before developing"
fi
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ openpmd-api
periodictable>=1.4.1
pint
py3nvml
cfelpyutils
pyFAI<=0.16
pyfftw
scipy==1.3.1
Expand Down

0 comments on commit 54c17f1

Please sign in to comment.