Commit 2e7a2f32 authored by Theo Steininger's avatar Theo Steininger
Browse files

Add docker files to repository.

parent c48d8f23
FROM python:2.7-wheezy
RUN mkdir /home/Downloads
WORKDIR /home/Downloads
# CFITSIO
RUN wget http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio_latest.tar.gz && tar xzf cfitsio_latest.tar.gz
WORKDIR cfitsio
RUN ./configure --prefix=/usr/local/ && make && make install
WORKDIR ..
#FFTW
RUN wget http://www.fftw.org/fftw-3.3.5.tar.gz && tar xzf fftw-3.3.5.tar.gz
WORKDIR fftw-3.3.5
RUN ./configure --enable-threads --enable-shared --prefix=/usr/local/ && make && make install
WORKDIR ..
#GSL
RUN wget http://ftp.halifax.rwth-aachen.de/gnu/gsl/gsl-2.3.tar.gz && tar xzf gsl-2.3.tar.gz
WORKDIR gsl-2.3
RUN ./configure --enable-shared --prefix=/usr/local/ && make && make install
WORKDIR ..
ENV LD_LIBRARY_PATH=/usr/local/lib
#HEALPIX
RUN wget http://downloads.sourceforge.net/project/healpix/Healpix_3.31/Healpix_3.31_2016Aug26.tar.gz && tar xzf Healpix_3.31_2016Aug26.tar.gz
WORKDIR Healpix_3.31
COPY healpy_config healpy_config
RUN ./configure < healpy_config && make
WORKDIR ..
#RUN [ -r /root/.healpix/3_31_Linux/config ] && . /root/.healpix/3_31_Linux/config
ENV HEALPIX_TARGET optimized_gcc
ENV HEALPIX /home/Downloads/Healpix_3.31
#Hammurabi
RUN wget http://downloads.sourceforge.net/project/hammurabicode/hammurabi_v3.01.tar.gz && tar xzf hammurabi_v3.01.tar.gz
WORKDIR hammurabicode-code
COPY hammurabi_Makefile Makefile
RUN [ -r /root/.healpix/3_31_Linux/config ] && . /root/.healpix/3_31_Linux/config && make hammurabi && make clean
WORKDIR ..
#(Py)MultiNest
RUN apt-get update && apt-get install -y libblas3 libblas-dev \
liblapack3 liblapack-dev \
libatlas3-base libatlas-dev \
cmake \
build-essential \
git \
gfortran
#RUN apt-get install -y libopenmpi-dev openmpi-bin openmpi-doc
RUN pip install numpy scipy matplotlib progressbar ipython
RUN git clone https://github.com/JohannesBuchner/MultiNest.git
WORKDIR MultiNest/build
RUN cmake .. && make && make install
WORKDIR ../..
RUN git clone https://github.com/JohannesBuchner/PyMultiNest.git
WORKDIR PyMultiNest
RUN python setup.py install --user
WORKDIR ..
RUN apt-get install -y libopenmpi-dev openmpi-bin openmpi-doc
RUN pip install mpi4py
RUN pip install cython healpy
RUN git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git -b master
WORKDIR NIFTy
RUN python setup.py install --user
WORKDIR ..
#--------------------------------------------------------
#--------------------------------------------------------
#
# This is the hammurabi Makefile. The first part needs to be configured for your system.
#
# You can choose to build:
#
# hammurabi: by default, the basic hammurabi, pure C++, for constant or grid TEs and simple analytic models for CREs
# hammurabi.ne2001: including linking to the (smooth) NE2001 Fortran code using cfortran.h
# hammurabi.galprop: including both NE2001 and Galprop to simulate the CRE propagation with the hammurabi magnetic field first.
# hammurabi.debug: including all code, debug flags.
# all: builds all of these.
#
#--------------------------------------------------------
#--------------------------------------------------------
#
# Give the locations of the various libraries. Should containt include and lib subdirectories.
#
#BASE_DIR = $(HOME)/space/sw/
#HAMMURABI_HOME = $(BASE_DIR)/hammurabi/branches/mine
#GSL = $(BASE_DIR)/gsl/gsl-1.13/build/
#FFTW = $(BASE_DIR)/fftw/fftw-3.2.2/build/
#CFITSIO = $(BASE_DIR)/cfitsio/cfitsio/build/
BASE_DIR = /home/Downloads/hammurabicode-code
HAMMURABI_HOME = $(BASE_DIR)
GSL = /usr/local
FFTW = /usr/local
CFITSIO = /usr/local
#
# These are needed if you build with Galprop
#
GALPROP = $(BASE_DIR)/galprop/galprop/build
CCFITS = $(BASE_DIR)/ccfits/CCfits//build/
CLHEP = $(BASE_DIR)/clhep/2.0.4.5/CLHEP/build/
#
# What c++ compiler you are using?
#
CXX = g++
#
# On OSX, maybe
#CXX = g++-mp-4.3
#
# Compile options? 64bit system (-m64), optimization (-O2), openMP (-fopenmp), warnings (-Wall), etc.
#
CXXFLAGS = -m64 -O2 -fopenmp -Wall
#
# With OSX g++-mp-4.3
#CXXFLAGS = -fopenmp -O2 -fno-inline-functions -Wall -Wextra -Wno-unknown-pragmas
#
# Which Fortran compiler you are using? Only if compiling with NE2001 and/or Galprop
#
FC = gfortran
#
# On OSX, maybe
#FC = gfortran-mp-4.3
# For gfortran
FCFLAGS = -O2 -ffixed-form -ffixed-line-length-132 -c
#
# For ifort
#FCFLAGS =-O -extend-source -c
#
# For f77 ?
#FCFLAGS =
#
# For linking to C++ with gcc
#
LFORTFLAGS= -Df2cFortran
#
# Additional options depending on how you want to run:
#
# Use openMP ? (Even for hammurabi.debug, at link stage, need this if HEALPix compiled with it.)
LFLAGS_CUSTOM = -fopenmp
#
# OSX with gfortran-mp-4.3
#LFLAGS_CUSTOM = -fopenmp -lgcc_s.1
#
#
#
# For J. West using f77 and gcc 4.1.2?
#
#LFORTFLAGS += -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/ -lgcc -lg2c
#LFLAGS_CUSTOM += -lgcc_s
#------------------------------------------------------------
#------------------------------------------------------------
#
# From here onwards, nothing should need to be changed.
#
#------------------------------------------------------------
#------------------------------------------------------------
hammurabi.debug: CXXFLAGS=-m64 -g -Wall
hammurabi: ALL_INC = -I$(CFITSIO)/include -I$(GSL)/include -I. -I$(FFTW)/include -I$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/include/
hammurabi.ne2001: ALL_INC = -I$(CFITSIO)/include -I$(GSL)/include -I. -I$(FFTW)/include -I$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/include/
hammurabi.galprop: ALL_INC = -I$(CFITSIO)/include -I$(GALPROP)/.. -I$(GALPROP)/include/ -I$(CCFITS)/include/ -I$(CLHEP)/include -I$(GSL)/include -I. -I$(FFTW)/include -I$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/include/
hammurabi.debug: ALL_INC = -I$(CFITSIO)/include -I$(GALPROP)/.. -I$(GALPROP)/include/ -I$(CCFITS)/include/ -I$(CLHEP)/include -I$(GSL)/include -I. -I$(FFTW)/include -I$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/include/
libhamprop.a: ALL_INC = -I$(CFITSIO)/include -I$(GALPROP)/.. -I$(GALPROP)/include/ -I$(GSL)/include -I. -I$(FFTW)/include -I$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/include/
hammurabi: ALL_L = -L$(CFITSIO)/lib -L$(GSL)/lib -L$(FFTW)/lib -L$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/lib/ -L.
hammurabi.ne2001: ALL_L = -L$(CFITSIO)/lib -L$(GSL)/lib -L$(FFTW)/lib -L$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/lib/ -L.
hammurabi.galprop: ALL_L = -L$(CFITSIO)/lib -L$(GALPROP)/lib/ -L$(CCFITS)/lib/ -L$(CLHEP)/lib -L$(GSL)/lib -L$(FFTW)/lib -L$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/lib/ -L.
hammurabi.debug: ALL_L = -L$(CFITSIO)/lib -L$(GALPROP)/lib/ -L$(CCFITS)/lib/ -L$(CLHEP)/lib -L$(GSL)/lib -L$(FFTW)/lib -L$(HEALPIX)/src/cxx/$(HEALPIX_TARGET)/lib/ -L.
hammurabi : CXXFLAGS+= $(ALL_INC) -c
hammurabi.ne2001: CXXFLAGS+= $(ALL_INC) -c -DNE2001
hammurabi.galprop: CXXFLAGS+= $(ALL_INC) -c -DGALDEF_PATH=\"./GALDEF\" -DFITSDATA_PATH=\"./FITS/\" -DDATA_PATH=\"./DATA\" -DGALPROP -DNE2001
hammurabi.debug : CXXFLAGS+= $(ALL_INC) -c -DGALDEF_PATH=\"./GALDEF\" -DFITSDATA_PATH=\"./FITS/\" -DDATA_PATH=\"./DATA\" -DGALPROP -DNE2001 -g -Wall
# Turns off sanity check to avoid some circularity. See Galprop README.tess
libhamprop.a: CXXFLAGS+= $(ALL_INC) -c -DGALDEF_PATH=\"./GALDEF\" -DFITSDATA_PATH=\"./FITS/\" -DDATA_PATH=\"./DATA\" -DLIBHAMPROP -DGALPROP -DNE2001
hammurabi: LFLAGS = $(ALL_L) -lhammurabi -lhealpix_cxx -lcxxsupport -lc_utils -lfftpack -lcfitsio -lgsl -lgslcblas -lm -lfftw3 $(LFLAGS_CUSTOM)
hammurabi.ne2001: LFLAGS = $(ALL_L) -lhammurabi -lNE2001 -lhealpix_cxx -lcxxsupport -lc_utils -lfftpack -lcfitsio -lgsl -lgslcblas -lm -lfftw3 -lgfortran $(LFLAGS_CUSTOM)
hammurabi.debug: LFLAGS = $(ALL_L) -lhammurabi -lNE2001 -lhealpix_cxx -lcxxsupport -lc_utils -lfftpack -lcfitsio -lgsl -lgslcblas -lm -lfftw3 -lgfortran -lgalprop -lskymap -lCCfits -lCLHEP $(LFLAGS_CUSTOM)
hammurabi.galprop: LFLAGS = $(ALL_L) -lhammurabi -lNE2001 -lhealpix_cxx -lcxxsupport -lc_utils -lfftpack -lcfitsio -lgsl -lgslcblas -lm -lfftw3 -lgfortran -lgalprop -lskymap -lCCfits -lCLHEP $(LFLAGS_CUSTOM)
default:
make hammurabi
all:
make clean ; make hammurabi ; make clean ; make hammurabi.ne2001; make clean; make hammurabi.galprop ; make clean ; make hammurabi.debug
%.o : %.cpp
$(CXX) $(CXXFLAGS) -o $@ $<
%.o : %.cc
$(CXX) $(CXXFLAGS) -o $@ $<
%.o : %.c
$(CXX) $(CXXFLAGS) -o $@ $<
%.o : %.f
$(FC) $(FCFLAGS) -o $@ $<
class_TE_density.o: class_TE_density.cpp
$(CXX) $(CXXFLAGS) $(LFORTFLAGS) -o $@ $<
NE2001_OBJ = dmdsm.NE2001.o density.NE2001.o neclumpN.o nevoidN.o neLISM.NE2001.o
HAMMURABI_OBJ = class_Integrator.o class_List.o class_B_field2.o tess_tools.o class_TE_density.o class_CRE.o namespace_Vec_Handling.o class_Dust.o
run:
mkdir run
$(HAMMURABI_OBJ): hammurabi.h CGS_units_file.h proto*.h tess_tools.h
libNE2001.a: $(NE2001_OBJ)
ar rc $@ $(NE2001_OBJ)
ranlib $@
hammurabi: $(HAMMURABI_OBJ) libhammurabi.a run hammurabi.o
$(CXX) -o run/hammurabi hammurabi.o $(LFLAGS) $(LFORTFLAGS)
hammurabi.ne2001: $(HAMMURABI_OBJ) $(NE2001_OBJ) $(NE2001_DATA) libNE2001.a libhammurabi.a run hammurabi.o
$(CXX) -o run/hammurabi.ne2001 hammurabi.o $(LFLAGS) $(LFORTFLAGS)
hammurabi.galprop: $(HAMMURABI_OBJ) $(NE2001_OBJ) $(NE2001_DATA) libNE2001.a libhammurabi.a run hammurabi.o
$(CXX) -o run/hammurabi.galprop hammurabi.o $(LFLAGS) $(LFORTFLAGS)
hammurabi.debug: $(HAMMURABI_OBJ) $(NE2001_DATA) libNE2001.a libhammurabi.a run hammurabi.o
$(CXX) -o run/hammurabi.debug hammurabi.o $(LFLAGS) $(LFORTFLAGS)
print_constants: print_constants.o
$(CXX) -o run/print_constants print_constants.o
# To link in B_field to galprop, use this:
libhamprop.a: class_B_field2.o tess_tools.o namespace_Vec_Handling.o
ar cru libhamprop.a class_B_field2.o tess_tools.o namespace_Vec_Handling.o
libhammurabi.a: $(HAMMURABI_OBJ)
ar cru libhammurabi.a $(HAMMURABI_OBJ)
clean:
rm *a *.o
test:
(cd unit_test; ./test.csh)
test_big:
(cd unit_test; ./test.csh big)
tarfile:
tar cvzf hammurabi.tgz *cpp *h Makefile *.f README
4
/usr/local/bin
/usr/local/include
4
y
0
sudo docker build -t iftmpa/imagine:dev .
sudo docker login -u XXX -p XXX
sudo docker push iftmpa/imagine:dev
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment