Merge branch 'MiscImprovements' of magit1.mpie.de:/damask/DAMASK into MiscImprovements
This commit is contained in:
commit
20f647158f
|
@ -106,11 +106,11 @@ set (CMAKE_C_COMPILER "${PETSC_MPICC}")
|
|||
|
||||
# DAMASK solver defines project to build
|
||||
if (DAMASK_SOLVER STREQUAL "GRID")
|
||||
project (DAMASK_grid Fortran C)
|
||||
project (damask-grid Fortran C)
|
||||
add_definitions (-DGrid)
|
||||
message ("Building Grid Solver\n")
|
||||
elseif (DAMASK_SOLVER STREQUAL "FEM")
|
||||
project (DAMASK_FEM Fortran C)
|
||||
project (damask-mesh Fortran C)
|
||||
add_definitions (-DFEM)
|
||||
message ("Building FEM Solver\n")
|
||||
else ()
|
||||
|
@ -156,22 +156,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
|||
set (BUILDCMD_POST "${BUILDCMD_POST} -fsyntax-only")
|
||||
endif ()
|
||||
|
||||
# Parse DAMASK_BIN from CONFIG file
|
||||
file (READ "CONFIG" CONFIGFILE)
|
||||
string (REGEX REPLACE ";" "\\\\;" CONFIGFILE "${CONFIGFILE}")
|
||||
string (REGEX REPLACE "\n" ";" CONFIGFILE "${CONFIGFILE}")
|
||||
foreach (item ${CONFIGFILE})
|
||||
string (REGEX MATCH ".+DAMASK_BIN.+" item ${item})
|
||||
if (item)
|
||||
string (REGEX REPLACE "set" "" item "${item}")
|
||||
string (REGEX REPLACE "=" " " item "${item}")
|
||||
string (REGEX REPLACE "\\\${DAMASK_ROOT}" "${PROJECT_SOURCE_DIR}" item "${item}")
|
||||
string (REPLACE "DAMASK_BIN" ";" STRING_LIST ${item})
|
||||
list (GET STRING_LIST 1 item)
|
||||
string (STRIP "${item}" CMAKE_INSTALL_PREFIX)
|
||||
endif ()
|
||||
endforeach(item ${CONFIGFILE})
|
||||
|
||||
# Parse DAMASK version from VERSION file
|
||||
find_program (CAT_EXECUTABLE NAMES cat)
|
||||
execute_process (COMMAND ${CAT_EXECUTABLE} ${PROJECT_SOURCE_DIR}/VERSION
|
||||
|
@ -483,18 +467,3 @@ message ("Fortran Linker Command:\n${CMAKE_Fortran_LINK_EXECUTABLE}\n")
|
|||
|
||||
# location of code
|
||||
add_subdirectory (src)
|
||||
|
||||
# INSTALL BUILT BINARIES
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
||||
exec_program (mktemp OUTPUT_VARIABLE nothing)
|
||||
exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole)
|
||||
install (PROGRAMS ${nothing} DESTINATION ${black_hole})
|
||||
else ()
|
||||
if (PROJECT_NAME STREQUAL "DAMASK_grid")
|
||||
install (PROGRAMS ${PROJECT_BINARY_DIR}/src/DAMASK_spectral
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
elseif (PROJECT_NAME STREQUAL "DAMASK_FEM")
|
||||
install (PROGRAMS ${PROJECT_BINARY_DIR}/src/DAMASK_FEM
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
2
CONFIG
2
CONFIG
|
@ -1,8 +1,6 @@
|
|||
# "set"-syntax needed only for tcsh (but works with bash and zsh)
|
||||
# DAMASK_ROOT will be expanded
|
||||
|
||||
set DAMASK_BIN = ${DAMASK_ROOT}/bin
|
||||
|
||||
set DAMASK_NUM_THREADS = 4
|
||||
|
||||
set MSC_ROOT = /opt/msc
|
||||
|
|
5
Makefile
5
Makefile
|
@ -2,6 +2,7 @@ SHELL = /bin/sh
|
|||
########################################################################################
|
||||
# Makefile for the installation of DAMASK
|
||||
########################################################################################
|
||||
DAMASK_ROOT = $(shell python -c "import os,sys; print(os.path.normpath(os.path.realpath(os.path.expanduser('$(pwd)'))))")
|
||||
.PHONY: all
|
||||
all: grid FEM processing
|
||||
|
||||
|
@ -20,12 +21,12 @@ FEM: build/FEM
|
|||
.PHONY: build/grid
|
||||
build/grid:
|
||||
@mkdir -p build/grid
|
||||
@(cd build/grid; cmake -Wno-dev -DDAMASK_SOLVER=GRID -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
|
||||
@(cd build/grid; cmake -Wno-dev -DDAMASK_SOLVER=GRID -DCMAKE_INSTALL_PREFIX=${DAMASK_ROOT} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
|
||||
|
||||
.PHONY: build/FEM
|
||||
build/FEM:
|
||||
@mkdir -p build/FEM
|
||||
@(cd build/FEM; cmake -Wno-dev -DDAMASK_SOLVER=FEM -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
|
||||
@(cd build/FEM; cmake -Wno-dev -DDAMASK_SOLVER=FEM -DCMAKE_INSTALL_PREFIX=${DAMASK_ROOT} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=${BUILDCMD_POST} -DBUILDCMD_PRE=${BUILDCMD_PRE} -DOPTIMIZATION=${OPTIMIZATION} -DOPENMP=${OPENMP} ../../;)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
|
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
|||
Subproject commit f342bc7dabddf5a9c7786d14115145ef4b0f330b
|
||||
Subproject commit f6171a748e51b994db27c2cc74cc0168b7aea93f
|
|
@ -13,9 +13,7 @@ set BRANCH = `git branch 2>/dev/null| grep -E '^\* ')`
|
|||
cd - >/dev/null
|
||||
|
||||
# if DAMASK_BIN is present
|
||||
if ( $?DAMASK_BIN) then
|
||||
set path = ($DAMASK_BIN $path)
|
||||
endif
|
||||
set path = ($DAMASK_ROOT/bin $path)
|
||||
|
||||
set SOLVER=`which DAMASK_spectral`
|
||||
set PROCESSING=`which postResults`
|
||||
|
|
|
@ -33,8 +33,7 @@ unset -f set
|
|||
# add BRANCH if DAMASK_ROOT is a git repository
|
||||
cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd - >/dev/null
|
||||
|
||||
# add DAMASK_BIN if present
|
||||
[ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH
|
||||
PATH=${DAMASK_ROOT}/bin:$PATH
|
||||
|
||||
SOLVER=$(type -p DAMASK_spectral || true 2>/dev/null)
|
||||
[ "x$SOLVER" == "x" ] && SOLVER=$(blink 'Not found!')
|
||||
|
|
|
@ -25,7 +25,7 @@ unset -f set
|
|||
cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd - >/dev/null
|
||||
|
||||
# add DAMASK_BIN if present
|
||||
[[ "x$DAMASK_BIN" != "x" ]] && PATH=$DAMASK_BIN:$PATH
|
||||
PATH=${DAMASK_ROOT}/bin:$PATH
|
||||
|
||||
SOLVER=$(which DAMASK_spectral || true 2>/dev/null)
|
||||
[[ "x$SOLVER" == "x" ]] && SOLVER=$(blink 'Not found!')
|
||||
|
|
|
@ -7,7 +7,7 @@ import damask
|
|||
|
||||
damaskEnv = damask.Environment()
|
||||
baseDir = damaskEnv.relPath('processing/')
|
||||
binDir = damaskEnv.options['DAMASK_BIN']
|
||||
binDir = damaskEnv.relPath('bin/')
|
||||
|
||||
if not os.path.isdir(binDir):
|
||||
os.mkdir(binDir)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
dist
|
|
@ -0,0 +1 @@
|
|||
../../LICENSE
|
|
@ -0,0 +1 @@
|
|||
../../VERSION
|
|
@ -3,8 +3,8 @@
|
|||
"""Main aggregator"""
|
||||
import os
|
||||
|
||||
with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f:
|
||||
version = f.readline()[:-1]
|
||||
with open(os.path.join(os.path.dirname(__file__),'VERSION')) as f:
|
||||
version = f.readline()[1:-1]
|
||||
|
||||
name = 'damask'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: UTF-8 no BOM -*-
|
||||
|
||||
import os,subprocess,shlex,re
|
||||
import os,re
|
||||
|
||||
class Environment():
|
||||
__slots__ = [ \
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
name="damask",
|
||||
version="0.0.1",
|
||||
author="The DAMASK team",
|
||||
author_email="damask@mpie.de",
|
||||
description="Python library for DAMASK",
|
||||
long_description='test',
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/pypa/sampleproject",
|
||||
packages=setuptools.find_packages(),
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GLPv3",
|
||||
"Operating System :: OS Independent",
|
||||
],
|
||||
)
|
|
@ -14,7 +14,7 @@ list(FILTER sources EXCLUDE REGEX ".*mesh_abaqus.*\\.f90")
|
|||
list(FILTER sources EXCLUDE REGEX ".*commercialFEM_fileList.*\\.f90")
|
||||
|
||||
|
||||
if (PROJECT_NAME STREQUAL "DAMASK_grid")
|
||||
if (PROJECT_NAME STREQUAL "damask-grid")
|
||||
|
||||
# probably we should have subfolders for FEM and spectral
|
||||
list(FILTER sources EXCLUDE REGEX ".*DAMASK_FEM.*\\.f90")
|
||||
|
@ -25,11 +25,15 @@ if (PROJECT_NAME STREQUAL "DAMASK_grid")
|
|||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
||||
add_executable(DAMASK_spectral ${sources})
|
||||
install (TARGETS DAMASK_spectral RUNTIME DESTINATION bin)
|
||||
else()
|
||||
add_library(DAMASK_spectral OBJECT ${sources})
|
||||
exec_program (mktemp OUTPUT_VARIABLE nothing)
|
||||
exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole)
|
||||
install (PROGRAMS ${nothing} DESTINATION ${black_hole})
|
||||
endif()
|
||||
|
||||
elseif (PROJECT_NAME STREQUAL "DAMASK_FEM")
|
||||
elseif (PROJECT_NAME STREQUAL "damask-mesh")
|
||||
|
||||
# probably we should have subfolders for FEM and spectral
|
||||
list(FILTER sources EXCLUDE REGEX ".*DAMASK_grid.*\\.f90")
|
||||
|
@ -42,5 +46,6 @@ elseif (PROJECT_NAME STREQUAL "DAMASK_FEM")
|
|||
list(FILTER sources EXCLUDE REGEX ".*mesh_grid.*\\.f90")
|
||||
|
||||
add_executable(DAMASK_FEM ${sources})
|
||||
install (TARGETS DAMASK_FEM RUNTIME DESTINATION bin)
|
||||
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue