Commit 3f278384 authored by jclamber's avatar jclamber

better fortran detection

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@191 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent 7876490e
...@@ -25,9 +25,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) ...@@ -25,9 +25,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# load setup flags # load setup flags
include(SetupFlags) include(SetupFlags)
if ( ${CMAKE_ENABLE_FORTRAN} ) # Check fortran compiler
enable_language(Fortran OPTIONAL) include(CheckFortranCompiler)
endif()
# contains the full path to the top level directory of your build tree # contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} ) MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
...@@ -90,15 +89,15 @@ endif(OSX) ...@@ -90,15 +89,15 @@ endif(OSX)
# ------------------ # ------------------
# TEST PROGRAM # TEST PROGRAM
# ------------------ # ------------------
if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") #if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) # set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") #endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
#enable_language(Fortran OPTIONAL) #enable_language(Fortran OPTIONAL)
if (CMAKE_Fortran_COMPILER) #if (CMAKE_Fortran_COMPILER)
message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}") # message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
MESSAGE(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER}) # MESSAGE(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER})
endif() #endif()
#if (CMAKE_Fortran_COMPILER) #if (CMAKE_Fortran_COMPILER)
# SET(CMAKE_Fortran_COMPILER gfortran) # SET(CMAKE_Fortran_COMPILER gfortran)
......
# -*-cmake-*-
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2008-2014
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# Laboratoire d'Astrophysique de Marseille
# Pole de l'Etoile, site de Chateau-Gombert
# 38, rue Frederic Joliot-Curie
# 13388 Marseille cedex 13 France
# CNRS U.M.R 6110
# ============================================================================
# check if fortran compiler is installed
# ============================================================================
if ( NOT CMAKE_DISABLE_FORTRAN )
MESSAGE("\n\nTrying do detect fortran support.....")
MESSAGE("\nYou can change FORTRAN compiler name by setting FC variable before running cmake, like\nexport FC=ifort\n")
MESSAGE("or run directly the command:\nFC=ifort cmake ..\n\n")
MESSAGE("If you want to disable FORTRAN support, add following command to cmake:\n-DCMAKE_DISABLE_FORTRAN=1\n\n")
enable_language(Fortran OPTIONAL)
else()
MESSAGE("\n\nFortran support DISABLE\n\n")
endif()
if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
if (CMAKE_Fortran_COMPILER)
message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
message(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER})
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
if (Fortran_COMPILER_NAME STREQUAL "gfortran")
# gfortran
set (EXTRA_Fortran_FLAGS " ${WARNF} -ffixed-line-length-none ")
endif()
endif()
\ No newline at end of file
...@@ -25,11 +25,6 @@ if ( NOT SETUP_FLAGS_INCLUDED ) ...@@ -25,11 +25,6 @@ if ( NOT SETUP_FLAGS_INCLUDED )
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug ) typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug )
endif() endif()
# Enable fortran language detection by default
if ( NOT CMAKE_ENABLE_FORTRAN )
MESSAGE ("NOOOOOOOOOOOOOT")
typed_cache_set ( STRING "Try to enable FORTRAN" CMAKE_ENABLE_FORTRAN 1 )
endif()
# set optimizer flag # set optimizer flag
if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
typed_cache_set (STRING "Optimizer" OPT "-g -ggdb") typed_cache_set (STRING "Optimizer" OPT "-g -ggdb")
......
#!/usr/bin/python
import matplotlib import matplotlib
import numpy as np import numpy as np
import matplotlib.colors import matplotlib.colors
...@@ -216,7 +218,7 @@ def compute(file,out,component,times,xrange,sigma): ...@@ -216,7 +218,7 @@ def compute(file,out,component,times,xrange,sigma):
# ylvis.append(y[i]) # ylvis.append(y[i])
fig = plt.figure(figsize=(20,20),dpi=150)#figsize=(1024,1024)) fig = plt.figure(figsize=(20,20),dpi=150)#figsize=(1024,1024))
DPI = fig.get_dpi() DPI = fig.get_dpi()
print "DPI:", DPI print "DPI:", DPI
DefaultSize = fig.get_size_inches() DefaultSize = fig.get_size_inches()
...@@ -249,6 +251,7 @@ def compute(file,out,component,times,xrange,sigma): ...@@ -249,6 +251,7 @@ def compute(file,out,component,times,xrange,sigma):
else: else:
outfile=out+"."+"%05d"%cpt+".png" outfile=out+"."+"%05d"%cpt+".png"
print ">> ",outfile print ">> ",outfile
#fig = plt.figure(figsize=(10,10),dpi=300)
plt.savefig(outfile, bbox_inches=0) plt.savefig(outfile, bbox_inches=0)
plt.close(fig) plt.close(fig)
......
# -*-cmake-*- # -*-cmake-*-
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2008-2014
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# Laboratoire d'Astrophysique de Marseille
# Pole de l'Etoile, site de Chateau-Gombert
# 38, rue Frederic Joliot-Curie
# 13388 Marseille cedex 13 France
# CNRS U.M.R 6110
# ============================================================================
# check if fortran compiler is installed # check if fortran compiler is installed
# ============================================================================
if ( NOT CMAKE_DISABLE_FORTRAN )
MESSAGE("\n\nTrying do detect fortran support.....")
MESSAGE("\nYou can change FORTRAN compiler name by setting FC variable before running cmake, like\nexport FC=ifort\n")
MESSAGE("or run directly the command:\nFC=ifort cmake ..\n\n")
MESSAGE("If you want to disable FORTRAN support, add following command to cmake:\n-DCMAKE_DISABLE_FORTRAN=1\n\n")
enable_language(Fortran OPTIONAL)
else()
MESSAGE("\n\nFortran support DISABLE\n\n")
endif()
if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
enable_language(Fortran OPTIONAL)
message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
# FFLAGS depend on the compiler if (CMAKE_Fortran_COMPILER)
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
message(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER})
if (Fortran_COMPILER_NAME STREQUAL "gfortran") # FFLAGS depend on the compiler
# gfortran get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
set (EXTRA_Fortran_FLAGS " ${WARNF} -ffixed-line-length-none ")
if (Fortran_COMPILER_NAME STREQUAL "gfortran")
# gfortran
set (EXTRA_Fortran_FLAGS " ${WARNF} -ffixed-line-length-none ")
endif()
endif() endif()
\ No newline at end of file
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
! input parameters ! input parameters
integer ident,nbody integer ident,nbody
! UNS variable ! UNS variable
integer status integer status,lnblnk
integer uns_get_range, uns_save_init integer uns_get_range, uns_save_init
integer uns_get_value_f, uns_get_array_f, nsel integer uns_get_value_f, uns_get_array_f, nsel
integer uns_set_array_f, uns_set_value_f, ok integer uns_set_array_f, uns_set_value_f, ok
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment