Commit 18aca57d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[corr1] various simplifications in view of pybind11 ()

Merging branch 'corr1'  into 'main'.

See merge request !954
parents 55d29765 742bf0dc
Pipeline #67047 failed with stage
in 9 minutes and 46 seconds
......@@ -34848,8 +34848,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "IDistribution1D_equidistantSamples", _wrap_IDistribution1D_equidistantSamples, METH_VARARGS, "\n"
"IDistribution1D_equidistantSamples(IDistribution1D self, size_t nbr_samples, double sigma_factor=0., RealLimits const & limits=RealLimits()) -> std::vector< ParameterSample,std::allocator< ParameterSample > >\n"
"std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits=RealLimits()) const\n"
"IDistribution1D_equidistantSamples(IDistribution1D self, size_t nbr_samples, double sigma_factor=0., RealLimits const & limits={}) -> std::vector< ParameterSample,std::allocator< ParameterSample > >\n"
"std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits={}) const\n"
"\n"
"Returns equidistant samples, using intrinsic parameters, weighted with probabilityDensity(). \n"
"\n"
......@@ -34862,8 +34862,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "IDistribution1D_equidistantPoints", _wrap_IDistribution1D_equidistantPoints, METH_VARARGS, "\n"
"IDistribution1D_equidistantPoints(IDistribution1D self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const =0\n"
"IDistribution1D_equidistantPoints(IDistribution1D self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const =0\n"
"\n"
"Returns equidistant interpolation points, with range computed in distribution-specific way from mean and width parameter, taking into account limits and sigma_factor. \n"
"\n"
......@@ -34935,8 +34935,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionGate_equidistantPoints", _wrap_DistributionGate_equidistantPoints, METH_VARARGS, "\n"
"DistributionGate_equidistantPoints(DistributionGate self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionGate_equidistantPoints(DistributionGate self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"Returns list of sample values. \n"
"\n"
......@@ -34997,8 +34997,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionLorentz_equidistantPoints", _wrap_DistributionLorentz_equidistantPoints, METH_VARARGS, "\n"
"DistributionLorentz_equidistantPoints(DistributionLorentz self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionLorentz::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionLorentz_equidistantPoints(DistributionLorentz self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionLorentz::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"generate list of sample values \n"
"\n"
......@@ -35059,8 +35059,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionGaussian_equidistantPoints", _wrap_DistributionGaussian_equidistantPoints, METH_VARARGS, "\n"
"DistributionGaussian_equidistantPoints(DistributionGaussian self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionGaussian::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionGaussian_equidistantPoints(DistributionGaussian self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionGaussian::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"generate list of sample values \n"
"\n"
......@@ -35125,8 +35125,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionLogNormal_equidistantPoints", _wrap_DistributionLogNormal_equidistantPoints, METH_VARARGS, "\n"
"DistributionLogNormal_equidistantPoints(DistributionLogNormal self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionLogNormal::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionLogNormal_equidistantPoints(DistributionLogNormal self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionLogNormal::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"generate list of sample values \n"
"\n"
......@@ -35187,8 +35187,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionCosine_equidistantPoints", _wrap_DistributionCosine_equidistantPoints, METH_VARARGS, "\n"
"DistributionCosine_equidistantPoints(DistributionCosine self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionCosine::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionCosine_equidistantPoints(DistributionCosine self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionCosine::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"generate list of sample values \n"
"\n"
......@@ -35259,8 +35259,8 @@ static PyMethodDef SwigMethods[] = {
"\n"
""},
{ "DistributionTrapezoid_equidistantPoints", _wrap_DistributionTrapezoid_equidistantPoints, METH_VARARGS, "\n"
"DistributionTrapezoid_equidistantPoints(DistributionTrapezoid self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t\n"
"std::vector< double > DistributionTrapezoid::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override\n"
"DistributionTrapezoid_equidistantPoints(DistributionTrapezoid self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t\n"
"std::vector< double > DistributionTrapezoid::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override\n"
"\n"
"generate list of sample values \n"
"\n"
......@@ -35,4 +35,4 @@ if(BUILD_DEBIAN)
configure_file(${CONFIGURABLES_DIR}/postinst.in ${BUILD_VAR_DIR}/postinst @ONLY)
configure_file(${CONFIGURABLES_DIR}/prerm.in ${BUILD_VAR_DIR}/prerm @ONLY)
set(CMAKE_INSTALL_RPATH \$ORIGIN/../;\$ORIGIN/../../lib/${destination_suffix})
endif(BUILD_DEBIAN)
endif()
......@@ -4,11 +4,11 @@ if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll.a .lib)
endif()
find_package(LibHeinz REQUIRED CONFIG)
find_package(LibHeinz 0.1.3 REQUIRED CONFIG)
message(STATUS "LibHeinz: found=${LibHeinz_FOUND}, include_dirs=${LibHeinz_INCLUDE_DIR}, "
"version=${LibHeinz_VERSION}")
find_package(formfactor REQUIRED CONFIG)
find_package(formfactor 0.1 REQUIRED CONFIG)
# absolute path is needed for deployment in Python wheel
get_target_property(formfactor_LIBRARIES formfactor IMPORTED_LOCATION_RELEASE)
if(NOT formfactor_LIBRARIES)
......
......@@ -87,7 +87,7 @@ set(destination_lib ${destination_root}lib/)
if(WIN32)
# on Window, the libraries must be in the same folder as the executable
set(destination_lib ${destination_bin})
endif(WIN32)
endif()
set(destination_include ${destination_root}include/${destination_suffix}/)
set(destination_share ${destination_root}share/${destination_suffix}/)
set(destination_examples ${destination_share}Examples/)
......
......@@ -50,14 +50,14 @@ function(MakeLib name lib tmpdir withPython)
# see <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847298>
set(link_flags "-Wl,--disable-new-dtags,-rpath,\$ORIGIN:\$ORIGIN/extra")
set_target_properties(${lib} PROPERTIES LINK_FLAGS ${link_flags})
endif(LINUX)
endif()
if(withPython)
SwigLib(${name} ${lib} ${tmpdir})
if(BA_PY_PACKAGE)
# add the BornAgain library to the Python wheel
add_library_to_wheel(${lib})
endif(BA_PY_PACKAGE)
endif()
endif()
install(TARGETS ${lib}
......
......@@ -12,12 +12,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(NOT DPKG_CMD)
message(STATUS "Can not find dpkg in your path, default to i386.")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif(NOT DPKG_CMD)
endif()
execute_process(COMMAND ${DPKG_CMD} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
endif()
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
......
......@@ -18,5 +18,5 @@ function(GeneratePythonDocs PYDOC_TARGET SWIG_DIR TMP_DIR)
DEPENDS ${TMP_DIR}/xml/index.xml
)
endif(CONFIGURE_PYTHON_DOCS)
endif()
endfunction()
......@@ -57,7 +57,7 @@ function(SwigLib name lib tmpdir)
set(SWIG_FLAGS_STR "${SWIG_FLAGS_STR}" CACHE INTERNAL "")
set(SWIG_DIR "${SWIG_DIR}" CACHE INTERNAL "")
endif(CONFIGURE_BINDINGS)
endif()
add_custom_target(
${lib}_python
......
......@@ -17,7 +17,7 @@ function(addPyWheel dst)
file(GLOB wheel "@BA_PY_PACKAGE_WHEEL_DIR@/*.whl" )
message("${CMAKE_CURRENT_LIST}: Python wheel '${wheel}' -> '${dst}'")
file(INSTALL "${wheel}" DESTINATION "${dst}")
endif(BA_PY_PACKAGE)
endif()
endfunction(addPyWheel)
if(LINUX)
......
......@@ -80,7 +80,7 @@ function(find_custom_python3)
endif()
list(APPEND _exportPars Python3_LIBRARY_DLL)
endif(WIN32)
endif()
if(Python3_FOUND)
foreach(pyvar IN LISTS _exportPars)
......@@ -102,7 +102,7 @@ function(find_custom_python3)
message(STATUS " Python3_LIBRARY_RELEASE: ${Python3_LIBRARY_RELEASE}")
if(WIN32)
message(STATUS " Python3_LIBRARY_DLL: ${Python3_LIBRARY_DLL}")
endif(WIN32)
endif()
message(STATUS " Python3_LIBRARY_DIRS: ${Python3_LIBRARY_DIRS}")
message(STATUS " Python3_NumPy_VERSION: ${Python3_NumPy_VERSION}")
message(STATUS " Python3_NumPy_INCLUDE_DIRS: ${Python3_NumPy_INCLUDE_DIRS}")
......
......@@ -30,7 +30,7 @@ function(make_python_wheel)
if(BA_MPI)
# TODO: Add MPI libs `MPI_CXX_LIBRARIES`?
endif()
endif(WIN32)
endif()
# make the Python wheel
if(APPLE)
......@@ -130,7 +130,7 @@ function(make_python_wheel)
BAPyWheel_init_files
BAPyWheel_extra_libs
)
endfunction(make_python_wheel)
endfunction()
function(add_library_to_wheel lib)
......@@ -150,4 +150,4 @@ function(add_library_to_wheel lib)
COMMENT "Add library ${lib} to the Python wheel..."
)
endfunction(add_library_to_wheel)
endfunction()
......@@ -5,10 +5,10 @@ include("multipython/FindCustomPython3")
if(BA_PY_PLATFORM)
message(STATUS "PyDependences: Custom Python platform path = '${BA_PY_PLATFORM}'")
find_custom_python3(PATHS "${BA_PY_PLATFORM}" VERBOSE)
else(BA_PY_PLATFORM)
else()
message(STATUS "PyDependences: Using default Python platform")
find_custom_python3(DEFAULT_PATH VERBOSE)
endif(BA_PY_PLATFORM)
endif()
set(pyversion ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
set(pydst "${destination_root}python/${pyversion}")
......@@ -47,7 +47,7 @@ if(CONFIGURE_BINDINGS)
if(CONFIGURE_PYTHON_DOCS)
find_package(Doxygen REQUIRED)
endif()
endif(CONFIGURE_BINDINGS)
endif()
if(BA_PY_PACKAGE)
# define a target to make a Python wheel
......@@ -58,4 +58,4 @@ if(BA_PY_PACKAGE)
Py3_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}"
Py3_LIBRARY_DIRS "${Python3_LIBRARY_DIRS}"
)
endif(BA_PY_PACKAGE)
endif()
Supports Markdown
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