-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2764ac3
commit e014a45
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,6 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# CMake Build Directory | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
project(UCNS3D Fortran) | ||
|
||
# FFLAGS depend on the compiler | ||
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) | ||
|
||
if (Fortran_COMPILER_NAME MATCHES "gfortran*") | ||
# gfortran | ||
set(CMAKE_Fortran_FLAGS "-fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fbackslash -fopenmp -finit-local-zero -fimplicit-none -flto -fcray-pointer -Wno-lto-type-mismatch") | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -march=native") | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g") | ||
elseif (Fortran_COMPILER_NAME MATCHES "ifort*") | ||
# ifort (untested) | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3") | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-f77rtl -O0 -g") | ||
else (Fortran_COMPILER_NAME MATCHES "gfortran.*") | ||
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) | ||
message ("Fortran compiler: " ${Fortran_COMPILER_NAME}) | ||
message ("No optimized Fortran compiler flags are known, we just try -O2...") | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-O2") | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") | ||
endif (Fortran_COMPILER_NAME MATCHES "gfortran*") | ||
|
||
# | ||
find_package(MPI REQUIRED COMPONENTS Fortran) | ||
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) | ||
|
||
add_subdirectory(CODE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
set(SRCS | ||
basis.f90 | ||
bc_p.f90 | ||
communications.f90 | ||
declarations.f90 | ||
der_r.f90 | ||
flow_operations.f90 | ||
flux_p.f90 | ||
flux_pv.f90 | ||
gradients.f90 | ||
grid_p.f90 | ||
grid_t.f90 | ||
implicit_fluxes.f90 | ||
implicit_time.f90 | ||
init_p.f90 | ||
io.f90 | ||
local_pt.f90 | ||
main.f90 | ||
matrix.f90 | ||
memory.f90 | ||
mood.f90 | ||
mpi_p.f90 | ||
parameters.f90 | ||
parts.f90 | ||
prestore.f90 | ||
profile.f90 | ||
reconstruct_p.f90 | ||
riemann.f90 | ||
source.f90 | ||
svd.f90 | ||
time_p.f90 | ||
translate.f90 | ||
) | ||
|
||
find_library(BLIS_LIBRARY NAMES libblis.a) | ||
find_library(ParMetis_LIBRARY NAMES libparmetis.a) | ||
find_library(Metis_LIBRARY NAMES libmetis.so) | ||
|
||
add_executable(ucns3d_p ${SRCS} ) | ||
|
||
target_link_libraries(ucns3d_p ${BLIS_LIBRARY} ${ParMetis_LIBRARY} ${Metis_LIBRARY} | ||
${CMAKE_CURRENT_SOURCE_DIR}/libtecio.so | ||
) |