now it is possible to call cmake from make
This commit is contained in:
parent
35ab12e8f9
commit
c6d8d42b4d
|
@ -120,6 +120,10 @@ option(OPTIMIZATION "DAMASK optimization level [OFF,DEFENSIVE,AGGRESSIVE]"
|
||||||
option(SPECTRAL "Build spectral sovler for DAMASAK" OFF )
|
option(SPECTRAL "Build spectral sovler for DAMASAK" OFF )
|
||||||
option(FEM "Build FEM solver for DAMASK" OFF )
|
option(FEM "Build FEM solver for DAMASK" OFF )
|
||||||
|
|
||||||
|
if (NOT DEFINED CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
endif(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
# COMPILE VARIABLES
|
# COMPILE VARIABLES
|
||||||
add_definitions(-DDAMASKVERSION="${DAMASK_V}")
|
add_definitions(-DDAMASKVERSION="${DAMASK_V}")
|
||||||
add_definitions(-DPETSc)
|
add_definitions(-DPETSc)
|
||||||
|
@ -139,10 +143,12 @@ if ("${DAMASK_DRIVER}" STREQUAL "SPECTRAL")
|
||||||
set (SPECTRAL ON )
|
set (SPECTRAL ON )
|
||||||
add_definitions(-DSpectral)
|
add_definitions(-DSpectral)
|
||||||
set (FEM OFF)
|
set (FEM OFF)
|
||||||
|
message("***Confiugring Spectral Solver")
|
||||||
elseif ("${DAMASK_DRIVER}" STREQUAL "FEM")
|
elseif ("${DAMASK_DRIVER}" STREQUAL "FEM")
|
||||||
set (FEM ON )
|
set (FEM ON )
|
||||||
add_definitions(-DFEM)
|
add_definitions(-DFEM)
|
||||||
set (SPECTRAL OFF)
|
set (SPECTRAL OFF)
|
||||||
|
message("***Confiugring FEM Solver")
|
||||||
endif("${DAMASK_DRIVER}" STREQUAL "SPECTRAL")
|
endif("${DAMASK_DRIVER}" STREQUAL "SPECTRAL")
|
||||||
|
|
||||||
set (DAMASK_INCLUDE_FLAGS "${DAMASK_INCLUDE_FLAGS} ${PETSC_INCLUDES}" )
|
set (DAMASK_INCLUDE_FLAGS "${DAMASK_INCLUDE_FLAGS} ${PETSC_INCLUDES}" )
|
||||||
|
@ -473,7 +479,7 @@ else(DEFINED BUILDCMD_PRE AND DEFINED BUILDCMD_POST)
|
||||||
endif(DEFINED BUILDCMD_PRE AND DEFINED BUILDCMD_POST)
|
endif(DEFINED BUILDCMD_PRE AND DEFINED BUILDCMD_POST)
|
||||||
|
|
||||||
message("***COMPILE FLAGS:\n${CMAKE_Fortran_FLAGS_RELEASE}\n")
|
message("***COMPILE FLAGS:\n${CMAKE_Fortran_FLAGS_RELEASE}\n")
|
||||||
message("***LINK FLAGS:\n${CMAKE_EXE_LINKER_FLAGS_RELEASE}\n")
|
message("***LINKER:\n${CMAKE_Fortran_LINK_EXECUTABLE}\n")
|
||||||
|
|
||||||
# MOVE to SOURCE DIRECTORY for BUILDING
|
# MOVE to SOURCE DIRECTORY for BUILDING
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
37
Makefile
37
Makefile
|
@ -5,44 +5,25 @@ SHELL = /bin/sh
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: spectral FEM
|
all: spectral FEM
|
||||||
|
|
||||||
|
|
||||||
spectral: build/spectral
|
spectral: build/spectral
|
||||||
@(cd build/spectral; )
|
@(cd build/spectral; make; make install;)
|
||||||
|
|
||||||
|
|
||||||
build/spectral: build
|
build/spectral: build
|
||||||
@mkdir build/spectral
|
@mkdir build/spectral
|
||||||
@(cd build/spectral; cmake -Wno-dev -DCMAKE_VERBOSE_MAKEFILE=OFF -DOPENMP=ON -DOPTIMIZATION=DEFENSIVE -DDAMASK_DRIVER=SPECTRAL ../..;)
|
@(cd build/spectral; cmake -Wno-dev -DCMAKE_BUILD_TYPE=RELEASE -DDAMASK_DRIVER=SPECTRAL ../..;)
|
||||||
|
|
||||||
|
build: bin
|
||||||
build:
|
|
||||||
@mkdir build
|
@mkdir build
|
||||||
|
|
||||||
|
bin:
|
||||||
|
@mkdir bin
|
||||||
|
|
||||||
.PHONY: FEM
|
FEM: build/FEM
|
||||||
FEM:
|
@(cd build/FEM; cmake -Wno-dev -DCMAKE_BUILD_TYPE=RELEASE -DDAMASK_DRIVER=FEM ../..;)
|
||||||
$(MAKE) DAMASK_FEM.exe -C src
|
|
||||||
|
|
||||||
.PHONY: marc
|
build/FEM: build
|
||||||
marc:
|
@mkdir build
|
||||||
@./installation/mods_MarcMentat/apply_DAMASK_modifications.sh ${MAKEFLAGS}
|
|
||||||
|
|
||||||
.PHONY: processing
|
|
||||||
processing:
|
|
||||||
@if hash cython 2>/dev/null; then \
|
|
||||||
cd ./lib/damask; \
|
|
||||||
CC=gcc python setup_corientation.py build_ext --inplace; \
|
|
||||||
rm -rv build; \
|
|
||||||
rm *.c; \
|
|
||||||
fi
|
|
||||||
@./installation/compile_CoreModule.py ${MAKEFLAGS}
|
|
||||||
|
|
||||||
.PHONY: tidy
|
|
||||||
tidy:
|
|
||||||
@$(MAKE) tidy -C src >/dev/null
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rvf build
|
rm -rvf build
|
||||||
|
|
Loading…
Reference in New Issue