diff --git a/HySoP/CMakeLists.txt b/HySoP/CMakeLists.txt index 5753b09376a98f4ff3cfd1ae41511813272b6ef1..5f606dbfdb77762d9dc290169dd3c69a0cf06437 100644 --- a/HySoP/CMakeLists.txt +++ b/HySoP/CMakeLists.txt @@ -34,6 +34,7 @@ option(WITH_PPM "link Parmes with PPM library (core component). Default = off." option(WITH_PPMNumerics "link Parmes with PPM-numerics. Default = off" OFF) option(WITH_TESTS "Enable testing. Default = off" OFF) option(BUILD_SHARED_LIBS "Enable dynamic library build, default = ON" ON) +option(WITH_FFTW "Link with fftw library (required for some Parmes solvers), default = ON" ON) # cmake project name set(PROJECT_NAME parmepy) @@ -83,6 +84,7 @@ set(CMAKE_INSTALL_PREFIX ${${PROJECT_NAME}_INSTALL_DIR}) # The file __init__.py will be generated from __init__.py.in. if(EXISTS ${CMAKE_SOURCE_DIR}/parmepy/__init__.py.in) message(STATUS "Generate __init__.py file ...") + file(REMOVE ${CMAKE_SOURCE_DIR}/parmepy/__init__.py) configure_file(parmepy/__init__.py.in ${CMAKE_SOURCE_DIR}/parmepy/__init__.py) endif() @@ -124,6 +126,7 @@ if(VERBOSE_MODE) message(STATUS " Sources are in : ${CMAKE_SOURCE_DIR}") message(STATUS " Project uses MPI : ${USE_MPI}") message(STATUS " Project uses Scales : ${WITH_SCALES}") + message(STATUS " Project uses FFTW : ${WITH_FFTW}") message(STATUS " Project uses PPM : ${WITH_PPM}") message(STATUS " Python packages will be installed in ${${PROJECT_NAME}_INSTALL_DIR}") message(STATUS "====================== ======= ======================") diff --git a/HySoP/hysop/__init__.py.in b/HySoP/hysop/__init__.py.in index c190e9bb712ee9f8ad742dd996ad7ea11a5ddc68..86afe6a3364af12134db3647ff06a645bb1c7e73 100755 --- a/HySoP/hysop/__init__.py.in +++ b/HySoP/hysop/__init__.py.in @@ -11,7 +11,10 @@ import os import site import mpi4py.MPI as MPI -os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']+':'+"@CMAKE_INSTALL_PREFIX@" +if(os.environ.has_key('LD_LIBRARY_PATH')): + os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']+':'+"@CMAKE_INSTALL_PREFIX@" +else: + os.environ['LD_LIBRARY_PATH'] = "@CMAKE_INSTALL_PREFIX@" rank_world = MPI.COMM_WORLD.Get_rank() if(rank_world == 0): diff --git a/HySoP/hysop/Operator/Advection.py b/HySoP/hysop/operator/Advection.py similarity index 100% rename from HySoP/hysop/Operator/Advection.py rename to HySoP/hysop/operator/Advection.py diff --git a/HySoP/hysop/Operator/AdvectionDOp.py b/HySoP/hysop/operator/AdvectionDOp.py similarity index 100% rename from HySoP/hysop/Operator/AdvectionDOp.py rename to HySoP/hysop/operator/AdvectionDOp.py diff --git a/HySoP/hysop/Operator/ContinuousOperator.py b/HySoP/hysop/operator/ContinuousOperator.py similarity index 100% rename from HySoP/hysop/Operator/ContinuousOperator.py rename to HySoP/hysop/operator/ContinuousOperator.py diff --git a/HySoP/hysop/Operator/DiscreteOperator.py b/HySoP/hysop/operator/DiscreteOperator.py similarity index 100% rename from HySoP/hysop/Operator/DiscreteOperator.py rename to HySoP/hysop/operator/DiscreteOperator.py diff --git a/HySoP/hysop/Operator/InterpolationDOp.py b/HySoP/hysop/operator/InterpolationDOp.py similarity index 100% rename from HySoP/hysop/Operator/InterpolationDOp.py rename to HySoP/hysop/operator/InterpolationDOp.py diff --git a/HySoP/hysop/Operator/RemeshingDOp.py b/HySoP/hysop/operator/RemeshingDOp.py similarity index 100% rename from HySoP/hysop/Operator/RemeshingDOp.py rename to HySoP/hysop/operator/RemeshingDOp.py diff --git a/HySoP/hysop/Operator/TagDOp.py b/HySoP/hysop/operator/TagDOp.py similarity index 100% rename from HySoP/hysop/Operator/TagDOp.py rename to HySoP/hysop/operator/TagDOp.py diff --git a/HySoP/hysop/Operator/VelocityDOp.py b/HySoP/hysop/operator/VelocityDOp.py similarity index 100% rename from HySoP/hysop/Operator/VelocityDOp.py rename to HySoP/hysop/operator/VelocityDOp.py diff --git a/HySoP/hysop/Operator/VelocityOp.py b/HySoP/hysop/operator/VelocityOp.py similarity index 100% rename from HySoP/hysop/Operator/VelocityOp.py rename to HySoP/hysop/operator/VelocityOp.py diff --git a/HySoP/hysop/Operator/VolumeDOp.py b/HySoP/hysop/operator/VolumeDOp.py similarity index 100% rename from HySoP/hysop/Operator/VolumeDOp.py rename to HySoP/hysop/operator/VolumeDOp.py diff --git a/HySoP/hysop/Operator/__init__.py b/HySoP/hysop/operator/__init__.py similarity index 100% rename from HySoP/hysop/Operator/__init__.py rename to HySoP/hysop/operator/__init__.py diff --git a/HySoP/hysop/Problem/ContinuousProblem.py b/HySoP/hysop/problem/ContinuousProblem.py similarity index 100% rename from HySoP/hysop/Problem/ContinuousProblem.py rename to HySoP/hysop/problem/ContinuousProblem.py diff --git a/HySoP/hysop/Problem/ContinuousTransportProblem.py b/HySoP/hysop/problem/ContinuousTransportProblem.py similarity index 100% rename from HySoP/hysop/Problem/ContinuousTransportProblem.py rename to HySoP/hysop/problem/ContinuousTransportProblem.py diff --git a/HySoP/hysop/Problem/DiscreteProblem.py b/HySoP/hysop/problem/DiscreteProblem.py similarity index 100% rename from HySoP/hysop/Problem/DiscreteProblem.py rename to HySoP/hysop/problem/DiscreteProblem.py diff --git a/HySoP/hysop/Problem/DiscreteTransportProblem.py b/HySoP/hysop/problem/DiscreteTransportProblem.py similarity index 100% rename from HySoP/hysop/Problem/DiscreteTransportProblem.py rename to HySoP/hysop/problem/DiscreteTransportProblem.py diff --git a/HySoP/hysop/Problem/__init__.py b/HySoP/hysop/problem/__init__.py similarity index 100% rename from HySoP/hysop/Problem/__init__.py rename to HySoP/hysop/problem/__init__.py diff --git a/HySoP/hysop/Utils/ForwardEuler.py b/HySoP/hysop/utils/ForwardEuler.py similarity index 100% rename from HySoP/hysop/Utils/ForwardEuler.py rename to HySoP/hysop/utils/ForwardEuler.py diff --git a/HySoP/hysop/Utils/GPUParticularSolver.py b/HySoP/hysop/utils/GPUParticularSolver.py similarity index 100% rename from HySoP/hysop/Utils/GPUParticularSolver.py rename to HySoP/hysop/utils/GPUParticularSolver.py diff --git a/HySoP/hysop/Utils/GPUParticularSolver_GLRender.py b/HySoP/hysop/utils/GPUParticularSolver_GLRender.py similarity index 100% rename from HySoP/hysop/Utils/GPUParticularSolver_GLRender.py rename to HySoP/hysop/utils/GPUParticularSolver_GLRender.py diff --git a/HySoP/hysop/Utils/InterpolationMethod.py b/HySoP/hysop/utils/InterpolationMethod.py similarity index 100% rename from HySoP/hysop/Utils/InterpolationMethod.py rename to HySoP/hysop/utils/InterpolationMethod.py diff --git a/HySoP/hysop/Utils/Lambda1.py b/HySoP/hysop/utils/Lambda1.py similarity index 100% rename from HySoP/hysop/Utils/Lambda1.py rename to HySoP/hysop/utils/Lambda1.py diff --git a/HySoP/hysop/Utils/Lambda2.py b/HySoP/hysop/utils/Lambda2.py similarity index 100% rename from HySoP/hysop/Utils/Lambda2.py rename to HySoP/hysop/utils/Lambda2.py diff --git a/HySoP/hysop/Utils/Linear.py b/HySoP/hysop/utils/Linear.py similarity index 100% rename from HySoP/hysop/Utils/Linear.py rename to HySoP/hysop/utils/Linear.py diff --git a/HySoP/hysop/Utils/M4Prime.py b/HySoP/hysop/utils/M4Prime.py similarity index 100% rename from HySoP/hysop/Utils/M4Prime.py rename to HySoP/hysop/utils/M4Prime.py diff --git a/HySoP/hysop/Utils/M6Prime.py b/HySoP/hysop/utils/M6Prime.py similarity index 100% rename from HySoP/hysop/Utils/M6Prime.py rename to HySoP/hysop/utils/M6Prime.py diff --git a/HySoP/hysop/Utils/ODESolver.py b/HySoP/hysop/utils/ODESolver.py similarity index 100% rename from HySoP/hysop/Utils/ODESolver.py rename to HySoP/hysop/utils/ODESolver.py diff --git a/HySoP/hysop/Utils/ParticularSolver.py b/HySoP/hysop/utils/ParticularSolver.py similarity index 100% rename from HySoP/hysop/Utils/ParticularSolver.py rename to HySoP/hysop/utils/ParticularSolver.py diff --git a/HySoP/hysop/Utils/Printer.py b/HySoP/hysop/utils/Printer.py similarity index 100% rename from HySoP/hysop/Utils/Printer.py rename to HySoP/hysop/utils/Printer.py diff --git a/HySoP/hysop/Utils/PrinterVTK.py b/HySoP/hysop/utils/PrinterVTK.py similarity index 100% rename from HySoP/hysop/Utils/PrinterVTK.py rename to HySoP/hysop/utils/PrinterVTK.py diff --git a/HySoP/hysop/Utils/RK2.py b/HySoP/hysop/utils/RK2.py similarity index 100% rename from HySoP/hysop/Utils/RK2.py rename to HySoP/hysop/utils/RK2.py diff --git a/HySoP/hysop/Utils/RemeshingMethod.py b/HySoP/hysop/utils/RemeshingMethod.py similarity index 100% rename from HySoP/hysop/Utils/RemeshingMethod.py rename to HySoP/hysop/utils/RemeshingMethod.py diff --git a/HySoP/hysop/Utils/Solver.py b/HySoP/hysop/utils/Solver.py similarity index 100% rename from HySoP/hysop/Utils/Solver.py rename to HySoP/hysop/utils/Solver.py diff --git a/HySoP/hysop/Utils/__init__.py b/HySoP/hysop/utils/__init__.py similarity index 100% rename from HySoP/hysop/Utils/__init__.py rename to HySoP/hysop/utils/__init__.py diff --git a/HySoP/hysop/Utils/gpu_src.cl b/HySoP/hysop/utils/gpu_src.cl similarity index 100% rename from HySoP/hysop/Utils/gpu_src.cl rename to HySoP/hysop/utils/gpu_src.cl diff --git a/HySoP/setup.py.in b/HySoP/setup.py.in index 9720cc48ff40850f0b8536180d8478d69ddb3a3d..257fc238fafaacfb6d061f9df1a586380c502f58 100644 --- a/HySoP/setup.py.in +++ b/HySoP/setup.py.in @@ -13,7 +13,10 @@ import sys # Full package name name = '@PYPACKAGE_NAME@' # List of modules (directories) to be included -packages = ['parmepy','parmepy.domain','parmepy.fields'] +packages = ['parmepy', + 'parmepy.domain', + 'parmepy.fields', + 'parmepy.operator'] # 'examples'] # 'new_ParMePy', # 'new_ParMePy/Domain', @@ -25,35 +28,28 @@ packages = ['parmepy','parmepy.domain','parmepy.fields'] # Enable this to get debug info # DISTUTILS_DEBUG=1 -fortran_src = glob.glob('@CMAKE_SOURCE_DIR@/parmepy/parmesfftw2py/*.f90') parmes_dir=['@CMAKE_BINARY_DIR@/Modules'] parmes_libdir=['@CMAKE_BINARY_DIR@/src'] parmeslib=['@PARMES_LIBRARY_NAME@'] -#f2py_options=['-DF2PY_REPORT_ON_ARRAY_COPY'] f2py_options=['--no-lower'] -define_macros = [('F2PY_REPORT_ON_ARRAY_COPY','1')], -sys.path.extend('config_fc -DF2PY_REPORT_ON_ARRAY_COPY'.split()) -#,f2py_options=['-c --f90exec=/Users/Franck/Softs/install-gnu/openmpi-1.5.3/bin/mpif90']) -#f2py_options=['skip: discretisation_init :'] -# Example with include and link : -#include_mpi='/Users/Franck/Softs/install-gnu/openmpi-1.5.3/lib/' -#fortran_dir='./ParMePy/scales2py' -#legi_dir =os.path.join(fortran_dir,'srcLegi') -#legi_lib = [os.path.join(fortran_dir,'.')] -#print legi_lib -#parpyModule=Extension(name='ParMePy.scales2py',sources=fortran_src,include_dirs=[legi_dir],library_dirs=legi_lib,libraries=['parmeslegi']) -#parpyModule=Extension(name='parpy',sources=fortran_src)#,f2py_options=f2py_options) -parpyModule=Extension(name='parmepy.fftw2py',f2py_options=f2py_options,sources=fortran_src,include_dirs=parmes_dir, - library_dirs=parmes_libdir,libraries=parmeslib,define_macros = [('F2PY_REPORT_ON_ARRAY_COPY','1')]) + scales_src = glob.glob('@CMAKE_SOURCE_DIR@/parmepy/scales2py/*.f90') scalesModule=Extension(name='parmepy.scales2py',f2py_options=f2py_options,sources=scales_src,include_dirs=parmes_dir, library_dirs=parmes_libdir,libraries=parmeslib,define_macros = [('F2PY_REPORT_ON_ARRAY_COPY','1')]) -#ppm_lib_dir=[os.path.join(ppm_dir,'lib')] -#ppm_lib=['ppm_core'] -#pyParMesModule=Extension(name=name,sources=f2py_sources,include_dirs=[include_mpi],library_dirs=ppm_lib_dir,libraries=ppm_lib) +ext_modules = [scalesModule] + +withfftw = "@WITH_FFTW@" +if(withfftw is "ON"): + fortran_src = glob.glob('@CMAKE_SOURCE_DIR@/parmepy/parmesfftw2py/*.f90') + # sys.path.extend('config_fc -DF2PY_REPORT_ON_ARRAY_COPY'.split()) + parpyModule=Extension(name='parmepy.fftw2py',f2py_options=f2py_options,sources=fortran_src,include_dirs=parmes_dir, + library_dirs=parmes_libdir,libraries=parmeslib,define_macros = [('F2PY_REPORT_ON_ARRAY_COPY','1')]) + ext_modules = ext_modules.append(parpyModule) + +print ext_modules setup(name=name, version='1.0.0', description='Particular Methods implementation in Python', @@ -62,7 +58,7 @@ setup(name=name, url='https://forge.imag.fr/projects/parmes/', license='GNU public license', package_dir = {'': '@CMAKE_SOURCE_DIR@'}, - ext_modules=[parpyModule,scalesModule], + ext_modules=ext_modules, packages=packages #data_files=[('new_ParMePy/Utils', ['./new_ParMePy/Utils/gpu_src.cl'])] ) diff --git a/HySoP/src/CMakeLists.txt b/HySoP/src/CMakeLists.txt index 5e156859a913078636485bcfc469aa9d32268014..f3cc96debddfb63153103a2ec81f8499ed716c52 100644 --- a/HySoP/src/CMakeLists.txt +++ b/HySoP/src/CMakeLists.txt @@ -91,10 +91,11 @@ if(WITH_PPM) add_subdirectory(ppmInterface) endif() -find_package(FFTW REQUIRED) -include_directories(${FFTW_INCLUDE_DIRS}) -set(LIBS ${LIBS} ${FFTW_LIBRARIES}) -display(FFTW_LIBRARIES) +if(WITH_FFTW) + find_package(FFTW REQUIRED) + include_directories(${FFTW_INCLUDE_DIRS}) + set(LIBS ${LIBS} ${FFTW_LIBRARIES}) +endif() # ============= Generates ParmesConfig.hpp ============= # The file PARMES_LIBRARY_NAME_defines.hpp will be generated from config.hpp.cmake; diff --git a/HySoP/src/Unstable/LEGI/CMake b/HySoP/src/Unstable/LEGI/CMake deleted file mode 120000 index f988a93ec0bce63f1ad062b763a2d48f9f6a56e4..0000000000000000000000000000000000000000 --- a/HySoP/src/Unstable/LEGI/CMake +++ /dev/null @@ -1 +0,0 @@ -../../../CMake \ No newline at end of file diff --git a/HySoP/src/scalesInterface/CMakeLists.txt b/HySoP/src/scalesInterface/CMakeLists.txt deleted file mode 100644 index a9055cc9eb2cf65a8b071aaa40275d192a5ae83e..0000000000000000000000000000000000000000 --- a/HySoP/src/scalesInterface/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -#======================================================= -# parmesscales library compilation/link process -# -# F. Pérignon, june 2012 -# -#======================================================= - -# cmake project name -set(SUBPROJECT_NAME parmesscales) -# --- Name for the package --- -# This name will be used to install parmeslegi (library, headers, ...) and when another lib or soft will need to search for parmeslegi. -set(SUBPROJECTPACKAGE_NAME "parmesscales") -# --- Set a version number for the package --- -set(${SUBPROJECTPACKAGENAME}_version 1.0.0) -# --- The name (without extension) of the lib to be created --- -set(SUBPROJECT_LIBRARY_NAME ${SUBPROJECT_NAME}) - -# Any files in these dirs will be used to create parmeslegi exec (linked with libparmes) -set(${SUBPROJECT_LIBRARY_NAME}_SRCDIRS - . - layout - particles - output - ) - -# Matching expr for files to be compiled. -set(EXTS *.f90) -# Matching expr for headers (install purpose) -set(EXTS_HDRS *.hpp *.h) - -#set(${SUBPROJECTEXE_NAME}_SRCDIRS test/ test/src/ test/src/Test_advec -# test/src/Test_io test/src/Test_topo) - -set(${SUBPROJECT_NAME}_LINK_FLAGS ${${SUBPROJECT_NAME}_LINK_FLAGS} ${MPI_Fortran_LINK_FLAGS}) -set(SUBPROJECTLIBS ${LIBS}) - -# ============= Source and header files list ============= -# We scan all files with matching extension in directories -# containing sources. -# Source files list: -foreach(_DIR ${${SUBPROJECT_LIBRARY_NAME}_SRCDIRS}) - set(_DIR_FILES) - foreach(_EXT ${EXTS}) # Source files - file(GLOB _DIR_FILES_EXT ${_DIR}/${_EXT}) - if(_DIR_FILES_EXT) - list(APPEND ${SUBPROJECT_LIBRARY_NAME}_SRC ${_DIR_FILES_EXT}) - endif() - endforeach() -endforeach() - -# We add headers to source files -list(APPEND ${SUBPROJECT_LIBRARY_NAME}_SRC ${${SUBPROJECT_LIBRARY_NAME}_HDRS}) - -# Add directories to those searched by compiler ... -# -I -include_directories(${${SUBPROJECT_LIBRARY_NAME}_SRCDIRS}) - -# ============= Creates the library ============= -if(BUILD_SHARED_LIBS) # shared library - add_library(${SUBPROJECT_LIBRARY_NAME} SHARED ${${SUBPROJECT_LIBRARY_NAME}_SRC}) -else() # static library - add_library(${SUBPROJECT_LIBRARY_NAME} STATIC ${${SUBPROJECT_LIBRARY_NAME}_SRC}) -endif() -# Libs to link with PROJECT__LIBRARY_NAME -target_link_libraries(${SUBPROJECT_LIBRARY_NAME} ${SUBPROJECTLIB}) - -# ============= Prepare install ============= - -# The library -# The library, the headers and mod files, the cmake generated files -# will be install in CMAKE_INSTALL_PREFIX/lib include and share -#include(InstallPackage) - -#install_package(${SUBPROJECTPACKAGENAME} ${SUBPROJECT_LIBRARY_NAME} ${${SUBPROJECT_NAME}_HDRS}) - -#install(TARGETS ${SUBPROJECTEXE_NAME} -#RUNTIME DESTINATION bin # executables -# )