diff --git a/.conda/conda.recipe/build.sh b/.conda/conda.recipe/build.sh new file mode 100644 index 00000000..f8000514 --- /dev/null +++ b/.conda/conda.recipe/build.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -ex + +# Create the lib directory to store the Fortran library in +LIB_DIR="${PREFIX}/lib" +mkdir -p $LIB_DIR + +# Create the bin directory to store the Fortran binaries in +echo "FKDEV: echo BIN_DIR" +echo $BIN_DIR +BIN_DIR="${PREFIX}/bin" +mkdir -p $BIN_DIR +echo "FKDEV: echo BIN_DIR after creation" +echo $BIN_DIR + +cd $SRC_DIR + +# get important settings +echo "FKDEV: cp settings" +cp .conda/important_settings . + +# echo "FKDEV: ls PREFIX lib" +# ls $PREFIX/lib +# echo "FKDEV: ls PREFIX include" +# ls $PREFIX/include +# echo "FKDEV: ls BUILD_PREFIX/bin" +# ls $BUILD_PREFIX/bin + + +# let's build this thing +echo "FKDEV: build" +# bash build_things.sh --nthreads_make 2 +bash build_things.sh + +# Install binaries explicitly + +for file in bin/* +do + echo $file + cp $file $BIN_DIR +done + +# Optional: print installed binaries to verify +echo "Installed binaries:" +ls -l $BIN_DIR diff --git a/.conda/conda.recipe/meta.yaml b/.conda/conda.recipe/meta.yaml new file mode 100644 index 00000000..d7dc4c66 --- /dev/null +++ b/.conda/conda.recipe/meta.yaml @@ -0,0 +1,46 @@ +{% set version = "24.09" %} + +package: + name: tdep + version: {{ version }} + +source: + git_url: https://github.com/tdep-developers/tdep.git + git_rev: fk_conda_build + # git_depth: 1 + +build: + number: 0 + +requirements: + build: + - {{ compiler('fortran') }} + # - gfortran + - openmpi + - openmpi-mpifort + - scalapack + - fftw + - hdf5 + - openblas + host: + - openmpi + - openmpi-mpifort + - scalapack + - hdf5 + - fftw + - openblas + run: + - scalapack + - openmpi-mpifort + - hdf5 + - fftw + - openblas + +about: + home: https://github.com/tdep-developers/tdep + license: MIT + summary: 'TDEP' + description: "Proper phonons made in Sweden." + dev_url: https://github.com/tdep-developers/tdep + doc_url: https://tdep-developers.github.io/tdep/ + doc_source_url: https://github.com/tdep-developers/tdep/blob/main/README.md diff --git a/.conda/important_settings b/.conda/important_settings new file mode 100644 index 00000000..16737ba4 --- /dev/null +++ b/.conda/important_settings @@ -0,0 +1,50 @@ +#!/bin/bash +# A central place to put all the important paths. You probably have to modify this to make things work. + +# the fortran compiler +FORTRAN_COMPILER="$FC" +# required compiler flags +FCFLAGS="-ffree-line-length-none -std=gnu -cpp -fallow-argument-mismatch" +# extra flags, for debugging and such +FCFLAGS_EXTRA="" + +# optimization stuff. Go all in, sometimes +OPTIMIZATION_LEVEL="-O3" +OPTIMIZATION_SENSITIVE="-O0" + +# the flag that sets the default real to a double. +DOUBLE_FLAG= # "-fdefault-real-8" +# The flag that tells the compiler where to put .o and .mod files. +MODULE_FLAG="-J" + +# the header to put in python scripts. +PYTHONHEADER="#!/usr/bin/env python" + +# Which gnuplot terminal to use by default. +# Choices: aqua, qt, wxt +GNUPLOTTERMINAL="qt" + +# Precompiler flags. Selecting default gnuplot terminal, and make the progressbars work. +PRECOMPILER_FLAGS="-DGP${GNUPLOTTERMINAL} -Dclusterprogressbar" + +# These are the BLAS/LAPACK libraries. On OSX with gfortran, use the built-in 'framework accelerate' +PATH_TO_BLASLAPACK_LIB="-L/$PREFIX/lib" +PATH_TO_BLASLAPACK_INC="-I/$PREFIX/include" +BLASLAPACK_LIBS="-llapack -lscalapack" + +# I use fftw for Fourier transforms. +PATH_TO_FFTW_LIB="-L/$PREFIX/lib" +PATH_TO_FFTW_INC="-I/$PREFIX/include" +FFTW_LIBS="-lfftw3" + +# Also need MPI +PATH_TO_MPI_LIB="-L/$PREFIX/lib" +PATH_TO_MPI_INC="-I/$PREFIX/include" +MPI_LIBS="-lmpi_mpifh -lmpi" + +# I also use HDF5 every now and then +PATH_TO_HDF5_LIB="-L/$PREFIX/lib" +PATH_TO_HDF5_INC="-I/$PREFIX/include" +HDF5_LIBS="-lhdf5 -lhdf5_fortran" + +USECGAL=no diff --git a/build_things.sh b/build_things.sh index 5679420b..a98e18fc 100755 --- a/build_things.sh +++ b/build_things.sh @@ -242,7 +242,9 @@ do fi cd ../../ # link it to bin? - [ -f build/${code}/${code} ] && ln -sf ../build/${code}/${code} bin/${code} + # [ -f build/${code}/${code} ] && ln -sf ../build/${code}/${code} bin/${code} + # move it instead + [ -f build/${code}/${code} ] && mv build/${code}/${code} bin/${code} done basedir=`pwd`