Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Commits
2044895a
Commit
2044895a
authored
5 years ago
by
Jean-Baptiste Keck
Browse files
Options
Downloads
Patches
Plain Diff
many fixes in FindFFTW.cmake for static linking, changed WITH_GPU cmake variable to WITH_OPENCL.
parent
f6aa2d8e
No related branches found
No related tags found
1 merge request
!16
MPI operators
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+7
-8
7 additions, 8 deletions
CMakeLists.txt
cmake/FindFFTW.cmake
+30
-16
30 additions, 16 deletions
cmake/FindFFTW.cmake
setup.py.in
+2
-2
2 additions, 2 deletions
setup.py.in
with
39 additions
and
26 deletions
CMakeLists.txt
+
7
−
8
View file @
2044895a
...
@@ -39,7 +39,7 @@ option(WITH_SCALES "compile/create scales lib and link it with HySoP. Default =
...
@@ -39,7 +39,7 @@ option(WITH_SCALES "compile/create scales lib and link it with HySoP. Default =
option
(
WITH_PARALLEL_COMPRESSED_HDF5
"Try to enable parallel compressed hdf5 interface. Default = ON."
ON
)
option
(
WITH_PARALLEL_COMPRESSED_HDF5
"Try to enable parallel compressed hdf5 interface. Default = ON."
ON
)
option
(
WITH_FFTW
"Link with fftw library (required for some HySoP solvers), default = ON"
ON
)
option
(
WITH_FFTW
"Link with fftw library (required for some HySoP solvers), default = ON"
ON
)
option
(
WITH_EXTRAS
"Link with some extra fortran libraries (like arnoldi solver), default = OFF"
OFF
)
option
(
WITH_EXTRAS
"Link with some extra fortran libraries (like arnoldi solver), default = OFF"
OFF
)
option
(
WITH_
GPU
"Use of GPU (required for some HySoP solvers), default = ON"
ON
)
option
(
WITH_
OPENCL
"Use of GPU (required for some HySoP solvers), default = ON"
ON
)
option
(
WITH_MAIN_FORTRAN
"Create an executable (test purpose) from fortran sources in src/main, linked with libhysop, default = OFF"
OFF
)
option
(
WITH_MAIN_FORTRAN
"Create an executable (test purpose) from fortran sources in src/main, linked with libhysop, default = OFF"
OFF
)
option
(
WITH_MAIN_CXX
"Create an executable (test purpose) from cxx sources in src/hysop++/main, linked with libhysop, default = OFF"
OFF
)
option
(
WITH_MAIN_CXX
"Create an executable (test purpose) from cxx sources in src/hysop++/main, linked with libhysop, default = OFF"
OFF
)
option
(
PROFILE
"Enable profiling mode for HySoP. Can also be enabled with HYSOP_PROFILE environment variable. Default = OFF"
OFF
)
option
(
PROFILE
"Enable profiling mode for HySoP. Can also be enabled with HYSOP_PROFILE environment variable. Default = OFF"
OFF
)
...
@@ -187,9 +187,8 @@ endif()
...
@@ -187,9 +187,8 @@ endif()
# --- FFTW ---
# --- FFTW ---
if
(
WITH_FFTW
)
if
(
WITH_FFTW
)
set
(
FIND_FFTW_VERBOSE OFF
)
set
(
FIND_FFTW_VERBOSE CACHE BOOL OFF
)
set
(
FIND_FFTW_DEBUG OFF
)
set
(
FIND_FFTW_DEBUG CACHE BOOL OFF
)
set
(
FIND_FFTW_SHARED_ONLY ON
)
compile_with
(
FFTW
compile_with
(
FFTW
REQUIRED COMPONENTS Fftw3f Fftw3d
REQUIRED COMPONENTS Fftw3f Fftw3d
Fftw3f-mpi Fftw3d-mpi
Fftw3f-mpi Fftw3d-mpi
...
@@ -249,7 +248,7 @@ else()
...
@@ -249,7 +248,7 @@ else()
endif
()
endif
()
# ========= Check which opencl devices are available on the system =========
# ========= Check which opencl devices are available on the system =========
if
(
WITH_
GPU
)
if
(
WITH_
OPENCL
)
execute_process
(
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_SOURCE_DIR
}
/opencl_explore.py
"EXPLORE"
)
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_SOURCE_DIR
}
/opencl_explore.py
"EXPLORE"
)
execute_process
(
execute_process
(
...
@@ -645,15 +644,15 @@ if(VERBOSE_MODE)
...
@@ -645,15 +644,15 @@ if(VERBOSE_MODE)
message
(
STATUS
" Project uses MPI :
${
USE_MPI
}
"
)
message
(
STATUS
" Project uses MPI :
${
USE_MPI
}
"
)
message
(
STATUS
" Project uses Scales :
${
WITH_SCALES
}
"
)
message
(
STATUS
" Project uses Scales :
${
WITH_SCALES
}
"
)
message
(
STATUS
" Project uses FFTW :
${
WITH_FFTW
}
"
)
message
(
STATUS
" Project uses FFTW :
${
WITH_FFTW
}
"
)
message
(
STATUS
" Project uses
GPU
:
${
WITH_
GPU
}
"
)
message
(
STATUS
" Project uses
OpenCL
:
${
WITH_
OPENCL
}
"
)
message
(
STATUS
" Project uses parallel
hdf
5 interface :
${
H5PY_PARALLEL_COMPRESSION_ENABLED
}
"
)
message
(
STATUS
" Project uses parallel
HDF
5 interface :
${
H5PY_PARALLEL_COMPRESSION_ENABLED
}
"
)
message
(
STATUS
"
${
PROJECT_NAME
}
profile mode :
${
PROFILE
}
"
)
message
(
STATUS
"
${
PROJECT_NAME
}
profile mode :
${
PROFILE
}
"
)
message
(
STATUS
"
${
PROJECT_NAME
}
debug mode :
${
DEBUG
}
"
)
message
(
STATUS
"
${
PROJECT_NAME
}
debug mode :
${
DEBUG
}
"
)
message
(
STATUS
" Enable -OO run? :
${
OPTIM
}
"
)
message
(
STATUS
" Enable -OO run? :
${
OPTIM
}
"
)
if
(
DOUBLEPREC
)
if
(
DOUBLEPREC
)
message
(
STATUS
" Default real numbers precision : double."
)
message
(
STATUS
" Default real numbers precision : double."
)
else
()
else
()
message
(
STATUS
" Default real numbers precision : si
mp
le."
)
message
(
STATUS
" Default real numbers precision : si
ng
le."
)
endif
()
endif
()
message
(
STATUS
"====================== ======= ======================"
)
message
(
STATUS
"====================== ======= ======================"
)
message
(
STATUS
" "
)
message
(
STATUS
" "
)
...
...
This diff is collapsed.
Click to expand it.
cmake/FindFFTW.cmake
+
30
−
16
View file @
2044895a
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
# Set ${FIND_FFTW_DEBUG} to ON before find_package call to enable debug mode
# Set ${FIND_FFTW_DEBUG} to ON before find_package call to enable debug mode
#
#
# Written by F. Pérignon, nov/2009
# Written by F. Pérignon, nov/2009
# Updated by J-B. Keck, feb/2016
# Updated by J-B. Keck, feb/2016
, march/2020
# inspired from http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
# inspired from http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
find_package
(
PkgConfig
)
find_package
(
PkgConfig
)
...
@@ -86,14 +86,18 @@ list(APPEND FFTW_COMPILE_FLAGS "")
...
@@ -86,14 +86,18 @@ list(APPEND FFTW_COMPILE_FLAGS "")
# -- rename library to match shared or static constraints
# -- rename library to match shared or static constraints
#Check whether to search static or dynamic libs
#Check whether to search static or dynamic libs
set
(
CMAKE_FIND_LIBRARY_SUFFIXES_SAV
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES_SAV
E
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
if
(
${
FFTW_USE_STATIC_LIBS
}
)
if
(
${
FIND_FFTW_SHARED_ONLY
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
else
()
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
elseif
(
${
FIND_FFTW_STATIC_ONLY
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
endif
()
endif
()
# -- always look for base fftw3 library
# (it contains common functions for all fftw libraries)
list
(
APPEND FFTW_FIND_COMPONENTS
"fftw3d"
)
foreach
(
fftw_comp
${
FFTW_FIND_COMPONENTS
}
)
foreach
(
fftw_comp
${
FFTW_FIND_COMPONENTS
}
)
string
(
REPLACE
"-"
"_"
fftw_comp_no_dash
"
${
fftw_comp
}
"
)
string
(
REPLACE
"-"
"_"
fftw_comp_no_dash
"
${
fftw_comp
}
"
)
string
(
TOLOWER
${
fftw_comp_no_dash
}
component
)
string
(
TOLOWER
${
fftw_comp_no_dash
}
component
)
...
@@ -112,8 +116,6 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -112,8 +116,6 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
# -- find library name given the component name
# -- find library name given the component name
string
(
REPLACE
"fftw3d"
"fftw3"
library
"
${
component
}
"
)
string
(
REPLACE
"fftw3d"
"fftw3"
library
"
${
component
}
"
)
set
(
library
"lib
${
library
}${
CMAKE_FIND_LIBRARY_SUFFIXES
}
"
)
if
(
FIND_FFTW_DEBUG
)
if
(
FIND_FFTW_DEBUG
)
message
(
"
\t
FFTW::
${
fftw_comp
}
:
${
COMPONENT
}
:
${
component
}
, LIB=
${
library
}
HEADER=
${
header
}
"
)
message
(
"
\t
FFTW::
${
fftw_comp
}
:
${
COMPONENT
}
:
${
component
}
, LIB=
${
library
}
HEADER=
${
header
}
"
)
endif
()
endif
()
...
@@ -131,7 +133,7 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -131,7 +133,7 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
find_path
(
find_path
(
${
COMPONENT
}
_INCLUDE_DIR
${
COMPONENT
}
_INCLUDE_DIR
NAMES
${
header
}
NAMES
${
header
}
PATHS
${
fftw
_DIR
}
PATHS
${
FFTW
_DIR
}
PATHS
${${
COMPONENT
}
_PKGCONF_INCLUDE_DIRS
}
PATHS
${${
COMPONENT
}
_PKGCONF_INCLUDE_DIRS
}
PATH_SUFFIXES include
PATH_SUFFIXES include
NO_DEFAULT_PATH
NO_DEFAULT_PATH
...
@@ -160,7 +162,7 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -160,7 +162,7 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
find_library
(
find_library
(
${
COMPONENT
}
_LIBRARY
${
COMPONENT
}
_LIBRARY
NAMES
${
library
}
NAMES
${
library
}
PATHS
${
fftw
_DIR
}
PATHS
${
FFTW
_DIR
}
PATHS
${${
COMPONENT
}
_INCLUDE_DIR
}
/..
PATHS
${${
COMPONENT
}
_INCLUDE_DIR
}
/..
PATHS
${${
COMPONENT
}
_PKGCONF_LIBRARY_DIRS
}
}
PATHS
${${
COMPONENT
}
_PKGCONF_LIBRARY_DIRS
}
}
PATH_SUFFIXES lib
PATH_SUFFIXES lib
...
@@ -184,7 +186,6 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -184,7 +186,6 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
set
(
LIBRARY_DIR_FOUND FALSE
)
set
(
LIBRARY_DIR_FOUND FALSE
)
else
()
else
()
get_filename_component
(
${
COMPONENT
}
_LIBRARY_DIR
"
${${
COMPONENT
}
_LIBRARY
}
"
DIRECTORY
)
get_filename_component
(
${
COMPONENT
}
_LIBRARY_DIR
"
${${
COMPONENT
}
_LIBRARY
}
"
DIRECTORY
)
#set(${COMPONENT}_LIBRARY "${library}")
set
(
LIBRARY_DIR_FOUND TRUE
)
set
(
LIBRARY_DIR_FOUND TRUE
)
endif
()
endif
()
...
@@ -223,11 +224,15 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -223,11 +224,15 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
list
(
APPEND
${
COMPONENT
}
_LIBRARIES
${${
COMPONENT
}
_LIBRARY
}
)
list
(
APPEND
${
COMPONENT
}
_LIBRARIES
${${
COMPONENT
}
_LIBRARY
}
)
list
(
APPEND
${
COMPONENT
}
_DEFINES
"-DFFTW_HAS_
${
COMPONENT
}
"
)
list
(
APPEND
${
COMPONENT
}
_DEFINES
"-DFFTW_HAS_
${
COMPONENT
}
"
)
list
(
APPEND FFTW_INCLUDE_DIRS
${${
COMPONENT
}
_INCLUDE_DIRS
}
)
if
(
"
${
COMPONENT
}
"
STREQUAL
"FFTW3D"
)
list
(
APPEND FFTW_LIBRARY_DIRS
${${
COMPONENT
}
_LIBRARY_DIRS
}
)
# will be added last (link order)
list
(
APPEND FFTW_LIBRARIES
${${
COMPONENT
}
_LIBRARIES
}
)
else
()
list
(
APPEND FFTW_DEFINES
${${
COMPONENT
}
_DEFINES
}
)
list
(
APPEND FFTW_INCLUDE_DIRS
${${
COMPONENT
}
_INCLUDE_DIRS
}
)
list
(
APPEND FFTW_COMPILE_FLAGS
${${
COMPONENT
}
_COMPILE_FLAGS
}
)
list
(
APPEND FFTW_LIBRARY_DIRS
${${
COMPONENT
}
_LIBRARY_DIRS
}
)
list
(
APPEND FFTW_LIBRARIES
${${
COMPONENT
}
_LIBRARIES
}
)
list
(
APPEND FFTW_DEFINES
${${
COMPONENT
}
_DEFINES
}
)
list
(
APPEND FFTW_COMPILE_FLAGS
${${
COMPONENT
}
_COMPILE_FLAGS
}
)
endif
()
if
(
FIND_FFTW_VERBOSE
)
if
(
FIND_FFTW_VERBOSE
)
message
(
"
\t
Found FFTW::
${
fftw_comp
}
with parameters '-I
${${
COMPONENT
}
_INCLUDE_DIR
}
-L
${${
COMPONENT
}
_LIBRARY_DIR
}
-l
${${
COMPONENT
}
_LIBRARY
}
'."
)
message
(
"
\t
Found FFTW::
${
fftw_comp
}
with parameters '-I
${${
COMPONENT
}
_INCLUDE_DIR
}
-L
${${
COMPONENT
}
_LIBRARY_DIR
}
-l
${${
COMPONENT
}
_LIBRARY
}
'."
)
...
@@ -256,12 +261,21 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
...
@@ -256,12 +261,21 @@ foreach(fftw_comp ${FFTW_FIND_COMPONENTS})
unset
(
COMPONENT
)
unset
(
COMPONENT
)
endforeach
()
endforeach
()
# Here base FFTW3 library should have been found
# and it is added last for good link order.
list
(
APPEND FFTW_INCLUDE_DIRS
${
FFTW3D_INCLUDE_DIRS
}
)
list
(
APPEND FFTW_LIBRARY_DIRS
${
FFTW3D_LIBRARY_DIRS
}
)
list
(
APPEND FFTW_LIBRARIES
${
FFTW3D_LIBRARIES
}
)
list
(
APPEND FFTW_DEFINES
${
FFTW3D_DEFINES
}
)
list
(
APPEND FFTW_COMPILE_FLAGS
${
FFTW3D_COMPILE_FLAGS
}
)
list
(
REMOVE_DUPLICATES FFTW_INCLUDE_DIRS
)
list
(
REMOVE_DUPLICATES FFTW_INCLUDE_DIRS
)
list
(
REMOVE_DUPLICATES FFTW_LIBRARY_DIRS
)
list
(
REMOVE_DUPLICATES FFTW_LIBRARY_DIRS
)
list
(
REMOVE_DUPLICATES FFTW_LIBRARIES
)
list
(
REMOVE_DUPLICATES FFTW_LIBRARIES
)
list
(
REMOVE_DUPLICATES FFTW_DEFINES
)
list
(
REMOVE_DUPLICATES FFTW_DEFINES
)
list
(
REMOVE_DUPLICATES FFTW_COMPILE_FLAGS
)
list
(
REMOVE_DUPLICATES FFTW_COMPILE_FLAGS
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_FIND_LIBRARY_SUFFIXES_SAV
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_FIND_LIBRARY_SUFFIXES_SAVE
}
)
# -- check required variables, version and set FFTW_FOUND to TRUE if ok
# -- check required variables, version and set FFTW_FOUND to TRUE if ok
find_package_handle_standard_args
(
FFTW FOUND_VAR FFTW_FOUND
find_package_handle_standard_args
(
FFTW FOUND_VAR FFTW_FOUND
...
...
This diff is collapsed.
Click to expand it.
setup.py.in
+
2
−
2
View file @
2044895a
...
@@ -238,11 +238,11 @@ def create_swig_extension(name, inc_dirs, src_dirs=None, sources=None):
...
@@ -238,11 +238,11 @@ def create_swig_extension(name, inc_dirs, src_dirs=None, sources=None):
# ------------ Set list of packages required to build the module -------------
# ------------ Set list of packages required to build the module -------------
# List of modules (directories) to be included
# List of modules (directories) to be included
with_test
=
"
@WITH_TESTS@
"
is
"
ON
"
with_test
=
"
@WITH_TESTS@
"
is
"
ON
"
with_
gpu
=
"
@WITH_
GPU
@
"
is
"
ON
"
with_
opencl
=
"
@WITH_
OPENCL
@
"
is
"
ON
"
exclude
=
[]
exclude
=
[]
if
not
with_test
:
if
not
with_test
:
exclude
.
append
(
'
*tests*
'
)
exclude
.
append
(
'
*tests*
'
)
if
not
with_
gpu
:
if
not
with_
opencl
:
exclude
.
append
(
'
*opencl*
'
)
exclude
.
append
(
'
*opencl*
'
)
packages
=
find_packages
(
exclude
=
exclude
,
where
=
"
@CMAKE_SOURCE_DIR@
"
)
packages
=
find_packages
(
exclude
=
exclude
,
where
=
"
@CMAKE_SOURCE_DIR@
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment