Commit 40ae11ba authored by juan rodriguez-carvajal's avatar juan rodriguez-carvajal
Browse files

Merge branch 'testing-fpm' into 'master'

Eliminating CFML_GlobalDeps_Windows_intel64.f90 that is the same as...

See merge request !25
parents c33300ff 55ad36a0
Pipeline #12485 passed with stages
in 6 minutes and 25 seconds
......@@ -881,12 +881,11 @@ Subroutine Write_FST(fst_file,v,cost)
character(len=132) :: file_fst,fst_cmd
character(len=30), dimension(10) :: cmds
if(v(1) == 1.234567) write(*,"(a)") " => This is nothing!"
if(v(1) == 1.234567 .and. cost == v(2)) write(*,"(a)") " => This is nothing! To avoid warnings in compilation"
i=index(fst_file,".fst")
file_fst=fst_file(1:i+3)
fst_cmd=adjustl(fst_file(i+4:))
nc=0
if(cost < -1.0e30) write(unit=*,fmt="(a)",advance="no") "?" !Just to avoid warning
do
i=index(fst_cmd,";")
if(i /= 0) then
......
......@@ -45,7 +45,7 @@
!!--.. Operating system
!!--..
!!---- OPS
!!---- OPS_NAME
!!---- OPS_NAME
!!---- OPS_SEP
!!--..
!!--.. Precision Data
......@@ -290,4 +290,4 @@ Module CFML_GlobalDeps
" Time: "//tim(1:2)//":"//tim(3:4)//":"//tim(5:10)
return
End Subroutine Write_Date_Time
End Module CFML_GlobalDeps
End Module CFML_GlobalDeps
!!-------------------------------------------------------
!!---- Crystallographic Fortran Modules Library (CrysFML)
!!-------------------------------------------------------
!!---- The CrysFML project is distributed under LGPL. In agreement with the
!!---- Intergovernmental Convention of the ILL, this software cannot be used
!!---- in military applications.
!!----
!!---- Copyright (C) 1999-2012 Institut Laue-Langevin (ILL), Grenoble, FRANCE
!!---- Universidad de La Laguna (ULL), Tenerife, SPAIN
!!---- Laboratoire Leon Brillouin(LLB), Saclay, FRANCE
!!----
!!---- Authors: Juan Rodriguez-Carvajal (ILL)
!!---- Javier Gonzalez-Platas (ULL)
!!---- Nebil Ayape Katcho (ILL)
!!----
!!---- Contributors: Laurent Chapon (ILL)
!!---- Marc Janoschek (Los Alamos National Laboratory, USA)
!!---- Oksana Zaharko (Paul Scherrer Institute, Switzerland)
!!---- Tierry Roisnel (CDIFX,Rennes France)
!!---- Eric Pellegrini (ILL)
!!----
!!---- This library is free software; you can redistribute it and/or
!!---- modify it under the terms of the GNU Lesser General Public
!!---- License as published by the Free Software Foundation; either
!!---- version 3.0 of the License, or (at your option) any later version.
!!----
!!---- This library is distributed in the hope that it will be useful,
!!---- but WITHOUT ANY WARRANTY; without even the implied warranty of
!!---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
!!---- Lesser General Public License for more details.
!!----
!!---- You should have received a copy of the GNU Lesser General Public
!!---- License along with this library; if not, see <http://www.gnu.org/licenses/>.
!!----
!!----
!!---- MODULE: CFML_GlobalDeps (Windows version)
!!---- INFO: Precision for CrysFML library and Operating System information
!!---- All the global variables defined in this module are implicitly public.
!!----
!!---- HISTORY
!!--.. Update: January - 2009
!!--..
!!---- VARIABLES
!!--..
!!--.. Operating system
!!--..
!!---- OPS
!!---- OPS_NAME
!!---- OPS_SEP
!!--..
!!--.. Precision Data
!!--..
!!---- SP
!!---- DP
!!---- CP
!!--..
!!--.. Trigonometric
!!--..
!!---- PI
!!---- TO_DEG
!!---- TO_RAD
!!---- TPI
!!--..
!!--.. Numeric
!!--..
!!---- DEPS
!!---- EPS
!!--..
!!---- FUNCTIONS
!!--..
!!---- DIRECTORY_EXISTS
!!----
!!
Module CFML_GlobalDeps
!---- Variables ----!
implicit None
public
!------------------------------------!
!---- Operating System variables ----!
!------------------------------------!
!!----
!!---- OPS
!!---- Integer variable 1: Windows, 2: Linux, 3: MacOs, ....
!!---- This is a variable set by the user of the library for the case
!!---- that there is no external library with a procedure for getting
!!---- the operating system.
!!----
!!---- Update: March 2009
!!
integer, parameter :: OPS= 1 ! Windows
!!----
!!---- OPS_NAME
!!---- Character variable containing the name of the operating system
!!---- This is a variable set by the user of the library for the case
!!---- that there is no external library with a procedure for getting
!!---- the operating system.
!!----
!!---- Update: March 2009
!!
character(len=*), parameter :: OPS_NAME="Windows"
!!----
!!---- OPS_SEP
!!---- ASCII code of directory separator character
!!---- Here it is written explicitly as a character variable
!!----
!!---- Update: March 2009
!!
character(len=*), parameter :: OPS_SEP="\"
!------------------------------!
!---- Precision Parameters ----!
!------------------------------!
!!----
!!---- SP
!!---- SP: Single precision ( sp = selected_real_kind(6,30) )
!!----
!!---- Update: January - 2009
!!
integer, parameter :: sp = selected_real_kind(6,30)
!!----
!!---- DP
!!---- DP: Double precision ( dp = selected_real_kind(14,150) )
!!----
!!---- Update: January - 2009
!!
integer, parameter :: dp = selected_real_kind(14,150)
!!----
!!---- CP
!!---- CP: Current precision
!!----
!!---- Update: January - 2009
!!
integer, parameter :: cp = sp
integer, parameter :: IL = selected_int_kind(16) ! Long Integer
!----------------------------------!
!---- Trigonometric Parameters ----!
!----------------------------------!
!!----
!!---- PI
!!---- real(kind=dp), parameter :: pi = 3.141592653589793238463_dp
!!----
!!---- Pi value
!!----
!!---- Update: January - 2009
!!
real(kind=dp), parameter :: pi = 3.141592653589793238463_dp
!!----
!!---- TO_DEG
!!---- real(kind=dp), parameter :: to_DEG = 180.0_dp/pi
!!----
!!---- Conversion from Radians to Degrees
!!----
!!---- Update: January - 2009
!!
real(kind=dp), parameter :: to_DEG = 180.0_dp/pi
!!----
!!---- TO_RAD
!!---- real(kind=dp), parameter :: to_RAD = pi/180.0_dp
!!----
!!---- Conversion from Degrees to Radians
!!----
!!---- Update: January - 2009
!!
real(kind=dp), parameter :: to_RAD = pi/180.0_dp
!!----
!!---- TPI
!!---- real(kind=dp), parameter :: tpi = 6.283185307179586476925_dp
!!----
!!---- 2.0*Pi value
!!----
!!---- Update: January - 2009
!!
real(kind=dp), parameter :: tpi = 6.283185307179586476925_dp
!----------------------------!
!---- Numeric Parameters ----!
!----------------------------!
!!----
!!---- DEPS
!!---- real(kind=dp), parameter :: deps=0.00000001_dp
!!----
!!---- Epsilon value use for comparison of real numbers
!!----
!!---- Update: January - 2009
!!
real(kind=dp), parameter, public :: deps=0.00000001_dp
!!----
!!---- EPS
!!---- real(kind=cp), public :: eps=0.00001_cp
!!----
!!---- Epsilon value use for comparison of real numbers
!!----
!!---- Update: January - 2009
!!
real(kind=cp), parameter, public :: eps=0.00001_cp
Contains
!-------------------!
!---- Functions ----!
!-------------------!
!!----
!!---- Function Directory_Exists(Dirname) Result(info)
!!---- character(len=*), intent(in) :: Dirname
!!---- logical :: info
!!----
!!---- Generic function dependent of the compiler that return
!!---- a logical value if a directory exists or not.
!!----
!!---- Update: April - 2009
!!
Function Directory_Exists(Dirname) Result(info)
!---- Argument ----!
character(len=*), intent(in) :: Dirname
logical :: info
!---- Local Variables ----!
character(len=512) :: linea
integer :: nlong
! Init value
info=.false.
linea=trim(dirname)
nlong=len_trim(linea)
if (nlong ==0) return
if (linea(nlong:nlong) /= ops_sep) linea=trim(linea)//ops_sep
! All compilers except Intel
!inquire(file=trim(linea)//'.' , exist=info)
! Intel
inquire(directory=trim(linea), exist=info)
return
End Function Directory_Exists
!---------------------!
!---- Subroutines ----!
!---------------------!
!!----
!!---- Subroutine Write_Date_Time(lun)
!!---- integer, intent(in) :: lun
!!----
!!---- Generic subroutine for writing the date and time
!!---- in form Date: Day/Month/Year Time: hour:minute:second
!!---- to a file with logical unit = lun.
!!----
!!---- Update: January - 2014
!!
Subroutine Write_Date_Time(lun,dtim)
integer, optional,intent(in) :: lun
character(len=*),optional,intent(out):: dtim
!--- Local variables ----!
character (len=10) :: dat
character (len=10) :: tim
call date_and_time(date=dat,time=tim)
if(present(lun)) &
write(unit=lun,fmt="(/,4a)") &
" => Date: ",dat(7:8)//"/"//dat(5:6)//"/"//dat(1:4), &
" Time: ",tim(1:2)//":"//tim(3:4)//":"//tim(5:10)
if(present(dtim)) &
dtim="# Date: "//dat(7:8)//"/"//dat(5:6)//"/"//dat(1:4)// &
" Time: "//tim(1:2)//":"//tim(3:4)//":"//tim(5:10)
return
End Subroutine Write_Date_Time
End Module CFML_GlobalDeps
......@@ -7,11 +7,7 @@
if(WIN32 OR MSYS)
# Intel Fortran compiler
if(${COMPILER_NAME} STREQUAL ifort)
if(ARCH32)
set(GLOBAL_DEPS CFML_GlobalDeps_Windows_Intel.f90)
else()
set(GLOBAL_DEPS CFML_GlobalDeps_Windows_Intel64.f90)
endif()
set(GLOBAL_DEPS CFML_GlobalDeps_Windows_Intel.f90)
set(STRING_UTILS CFML_String_Utilities.f90)
else()
set(GLOBAL_DEPS CFML_GlobalDeps_Windows.f90)
......
......@@ -13,7 +13,6 @@ if [%_CHANGE%]==[to_xxx] (
ren CFML_GlobalDeps_MacOS_Intel.f90 CFML_GlobalDeps_MacOS_Intel.xxx
ren CFML_GlobalDeps_Windows.f90 CFML_GlobalDeps_Windows.xxx
ren CFML_GlobalDeps_Windows_Intel.f90 CFML_GlobalDeps_Windows_Intel.xxx
ren CFML_GlobalDeps_Windows_Intel64.f90 CFML_GlobalDeps_Windows_Intel64.xxx
ren CFML_HDF5.f90 CFML_HDF5.xxx
ren CFML_ILL_Instrm_Data_LF.f90 CFML_ILL_Instrm_Data_LF.xxx
ren CFML_IO_MessagesRW.f90 CFML_IO_MessagesRW.xxx
......@@ -37,7 +36,6 @@ if [%_CHANGE%]==[to_f90] (
ren CFML_GlobalDeps_MacOS_Intel.xxx CFML_GlobalDeps_MacOS_Intel.f90
ren CFML_GlobalDeps_Windows.xxx CFML_GlobalDeps_Windows.f90
ren CFML_GlobalDeps_Windows_Intel.xxx CFML_GlobalDeps_Windows_Intel.f90
ren CFML_GlobalDeps_Windows_Intel64.xxx CFML_GlobalDeps_Windows_Intel64.f90
ren CFML_HDF5.xxx CFML_HDF5.f90
ren CFML_ILL_Instrm_Data_LF.xxx CFML_ILL_Instrm_Data_LF.f90
ren CFML_IO_MessagesRW.xxx CFML_IO_MessagesRW.f90
......
#!/bin/bash
#
if [ -z "$1" ]; then
cat << !
Syntax : tochange.sh xxx or tochange.sh f90
!
exit
fi
#
# Arguments
#
for arg in "$@"
do
case "$arg" in
"xxx")
to_change=$arg
;;
"f90")
to_change=$arg
;;
esac
done
if [ $to_change == "xxx" ]; then
echo "---- Changing the extension of some *.f90 files to *.xxx to maintain compatibility with FPM"
mv CFML_Export_Vtk_LF95.f90 CFML_Export_Vtk_LF95.xxx
mv CFML_FlipR_Mod.f90 CFML_FlipR_Mod.xxx
mv CFML_GlobalDeps_Linux.f90 CFML_GlobalDeps_Linux.xxx
mv CFML_GlobalDeps_Linux_Intel.f90 CFML_GlobalDeps_Linux_Intel.xxx
mv CFML_GlobalDeps_MacOS.f90 CFML_GlobalDeps_MacOS.xxx
mv CFML_GlobalDeps_MacOS_Intel.f90 CFML_GlobalDeps_MacOS_Intel.xxx
mv CFML_GlobalDeps_Windows_gfortran.f90 CFML_GlobalDeps_Windows_gfortran.xxx
mv CFML_GlobalDeps_Windows_Intel.f90 CFML_GlobalDeps_Windows_Intel.xxx
mv CFML_GlobalDeps_Windows_Intel64.f90 CFML_GlobalDeps_Windows_Intel64.xxx
mv CFML_HDF5.f90 CFML_HDF5.xxx
mv CFML_ILL_Instrm_Data_LF.f90 CFML_ILL_Instrm_Data_LF.xxx
mv CFML_IO_MessagesRW.f90 CFML_IO_MessagesRW.xxx
mv CFML_IO_MessagesWin.f90 CFML_IO_MessagesWin.xxx
mv CFML_String_Utilities_gf.f90 CFML_String_Utilities_gf.xxx
mv CFML_String_Utilities_LF.f90 CFML_String_Utilities_LF.xxx
mv f2kcli.f90 f2kcli.xxx
exit
fi
if [ $to_change == "f90" ]; then
echo "---- Changing the extension of *.xxx files to *.f90 to maintain compatibility with CMake"
mv CFML_Export_Vtk_LF95.xxx CFML_Export_Vtk_LF95.f90
mv CFML_FlipR_Mod.xxx CFML_FlipR_Mod.f90
mv CFML_GlobalDeps_Linux.xxx CFML_GlobalDeps_Linux.f90
mv CFML_GlobalDeps_Linux_Intel.xxx CFML_GlobalDeps_Linux_Intel.f90
mv CFML_GlobalDeps_MacOS.xxx CFML_GlobalDeps_MacOS.f90
mv CFML_GlobalDeps_MacOS_Intel.xxx CFML_GlobalDeps_MacOS_Intel.f90
mv CFML_GlobalDeps_Windows_gfortran.xxx CFML_GlobalDeps_Windows_gfortran.f90
mv CFML_GlobalDeps_Windows_Intel.xxx CFML_GlobalDeps_Windows_Intel.f90
mv CFML_GlobalDeps_Windows_Intel64.xxx CFML_GlobalDeps_Windows_Intel64.f90
mv CFML_HDF5.xxx CFML_HDF5.f90
mv CFML_ILL_Instrm_Data_LF.xxx CFML_ILL_Instrm_Data_LF.f90
mv CFML_IO_MessagesRW.xxx CFML_IO_MessagesRW.f90
mv CFML_IO_MessagesWin.xxx CFML_IO_MessagesWin.f90
mv CFML_String_Utilities_gf.xxx CFML_String_Utilities_gf.f90
mv CFML_String_Utilities_LF.xxx CFML_String_Utilities_LF.f90
mv f2kcli.xxx f2kcli.f90
exit
else
echo "---- NOTHING DONE! This script should be invoked with argument xxx or f90 !"
fi
#!/bin/bash
#
if [ -z "$1" ]; then
cat << !
Syntax : tochange.sh xxx or tochange.sh f90
or tochange.sh xxx win or tochange.sh f90 win
!
exit
fi
#
# Arguments
#
_WIN="win"
_CHANGEX="xxx"
_CHANGEF="f90"
to_change="xxx"
win="N"
for arg in "$@"
do
case "$arg" in
"xxx")
to_change=$arg
;;
"f90")
to_change=$arg
;;
"win")
win=$arg
;;
esac
done
# Space between [ and comparison are essential!
if [ $to_change == $_CHANGEX ]
then
echo "---- Changing the extension of some *.f90 files to *.xxx to maintain compatibility with FPM"
mv CFML_Export_Vtk_LF95.f90 CFML_Export_Vtk_LF95.xxx
mv CFML_FlipR_Mod.f90 CFML_FlipR_Mod.xxx
mv CFML_GlobalDeps_Linux.f90 CFML_GlobalDeps_Linux.xxx
mv CFML_GlobalDeps_Linux_Intel.f90 CFML_GlobalDeps_Linux_Intel.xxx
mv CFML_GlobalDeps_MacOS.f90 CFML_GlobalDeps_MacOS.xxx
mv CFML_GlobalDeps_MacOS_Intel.f90 CFML_GlobalDeps_MacOS_Intel.xxx
mv CFML_GlobalDeps_Windows.f90 CFML_GlobalDeps_Windows.xxx
mv CFML_GlobalDeps_Windows_Intel.f90 CFML_GlobalDeps_Windows_Intel.xxx
mv CFML_HDF5.f90 CFML_HDF5.xxx
mv CFML_ILL_Instrm_Data_LF.f90 CFML_ILL_Instrm_Data_LF.xxx
mv CFML_IO_MessagesRW.f90 CFML_IO_MessagesRW.xxx
if [ $win == $_WIN ]
then
mv CFML_IO_Messages.f90 CFML_IO_Messages.xxx
mv CFML_IO_MessagesWin.f90 CFML_IO_Messages.f90
else
mv CFML_IO_MessagesWin.f90 CFML_IO_MessagesWin.xxx
fi
mv CFML_String_Utilities_gf.f90 CFML_String_Utilities_gf.xxx
mv CFML_String_Utilities_LF.f90 CFML_String_Utilities_LF.xxx
mv f2kcli.f90 f2kcli.xxx
exit
fi
#
if [ $to_change == $_CHANGEF ]
then
echo "---- Changing the extension of *.xxx files to *.f90 to maintain compatibility with CMake"
mv CFML_Export_Vtk_LF95.xxx CFML_Export_Vtk_LF95.f90
mv CFML_FlipR_Mod.xxx CFML_FlipR_Mod.f90
mv CFML_GlobalDeps_Linux.xxx CFML_GlobalDeps_Linux.f90
mv CFML_GlobalDeps_Linux_Intel.xxx CFML_GlobalDeps_Linux_Intel.f90
mv CFML_GlobalDeps_MacOS.xxx CFML_GlobalDeps_MacOS.f90
mv CFML_GlobalDeps_MacOS_Intel.xxx CFML_GlobalDeps_MacOS_Intel.f90
mv CFML_GlobalDeps_Windows.xxx CFML_GlobalDeps_Windows.f90
mv CFML_GlobalDeps_Windows_Intel.xxx CFML_GlobalDeps_Windows_Intel.f90
mv CFML_HDF5.xxx CFML_HDF5.f90
mv CFML_ILL_Instrm_Data_LF.xxx CFML_ILL_Instrm_Data_LF.f90
mv CFML_IO_MessagesRW.xxx CFML_IO_MessagesRW.f90
if [ $win == $_WIN ]
then
mv CFML_IO_Messages.f90 CFML_IO_MessagesWin.f90
mv CFML_IO_Messages.xxx CFML_IO_Messages.f90
else
mv CFML_IO_MessagesWin.xxx CFML_IO_MessagesWin.f90
fi
mv CFML_String_Utilities_gf.xxx CFML_String_Utilities_gf.f90
mv CFML_String_Utilities_LF.xxx CFML_String_Utilities_LF.f90
mv f2kcli.xxx f2kcli.f90
exit
else
echo "---- NOTHING DONE! This script should be invoked with argument xxx or f90 and optionally a second argument win!"
fi
......@@ -27,6 +27,16 @@ rem > Arguments ----
shift
if not [%1]==[] goto LOOP
rem .
rem Select the proper fpm.toml file depending on win
rem .
if [%_WINT%]==[win] (
echo Copying .\toml\fpm_windows_win.toml to fpm.toml
copy .\toml\fpm_windows_win.toml fpm.toml
) else (
echo Copying .\toml\fpm_windows_con.toml to fpm.toml
copy .\toml\fpm_windows_con.toml fpm.toml
)
)
rem First change the extensions of files that are optionally used in fpm to "xxx" by
rem invoking the tochange.bat script in the Src directory.
cd .\Src
......@@ -44,9 +54,9 @@ cd ..
cd ..
if [%_WINT%]==[win] (
if [%_DEBUG%]==[Y] (
fpm @./rsp/ifort_debug_win
fpm @./rsp/ifort_win_debug_win
) else (
fpm @./rsp/ifort_release_win
fpm @./rsp/ifort_win_release_win
)
) else (
if [%_DEBUG%]==[Y] (
......
#!/bin/bash
#
#
# Attempt to create a unified build method for CrysFML using fmp
#
echo "---- Construction of the CrysFML library for 64 bits using gfortran, ifort or ifx (oneAPI) ---- "
echo "---- The building procedure installs also some executable programs of the Program_Examples subdirectory"
echo " Default: ifort compiler in release mode. Equivalent to the first example below"
echo " Examples of using the script:"
echo " make_CrysFML_fpm.sh ifort"
echo " make_CrysFML_fpm.sh ifort debug"
echo " make_CrysFML_fpm.sh gfortran"
echo " make_CrysFML_fpm.sh gfortran debug"
echo " make_CrysFML_fpm.sh ifx"
echo " make_CrysFML_fpm.sh ifx debug"
echo " For using the Winteracter library add the word "win" as the last argument (without quotes)"
echo "----"
if [ -z "$1" ]; then
cat << !
Syntax : make_CrysFML_fpm.sh compiler or make_CrysFML_fpm.sh compiler debug
or make_CrysFML_fpm.sh compiler win or make_CrysFML_fpm.sh compiler debug win
!
exit
fi
#
# Default values for Arguments
#
COMP=""
DEBUG="N"
CONS="Y"
WINT="N"
#
for arg in "$@"
do
case "$arg" in
"ifort")
COMP=$arg
;;
"ifx")
COMP=$arg
;;
"gfortran")
COMP=$arg
;;
"debug")
DEBUG="Y"
;;
"win")
WINT=$arg
;;
esac
done
#
# Select the proper fpm.toml file depending on win
#
if [ $WINT == "win" ]; then
echo "Copying ./toml/fpm_linmac_win.toml to ./fpm.toml"
cp ./toml/fpm_linmac_win.toml ./fpm.toml
else
echo "Copying ./toml/fpm_linmac_con.toml to ./fpm.toml"
cp ./toml/fpm_linmac_con.toml ./fpm.toml
fi
#
# First change the extensions of files that are optionally used in fpm to "xxx" by
# invoking the tochange.bat script in the Src directory.
#
cd ./Src
if [ $WINT == "win" ]; then
tochange.sh xxx win
else
tochange.sh xxx
fi
cd ..
#
# Block if-then-else for compiler "ifort"
#
#
if [ $COMP == "ifort" ]; then
cd ./Src
mv CFML_GlobalDeps_Linux_Intel.xxx CFML_GlobalDeps.f90
cd ..
if [ $WINT == "win" ]; then # Winteracter mode (dependency different for all OS)
if [ $DEBUG == "Y" ];then
fpm @./rsp/ifort_lin_debug_win