Skip to content

Commit

Permalink
Merge branch 'release/v.1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Apr 2, 2021
2 parents a993d83 + 5c5d819 commit aa3bb7e
Show file tree
Hide file tree
Showing 136 changed files with 15,080 additions and 7,707 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.1)

project(ALAMODE)

add_subdirectory(alm)
add_subdirectory(anphon)
add_subdirectory(tools)
34 changes: 34 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# Ver. 1.2.0 (2021-04-02)

## New features

- CMake installation option
- ``FC_BASIS`` tag (**alm**) for better stability of force constant symmetrization
- ``NONCOLLINEAR`` tag (**alm**) for phonon calculations with noncollinear magnetism
- ``NMAXSAVE`` tag (**alm**) that controls the maximum order of anharmonic terms to be saved in a file
- ``LMODEL = adaptive-lasso`` (**alm**) that performs adaptive LASSO
- ``KAPPA_COHERENT`` tag (**anphon**) for computing the coherent part of thermal conductivity
- ``ANIME_FRAMES`` tag (**anphon**) that controls the number of frames saved for animation outputs
- ``extract.py`` can extract the dielectric tensor and Born effective charges from vasprun.xml (VASP) and ph.x outputs (Quantum ESPRESSO) by the ``--get born`` option.
- ``fc_virtual.cpp`` which perform a virtual crystal approximation (VCA) like interpolation of force constants

## Changes

- The old tags ``DFILE`` and ``FFILE`` are not obsolete. Use ``DFSET`` instead.
- The filename extension of ``PREFIX``.enet_cv is changed as ``PREFIX``.cvset.
- ``CV_MINALPHA`` and ``CV_MAXALPHA`` are now set automatically (by default)
- The default value of ``CV_NALPHA`` is changed to 50
- The header part in PREFIX.evec has been modified slightly. Please be careful if you are using PREFIX.evec for further analyses.
- ``plotband.py`` now works nicely for discontinuous BZ paths.
- When ``BCONNECT > 0`` and KPMODE = 1, phonon velocities, polarization vectors, and Grüneisen parameters are also reordered before saved in files.
- Support command line usage of ``dfc2``

## Fixes

- The tetrahedron method (``ISMEAR = -1``) now works correctly even when the number of momentum points along each axis is only one. (fix issue #10)
- Fix an issue of MPI communicators when sending large messages (> 2^31-1).
- The parser for LAMMPS now can read *.lammps file that contains charge entries. (fix issue #13)
- Fix a bug in the ``ANIME`` option

# Ver. 1.1.0 (2019-05-01)

## New

- An interface to OpenMX code (contributed by Yuto Tanaka)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ Terumasa Tadano (National Institute for Materials Science, Japan)

* Tatsuro Nishimoto (Univ. Tokyo)
* Yusuke Oba (Univ. Tokyo)
* Yuto Tanaka (Kanazawa Univ.)
* Atsushi Togo (Kyoto Univ.)



[license-image]: https://img.shields.io/github/license/ttadano/alamode.svg
[license-url]: https://github.com/ttadano/alamode/blob/develop/LICENSE.txt

Expand Down
145 changes: 145 additions & 0 deletions alm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -O0 -D_DEBUG")

project(alm)

# Version numbers
file(READ ${PROJECT_SOURCE_DIR}/../include/version.h version_file)
string(REGEX MATCH "ALAMODE_VERSION = \"([0-9]+\\.[0-9]+\\.[0-9]+)\"" alm_version ${version_file})
set(alm_version ${CMAKE_MATCH_1})
MESSAGE("Setting up for ALM code (ALAMODE version: ${CMAKE_MATCH_1})")

if (SPGLIB_ROOT)
include_directories("${SPGLIB_ROOT}/include")
set(spglib "-L${SPGLIB_ROOT}/lib -L${SPGLIB_ROOT}/lib64 -lsymspg")
else()
message("SPGLIB_ROOT is not given by -DSPGLIB_ROOT option. Just add -lsymspg.")
set(spglib "-lsymspg")
endif()
#
# Add openmp flag if available
#
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

find_package(Boost)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
else()
if (BOOST_INCLUDE)
include_directories(${BOOST_INCLUDE})
else()
message(FATAL_ERROR "Boost was not found.
Please specify the location of boost include directories
via -DBOOST_INCLUDE option.")
endif()
endif()

find_package(Eigen3)
if (Eigen3_FOUND)
include_directories(${EIGEN3_INCLUDE_DIR})
else()
if (EIGEN3_INCLUDE)
include_directories(${EIGEN3_INCLUDE})
else()
message(FATAL_ERROR "Eigen3 was not found.
Please specify the location of boost include directories
via -DEIGEN3_INCLUDE option.")
endif()
endif()

if (WITH_HDF5_SUPPORT)
add_definitions(-D_HDF5)
find_package(HDF5 COMPONENTS CXX)
if (HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
set(hdf5library ${HDF5_LIBRARIES})
else()
if (HDF5_ROOT)
include_directories("${HDF5_ROOT}/include")
set(hdf5library "-L${HDF5_ROOT}/lib -lhdf5_cpp -lhdf5")
else()
message(FATAL_ERROR "HDF5 was not found.
Please specify the HDF5 install directory
via -DHDF5_ROOT option.")
endif()
endif()
endif()

find_package(LAPACK REQUIRED)
include_directories(${Lapack_INCLUDE_DIRS})

# Source code
include_directories("${PROJECT_SOURCE_DIR}/../include")
set(SOURCES ${PROJECT_SOURCE_DIR}/alm.cpp
${PROJECT_SOURCE_DIR}/cluster.cpp ${PROJECT_SOURCE_DIR}/constraint.cpp
${PROJECT_SOURCE_DIR}/fcs.cpp
${PROJECT_SOURCE_DIR}/files.cpp
${PROJECT_SOURCE_DIR}/input_parser.cpp
${PROJECT_SOURCE_DIR}/input_setter.cpp
${PROJECT_SOURCE_DIR}/optimize.cpp
${PROJECT_SOURCE_DIR}/patterndisp.cpp
${PROJECT_SOURCE_DIR}/rref.cpp
${PROJECT_SOURCE_DIR}/symmetry.cpp
${PROJECT_SOURCE_DIR}/system.cpp
${PROJECT_SOURCE_DIR}/timer.cpp
${PROJECT_SOURCE_DIR}/writer.cpp)

set(HEADERS ${PROJECT_SOURCE_DIR}/alm.h
${PROJECT_SOURCE_DIR}/cluster.h
${PROJECT_SOURCE_DIR}/constraint.h
${PROJECT_SOURCE_DIR}/fcs.h
${PROJECT_SOURCE_DIR}/files.h
${PROJECT_SOURCE_DIR}/input_parser.h
${PROJECT_SOURCE_DIR}/input_setter.h
${PROJECT_SOURCE_DIR}/optimize.h
${PROJECT_SOURCE_DIR}/patterndisp.h
${PROJECT_SOURCE_DIR}/rref.h
${PROJECT_SOURCE_DIR}/symmetry.h
${PROJECT_SOURCE_DIR}/system.h
${PROJECT_SOURCE_DIR}/timer.h
${PROJECT_SOURCE_DIR}/writer.h)

# # Trick to use gcc to compile *.cpp: This doesn't work because of boost
# SET_SOURCE_FILES_PROPERTIES(${SOURCES} PROPERTIES LANGUAGE C)
# set(CMAKE_C_COMPILER "gcc")

# Executable
add_executable(alm ${PROJECT_SOURCE_DIR}/main.cpp
${PROJECT_SOURCE_DIR}/alm_cui.cpp
${SOURCES} ${HEADERS})
target_link_libraries(alm ${Boost_LIBRARIES} ${LAPACK_LIBRARIES} ${spglib})
if (WITH_HDF5_SUPPORT)
target_link_libraries(alm ${hdf5library})
endif()

if (BUILD_LIBRARIES)
set(serial "${alm_version}")
set(soserial "1")
# Shared library
add_library(almcxx SHARED ${SOURCES})
target_link_libraries(almcxx ${Boost_LIBRARIES} ${LAPACK_LIBRARIES} ${spglib})
if (WITH_HDF5_SUPPORT)
target_link_libraries(almcxx ${hdf5library})
endif()
set_property(TARGET almcxx PROPERTY VERSION ${serial})
set_property(TARGET almcxx PROPERTY SOVERSION ${soserial})
install(TARGETS almcxx DESTINATION ${PROJECT_SOURCE_DIR}/lib)

# Static link library
add_library(almcxx_static STATIC ${SOURCES})
set_property(TARGET almcxx_static PROPERTY VERSION ${serial})
set_property(TARGET almcxx_static PROPERTY SOVERSION ${soserial})
set_property(TARGET almcxx_static PROPERTY OUTPUT_NAME almcxx)
install(TARGETS almcxx_static ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/lib)

# Header file
install(FILES ${PROJECT_SOURCE_DIR}/alm.h DESTINATION ${PROJECT_SOURCE_DIR}/include)
endif()
3 changes: 3 additions & 0 deletions alm/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

CXX = icpc
CXXFLAGS = -O2 -xHOST -qopenmp -std=c++11
#CXXFLAGS = -O2 -xHOST -qopenmp -std=c++11 -D_HDF5
INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include
#INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include -I$(HDF5_ROOT)/include

CXXL = ${CXX}
LDFLAGS = -mkl -L$(SPGLIB_ROOT)/lib -lsymspg
#LDFLAGS = -mkl -L$(SPGLIB_ROOT)/lib -lsymspg -L$(HDF5_ROOT)/lib -lhdf5_cpp -lhdf5

LAPACK =
LIBS = ${LAPACK}
Expand Down
12 changes: 9 additions & 3 deletions alm/Makefile.osx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
# We recommend to use Intel c++ compiler.
#-----------------------------------------------

# Use gcc >= 4.8 to use OpenMP
# OpenMP-enabled gcc can be installed via homebrew
CXX = g++-8
CXX = g++-10

# add -D_HDF5 to activate HDF5 support
CXXFLAGS = -O2 -fopenmp -std=c++11

# When HDF5 support is activated, you need to add -I$(HDF5_ROOT)/include
INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include

CXXL = ${CXX}
LDFLAGS = -lgomp -L$(SPGLIB_ROOT)/lib -lsymspg

# When HDF5 support is activated, you need to add -L$(HDF5_ROOT)/lib -lhdf5_cpp -lhdf5
#LDFLAGS = -lgomp -L$(SPGLIB_ROOT)/lib -lsymspg libsymspg.a
LDFLAGS = -lgomp $(SPGLIB_ROOT)/lib/libsymspg.a

LAPACK = -llapack -lblas
LIBS = ${LAPACK}
Expand Down
12 changes: 6 additions & 6 deletions alm/Makefile.osx_clang
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
# We recommend to use Intel c++ compiler.
#-----------------------------------------------

# Use clang++ to use hdf5 installed via homebrew
# Use clang++ with libomp installed via Homebrew
CXX = g++
CXXFLAGS = -O2 -std=c++11
INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include
CXXFLAGS = -O2 -std=c++11 -Xpreprocessor -fopenmp
INCLUDE = -I../include -I$(HOME)/include -I$(SPGLIB_ROOT)/include -I/usr/local/include/eigen3

CXXL = ${CXX}
LDFLAGS = -L$(SPGLIB_ROOT)/lib -lsymspg
LDFLAGS = $(SPGLIB_ROOT)/lib/libsymspg.a
#LDFLAGS = -L/usr/local/lib -lhdf5_cpp -lhdf5 -lsymspg

LAPACK = -llapack -lblas
LIBS = ${LAPACK}
LIBS = ${LAPACK} -lomp

#-----------------------------------------------
# General rules
Expand Down
Loading

0 comments on commit aa3bb7e

Please sign in to comment.