Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ if(NOT ROOT_Minuit2_LIBRARY)
add_subdirectory("extern/Minuit2")
set_target_properties(Minuit2 PROPERTIES FOLDER extern)
set_target_properties(Math PROPERTIES FOLDER extern)
add_library(ROOT::Minuit2 ALIAS Minuit2)
endif()

# Adding simple libraries
Expand All @@ -317,6 +318,9 @@ target_include_directories(rang INTERFACE "${PROJECT_SOURCE_DIR}/extern/rang/inc
add_library(Eigen INTERFACE)
target_include_directories(Eigen INTERFACE "${PROJECT_SOURCE_DIR}/extern/Eigen/Eigen")

set(GOOFIT_ROOT_FOUND ROOT_FOUND)
set(GOOFIT_ARCH_FLAGS ARCH_FLAGS)

# Output the current GooFit version
configure_file (
"${PROJECT_SOURCE_DIR}/include/goofit/Version.h.in"
Expand Down Expand Up @@ -492,7 +496,7 @@ endif()
# This allows GOOFIT_PYTHON to be automatic
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/extern/pybind11/tools" ${CMAKE_MODULE_PATH})
find_package(PythonLibsNew)
if(PYTHONLIBS_FOUND)
if(PYTHONLIBS_FOUND AND EXISTS PYTHON_LIBRARIES)
option(GOOFIT_PYTHON "Python bindings for goofit" ON)
else()
option(GOOFIT_PYTHON "Python bindings for goofit" OFF)
Expand Down
6 changes: 5 additions & 1 deletion include/goofit/PdfBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
class TH1D;
#endif

#include <Minuit2/FunctionMinimum.h>
namespace ROOT {
namespace Minuit2 {
class FunctionMinimum;
}
}

namespace GooFit {

Expand Down
4 changes: 2 additions & 2 deletions include/goofit/Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
#define GOOFIT_DEVICE "@GOOFIT_DEVICE@"
#define GOOFIT_HOST "@GOOFIT_HOST@"

#cmakedefine01 ARCH_FLAGS
#cmakedefine01 ROOT_FOUND
#cmakedefine01 GOOFIT_ARCH_FLAGS
#cmakedefine01 GOOFIT_ROOT_FOUND

2 changes: 2 additions & 0 deletions python/goofit/PdfBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <goofit/UnbinnedDataSet.h>
#include <goofit/PdfBase.h>

#include <Minuit2/FunctionMinimum.h>

namespace py = pybind11;
using namespace GooFit;
using namespace pybind11::literals;
Expand Down
4 changes: 2 additions & 2 deletions python/goofit/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ void init_Version(py::module &m) {
m.attr("CMAKE_BUILD_TYPE") = CMAKE_BUILD_TYPE;
m.attr("GOOFIT_DEVICE") = GOOFIT_DEVICE;
m.attr("GOOFIT_HOST") = GOOFIT_HOST;
m.attr("ARCH_FLAGS") = ARCH_FLAGS;
m.attr("ROOT_FOUND") = ROOT_FOUND;
m.attr("ARCH_FLAGS") = GOOFIT_ARCH_FLAGS;
m.attr("ROOT_FOUND") = GOOFIT_ROOT_FOUND;
}
4 changes: 4 additions & 0 deletions src/goofit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ goofit_add_library(FitManager2
${PROJECT_SOURCE_DIR}/include/goofit/fitting/Params.h
)

target_link_libraries(FitManager2 ROOT::Minuit2)

goofit_add_library(Faddeeva
Faddeeva.cc
${PROJECT_SOURCE_DIR}/include/goofit/Faddeeva.h
Expand Down Expand Up @@ -59,6 +61,8 @@ goofit_add_library(PdfBase
)

target_link_libraries(PdfBase backtrace)
# Safe to use ROOT::Minuit2 even if ROOT not found
target_link_libraries(PdfBase ROOT::Minuit2)


# Note: order is important on Linux, derived classes first
Expand Down
2 changes: 2 additions & 0 deletions src/goofit/PdfBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "goofit/FitManager.h"
#include "goofit/UnbinnedDataSet.h"

#include <Minuit2/FunctionMinimum.h>

namespace GooFit {

fptype *dev_event_array;
Expand Down