From c4d38775a9d685aaf009281ac2e12d86b2a8cc58 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 17:47:31 +0100 Subject: [PATCH 01/10] conda | build? --- .conda/important_settings | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .conda/important_settings diff --git a/.conda/important_settings b/.conda/important_settings new file mode 100644 index 00000000..58dee1ed --- /dev/null +++ b/.conda/important_settings @@ -0,0 +1,49 @@ +#!/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="$GFORTRAN" +# required compiler flags +FCFLAGS="-ffree-line-length-none -std=f2008 -cpp -fallow-argument-mismatch" +# extra flags, for debugging and such +FCFLAGS_EXTRA="" + +# optimization stuff. Go all in, sometimes +OPTIMIZATION_LEVEL="-O0" +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" + From 9e472834eeea3b39f92c7938d4ca6eadff4ee631 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 18:09:56 +0100 Subject: [PATCH 02/10] conda | dev --- .conda/important_settings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.conda/important_settings b/.conda/important_settings index 58dee1ed..13e01ae7 100644 --- a/.conda/important_settings +++ b/.conda/important_settings @@ -2,7 +2,7 @@ # A central place to put all the important paths. You probably have to modify this to make things work. # the fortran compiler -FORTRAN_COMPILER="$GFORTRAN" +FORTRAN_COMPILER="$FC" # required compiler flags FCFLAGS="-ffree-line-length-none -std=f2008 -cpp -fallow-argument-mismatch" # extra flags, for debugging and such @@ -47,3 +47,4 @@ PATH_TO_HDF5_LIB="-L/$PREFIX/lib" PATH_TO_HDF5_INC="-I/$PREFIX/include" HDF5_LIBS="-lhdf5 -lhdf5_fortran" +USECGAL=no From 1e30cad434d5d75b5c10f08cfdbd6b70f184486e Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 18:29:40 +0100 Subject: [PATCH 03/10] conda | dev --- .conda/important_settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conda/important_settings b/.conda/important_settings index 13e01ae7..bd6c08e4 100644 --- a/.conda/important_settings +++ b/.conda/important_settings @@ -2,7 +2,7 @@ # 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" +FORTRAN_COMPILER="$BUILD_PREFIX/bin/mpifort" # required compiler flags FCFLAGS="-ffree-line-length-none -std=f2008 -cpp -fallow-argument-mismatch" # extra flags, for debugging and such From 3a2f7c072560846ec966d6007952b7f692ccfb36 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 18:56:08 +0100 Subject: [PATCH 04/10] conda | std=gnu --- .conda/important_settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conda/important_settings b/.conda/important_settings index bd6c08e4..05b629ca 100644 --- a/.conda/important_settings +++ b/.conda/important_settings @@ -4,7 +4,7 @@ # the fortran compiler FORTRAN_COMPILER="$BUILD_PREFIX/bin/mpifort" # required compiler flags -FCFLAGS="-ffree-line-length-none -std=f2008 -cpp -fallow-argument-mismatch" +FCFLAGS="-ffree-line-length-none -std=gnu -cpp -fallow-argument-mismatch" # extra flags, for debugging and such FCFLAGS_EXTRA="" From 0ea71e35ece00dae580891b11790db3df0f98160 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 19:33:26 +0100 Subject: [PATCH 05/10] conda | mv instead of ln binaries --- build_things.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_things.sh b/build_things.sh index 5679420b..9a33137a 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` From 28cf52f37efe209a69496a5be93294bd069b1f79 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 19:42:23 +0100 Subject: [PATCH 06/10] conda | fix --- build_things.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_things.sh b/build_things.sh index 9a33137a..a98e18fc 100755 --- a/build_things.sh +++ b/build_things.sh @@ -244,7 +244,7 @@ do # link it to bin? # [ -f build/${code}/${code} ] && ln -sf ../build/${code}/${code} bin/${code} # move it instead - [ -f build/${code}/${code} ] && mv ../build/${code}/${code} bin/${code} + [ -f build/${code}/${code} ] && mv build/${code}/${code} bin/${code} done basedir=`pwd` From cd1b8ad98ac086901da2d4ed0faa849b7f098ef6 Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Tue, 19 Nov 2024 20:38:46 +0100 Subject: [PATCH 07/10] conda | reduce no. of binaries --- build_things.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/build_things.sh b/build_things.sh index a98e18fc..be873219 100755 --- a/build_things.sh +++ b/build_things.sh @@ -132,20 +132,23 @@ fi # which codes should be compiled listofcodes=" -dump_dynamical_matrices -phonon_dispersion_relations -crystal_structure_info -generate_structure -canonical_configuration -lineshape -samples_from_md extract_forceconstants -atomic_distribution -pack_simulation -refine_structure -thermal_conductivity -anharmonic_free_energy " +# listofcodes=" +# dump_dynamical_matrices +# phonon_dispersion_relations +# crystal_structure_info +# generate_structure +# canonical_configuration +# lineshape +# samples_from_md +# extract_forceconstants +# atomic_distribution +# pack_simulation +# refine_structure +# thermal_conductivity +# anharmonic_free_energy +# " # only when we have cgal if [ ${USECGAL} == "yes" ] From 59cf21d0948868e1842bb9409bb7a8135c510adf Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Wed, 20 Nov 2024 11:29:48 +0100 Subject: [PATCH 08/10] conda | use gfortran? --- .conda/important_settings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.conda/important_settings b/.conda/important_settings index 05b629ca..7ab4347f 100644 --- a/.conda/important_settings +++ b/.conda/important_settings @@ -2,7 +2,8 @@ # A central place to put all the important paths. You probably have to modify this to make things work. # the fortran compiler -FORTRAN_COMPILER="$BUILD_PREFIX/bin/mpifort" +# FORTRAN_COMPILER="$BUILD_PREFIX/bin/mpifort" +FORTRAN_COMPILER="$FC" # required compiler flags FCFLAGS="-ffree-line-length-none -std=gnu -cpp -fallow-argument-mismatch" # extra flags, for debugging and such From 5776ba7836f903f05c61c7e8a086745dfd92153d Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Wed, 20 Nov 2024 16:29:26 +0100 Subject: [PATCH 09/10] conda | optimize --- .conda/important_settings | 3 +-- build_things.sh | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.conda/important_settings b/.conda/important_settings index 7ab4347f..16737ba4 100644 --- a/.conda/important_settings +++ b/.conda/important_settings @@ -2,7 +2,6 @@ # A central place to put all the important paths. You probably have to modify this to make things work. # the fortran compiler -# FORTRAN_COMPILER="$BUILD_PREFIX/bin/mpifort" FORTRAN_COMPILER="$FC" # required compiler flags FCFLAGS="-ffree-line-length-none -std=gnu -cpp -fallow-argument-mismatch" @@ -10,7 +9,7 @@ FCFLAGS="-ffree-line-length-none -std=gnu -cpp -fallow-argument-mismatch" FCFLAGS_EXTRA="" # optimization stuff. Go all in, sometimes -OPTIMIZATION_LEVEL="-O0" +OPTIMIZATION_LEVEL="-O3" OPTIMIZATION_SENSITIVE="-O0" # the flag that sets the default real to a double. diff --git a/build_things.sh b/build_things.sh index be873219..a98e18fc 100755 --- a/build_things.sh +++ b/build_things.sh @@ -132,23 +132,20 @@ fi # which codes should be compiled listofcodes=" +dump_dynamical_matrices +phonon_dispersion_relations +crystal_structure_info +generate_structure +canonical_configuration +lineshape +samples_from_md extract_forceconstants +atomic_distribution +pack_simulation +refine_structure +thermal_conductivity +anharmonic_free_energy " -# listofcodes=" -# dump_dynamical_matrices -# phonon_dispersion_relations -# crystal_structure_info -# generate_structure -# canonical_configuration -# lineshape -# samples_from_md -# extract_forceconstants -# atomic_distribution -# pack_simulation -# refine_structure -# thermal_conductivity -# anharmonic_free_energy -# " # only when we have cgal if [ ${USECGAL} == "yes" ] From c153747a47f85bd868551483f3b5285d7056afaa Mon Sep 17 00:00:00 2001 From: Florian Knoop Date: Thu, 12 Dec 2024 10:33:34 +0100 Subject: [PATCH 10/10] conda | add recipe --- .conda/conda.recipe/build.sh | 45 ++++++++++++++++++++++++++++++++++ .conda/conda.recipe/meta.yaml | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .conda/conda.recipe/build.sh create mode 100644 .conda/conda.recipe/meta.yaml 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