Skip to content
Open
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
2 changes: 1 addition & 1 deletion binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export PREFIX=$CONDA_DEFAULT_ENV
git clone https://github.com/jsalvado/SQuIDS.git $HOME/SQuIDS;
cd $HOME/SQuIDS; ./configure --prefix=$HOME/software --with-gsl-incdir=$PREFIX/include --with-gsl-libdir=$PREFIX/lib; export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH; make; make test; make install; cd -;
export LD_LIBRARY_PATH="$HOME/software/lib"
./configure --prefix=$HOME/software --with-python-bindings --with-boost=$PREFIX/ --with-gsl=$PREFIX --with-squids=$HOME/software --python-bin=python; make python; make test; make install;
./configure --prefix=$HOME/software --with-python-bindings --with-boost=$PREFIX/ --with-gsl=$PREFIX --with-squids=$HOME/software --python-bin=python; make; make test; make install; cd resources/python/src; make;
2 changes: 1 addition & 1 deletion binder/start
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export PKG_CONFIG_PATH="$HOME/software/lib/pkgconfig:$PKG_CONFIG_PATH";
export PYTHONPATH=$HOME/lib:$HOME/resources/python/bindings:$PYTHONPATH
export PYTHONPATH=$HOME/resources/python/bindings/:$PYTHONPATH
export LD_LIBRARY_PATH="$HOME/software/lib":"/srv/conda/envs/notebook"
echo $PYTHONPATH
exec "$@"
82 changes: 13 additions & 69 deletions configure
Original file line number Diff line number Diff line change
@@ -1,69 +1,14 @@
#!/bin/bash

check_os_arch(){
if [ -x /usr/bin/lsb_release ]; then
OS_DISTRIB=$(lsb_release -si|tr '[:upper:]' '[:lower:]')
OS_VERSION=`lsb_release -sr`
elif [ -e /etc/os-release ]; then
OS_DISTRIB=$(cat /etc/os-release|grep '^ID='|cut -d '=' -f 2|sed s/\"//g|tr '[:upper:]' '[:lower:]')
OS_VERSION=$(cat /etc/os-release|grep '^VERSION='|cut -d '=' -f 2|cut -d ' ' -f 1|sed s/\"//g)
elif [ -e /etc/redhat-release ]; then
OS_DISTRIB="centos"
OS_VERSION=$(cat /etc/redhat-release|sed s/\ /\\\\n/g|grep '\.')
else
OS_DISTRIB=$(uname -s|tr '[:upper:]' '[:lower:]')
OS_VERSION=$(uname -r)
fi
ARCH=$(uname -m)
OS_NAME=$(uname -s)

case $OS_DISTRIB in
"redhatenterpriseclient" | "redhatenterpriseserver" | "rhel" | "scientificsl" | "scientific" | "centos" | "scientificfermi" | "scientificcernslc")
OS_DISTRIB="RHEL"
OS_VERSION=$(echo "${VERSION}" | cut -d '.' -f 1)
;;
"ubuntu")
OS_DISTRIB="Ubuntu"
;;
"debian")
OS_DISTRIB="Ubuntu"
;;
"linuxmint")
OS_DISTRIB="Ubuntu"
;;
"freebsd")
OS_DISTRIB="FreeBSD"
OS_VERSION=$(uname -r | cut -d '.' -f 1)
ARCH=$(uname -p)
;;
"darwin")
OS_DISTRIB="OSX"
OS_VERSION=$(uname -r | cut -d '.' -f 1)
;;
"linux")
if echo $OS_VERSION | grep -q '\.el7\.\?'; then
OS_DISTRIB="RHEL"
OS_VERSION=7
elif echo $OS_VERSION | grep -q '\.el6\.\?'; then
OS_DISTRIB="RHEL"
OS_VERSION=6
elif echo $OS_VERSION | grep -q '\.el5\.\?'; then
OS_DISTRIB="RHEL"
OS_VERSION=5
fi
esac
OS_ARCH=${OS_DISTRIB}_${OS_VERSION}_${ARCH}
}

check_pkgconfig(){
if [ "$CHECKED_PKGCONFIG" ]; then return; fi
echo "Looking for pkg-config..."
PKG_CONFIG_BIN=$(which pkg-config 2>&1)
PKG_CONFIG_PATH=$(which pkg-config 2>&1)
if [ "$?" -ne 0 ]; then
echo "Error: pkg-config not found; you will need to specify library locations manually" 1>&2
exit 1
fi
echo " Found $PKG_CONFIG_BIN"
echo " Found $PKG_CONFIG_PATH"
CHECKED_PKGCONFIG=1
}

Expand Down Expand Up @@ -213,7 +158,7 @@ try_find_python(){
TMP=`echo "$PYTHON_STDLIBDIR" | sed -n s'|\(.*/lib\)/python'"${PYTHON_VERSION}"'|\1|p'`
if [ "$TMP" ]; then POSSIBLE_PYTHON_LIBDIRS="${POSSIBLE_PYTHON_LIBDIRS} ${TMP}"; fi
# Ubuntu is special, of course
if [ $OS_DISTRIB = "Ubuntu" ]; then
if uname -a | grep -i 'ubuntu' > /dev/null; then
POSSIBLE_PYTHON_LIBDIRS="${POSSIBLE_PYTHON_LIBDIRS} /usr/lib/$(uname -i)-linux-gnu"
fi

Expand Down Expand Up @@ -272,7 +217,7 @@ try_find_boost(){
return
fi
if [ "$PYTHON_FOUND" ]; then
for PYV_SUFFIX in $PYV $PYVM $PYV-mt $PVM-mt ''; do
for PYV_SUFFIX in $PYV $PYVM ''; do
for BOOST_LIBDIR in $POSSIBLE_BOOST_LIBDIRS; do
if [ -d $BOOST_LIBDIR -a \( -e $BOOST_LIBDIR/libboost_python${PYV_SUFFIX}.a -o -e $BOOST_LIBDIR/libboost_python${PYV_SUFFIX}.so -o -e $BOOST_LIBDIR/libboost_python${PYV_SUFFIX}.dylib \) ]; then
if [ ! "$PYV_SUFFIX" ]; then
Expand Down Expand Up @@ -354,7 +299,7 @@ VERSION=`echo $VERSION_NUM | awk '{
print major"."minor"."patch;
}'`

check_os_arch
OS_NAME=`uname -s`

GUESS_CC=gcc
GUESS_CXX=g++
Expand Down Expand Up @@ -735,8 +680,7 @@ echo "SQUIDS_LDFLAGS=$SQUIDS_LDFLAGS" >> ./Makefile
if [ "$PYTHON_BINDINGS" ]; then
echo "PYTHON_CFLAGS=$PYTHON_CFLAGS" >> ./Makefile
echo "PYTHON_LDFLAGS=$PYTHON_LDFLAGS" >> ./Makefile
echo "BOOST_CFLAGS=$BOOST_CFLAGS" >> ./Makefile
echo "BOOST_PYTHON_LDFLAGS=$BOOST_LDFLAGS $BOOST_PYTHON_LDFLAGS" >> ./Makefile
echo "BOOST_PYTHON_LDFLAGS=$BOOST_PYTHON_LDFLAGS" >> ./Makefile
echo "PYTHON_MODULEDIR=$PYTHON_MODULEDIR" >> ./Makefile
echo "NUMPY_CFLAGS=$NUMPY_CFLAGS" >> ./Makefile
fi
Expand Down Expand Up @@ -854,8 +798,8 @@ install: $(DYN_PRODUCT) $(STAT_PRODUCT)
@cp "$(INCnuSQUIDS)"/nuSQuIDS/*.h "$(PREFIX)/include/nuSQuIDS"
@echo Installing libraries in $(PREFIX)/$(INSTALL_LIBDIR)
@mkdir -p "$(PREFIX)/$(INSTALL_LIBDIR)"
@LC_ALL=C sed "'${REPLACE_INSTALL_FLAG}'" < $(DYN_PRODUCT) > "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME)$(DYN_SUFFIX)"
@LC_ALL=C sed "'${REPLACE_INSTALL_FLAG}'" < $(STAT_PRODUCT) > "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME).a"
@LANG=C sed "'${REPLACE_INSTALL_FLAG}'" < $(DYN_PRODUCT) > "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME)$(DYN_SUFFIX)"
@LANG=C sed "'${REPLACE_INSTALL_FLAG}'" < $(STAT_PRODUCT) > "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME).a"
@chmod 755 "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME)$(DYN_SUFFIX)" "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME).a"
@echo Installing config information in $(PREFIX)/$(INSTALL_LIBDIR)/pkgconfig
@mkdir -p "$(PREFIX)/$(INSTALL_LIBDIR)/pkgconfig"
Expand All @@ -875,8 +819,8 @@ uninstall:
@echo Removing headers from $(PREFIX)/include/nuSQuIDS
@rm -rf "$(PREFIX)/include/nuSQuIDS"
@echo Removing libraries from $(PREFIX)/$(INSTALL_LIBDIR)
@rm -f "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME)$(DYN_SUFFIX)"
@rm -f "$(PREFIX)/$(INSTALL_LIBDIR)/lib$(NAME).a"
@rm -f "$(PREFIX)/$(INSTALL_LIBDIR)/$(DYN_PRODUCT)"
@rm -f "$(PREFIX)/$(INSTALL_LIBDIR)/$(STAT_PRODUCT)"
@echo Removing config information from $(PREFIX)/$(INSTALL_LIBDIR)/pkgconfig
@rm -f "$(PREFIX)/$(INSTALL_LIBDIR)/pkgconfig/nusquids.pc"
' >> ./Makefile
Expand All @@ -892,7 +836,7 @@ $(PYTHON_LIB) : build/nuSQUIDSpy.o $(STAT_PRODUCT)

build/nuSQUIDSpy.o : resources/python/src/nuSQUIDSpy.cpp
@echo Compiling python bindings
@$(CXX) $(CXXFLAGS) -c -Iresources/python/inc $(PYTHON_CFLAGS) $(BOOST_CFLAGS) $(NUMPY_CFLAGS) $(CFLAGS) $< -o $@
@$(CXX) $(CXXFLAGS) -c -Iresources/python/inc $(PYTHON_CFLAGS) $(NUMPY_CFLAGS) $(CFLAGS) $< -o $@

python-install : $(PYTHON_LIB)
@echo Installing python module in $(PYTHON_MODULEDIR)
Expand All @@ -908,9 +852,9 @@ fi

echo "
export CXX=\"${CXX}\"
export CFLAGS=\"${CFLAGS} -I${SOURCE_PATH}/inlude ${SQUIDS_CFLAGS} ${GSL_CFLAGS} ${HDF5_CFLAGS}\"
export CFLAGS=\"${CFLAGS} ${SQUIDS_CFLAGS} ${GSL_CFLAGS} ${HDF5_CFLAGS}\"
export CXXFLAGS=\"${CXXFLAGS} -std=c++11\"
export LDFLAGS=\"${LDFLAGS} -L${SOURCE_PATH}/lib -Wl,-rpath -Wl,${SOURCE_PATH}/lib -lnuSQuIDS -lpthread ${SQUIDS_LDFLAGS} ${GSL_LDFLAGS} ${HDF5_LDFLAGS}\"
export LDFLAGS=\"${LDFLAGS} -lnuSQuIDS -lpthread ${SQUIDS_LDFLAGS} ${GSL_LDFLAGS} ${HDF5_LDFLAGS}\"
" > test/env_vars.sh
if uname | grep -q 'Darwin' ; then
printf "export DYLD_LIBRARY_PATH=\"" >> test/env_vars.sh
Expand Down
Binary file modified data/xsections/csms_neutron.h5
Binary file not shown.
Binary file modified data/xsections/csms_proton.h5
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/Bodies/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int main()
std::cout << "******** Earth Atmospheric Neutrino Osc **********" << std::endl;

std::shared_ptr<EarthAtm> earth_atm = std::make_shared<EarthAtm>();
auto earth_atm_track = std::make_shared<EarthAtm::Track>(earth_atm->MakeTrack(phi));
std::shared_ptr<EarthAtm::Track> earth_atm_track = std::make_shared<EarthAtm::Track>(phi);

nus.Set_Body(earth_atm);
nus.Set_Track(earth_atm_track);
Expand Down Expand Up @@ -216,7 +216,7 @@ int main()
std::cout << "***** Earth Modified Atmospheric Neutrino Osc ****" << std::endl;

std::shared_ptr<EarthMod> earth_mod = std::make_shared<EarthMod>(0.1,0.1,0.1);
auto earth_mod_track = std::make_shared<EarthMod::Track>(earth_atm->MakeTrack(phi));
std::shared_ptr<EarthMod::Track> earth_mod_track = std::make_shared<EarthMod::Track>(phi);
earth_mod->Mod(0.1,0.1,0.1);

nus.Set_Body(earth_mod);
Expand Down
117 changes: 0 additions & 117 deletions examples/Extended_Source/main.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions examples/Extended_Source/nu_source.h

This file was deleted.

19 changes: 0 additions & 19 deletions examples/Extended_Source/plot.plt

This file was deleted.

2 changes: 1 addition & 1 deletion examples/HDF5_Write_Read/plot.plt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env gnuplot
#!/usr/bin/env gnuplot -persist
if ( GPVAL_VERSION >= 4.4 && strstrt(GPVAL_TERMINALS, 'wxt') > 0 ) set terminal wxt persist
if ( GPVAL_VERSION >= 4.4 && strstrt(GPVAL_TERMINALS, 'qt') > 0 ) set terminal qt persist
if ( GPVAL_VERSION >= 4.4 && strstrt(GPVAL_TERMINALS, 'wxt') == 0 && strstrt(GPVAL_TERMINALS, 'qt') == 0 ) print "wxt and qt terminals not available, proceeding with default"
Expand Down
10 changes: 6 additions & 4 deletions examples/HDF5_Write_Read/read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ int main()
squids::Const units;

//Here we create the nusquids object reading the state from the hdf5 file.
nuSQUIDS inus("./initial_state.hdf5");
nuSQUIDS fnus("./final_state.hdf5");
//nuSQUIDS inus("./initial_state.hdf5");
//nuSQUIDS fnus("./final_state.hdf5");


nuSQUIDSAtm<> inus("./pion_atmospheric_initial.hdf5");
nuSQUIDSAtm<> fnus("./pion_atmospheric_2441_1.000000_0.000000_0.160875_0.000000_0.000000_0.000000.hdf5");

//In this part we will save the values in a txt file to be able to plot or manipulate later.
//Notice that this is not going to have all the information about the quantum evolution, for that
//we need to save the information using the HDF5 writing function.
Expand All @@ -60,7 +62,7 @@ int main()
file << lE << " " << E << " ";
for(int fl=0; fl<numneu; fl++){
//the ration in the second column is with the initial muon flux, the others are zero.
file << " " << fnus.EvalFlavor(fl, E, 0) << " " << fnus.EvalFlavor(fl, E, 0)/inus.EvalFlavor(1, E, 0);
file << " " << fnus.EvalFlavor(fl, -1,E) << " " << fnus.EvalFlavor(fl,-1, E)/inus.EvalFlavor(1, -1,E);
}
file << std::endl;
}
Expand Down
Loading