Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python Interface #100

Merged
merged 1 commit into from
Sep 3, 2024
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
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ LIST(APPEND ALL_FEATURES
DEBUG
MULTITHREAD
GPU
PYTHON
LOW_MEMORY_STRUCTS
Oscillator
Fitter
Expand Down Expand Up @@ -232,8 +233,6 @@ if( MaCh3_PYTHON_ENABLED )
endif()




#This is to export the target properties of MaCh3
#Anything that links to "MaCh3" will get all of these target properties
add_library(MaCh3 INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Alma9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1 && make install

# KS: Need to set them here, otherwise container using this container will not be able to find MaCh3
Expand Down
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Fedora32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1
RUN make install

Expand Down
2 changes: 1 addition & 1 deletion Doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN git checkout ${MACH3_VERSION}

RUN mkdir -p ${MACH3_INSTALL_DIR}
WORKDIR ${MACH3_INSTALL_DIR}
RUN cmake ${MACH3_WORK_DIR}
RUN cmake -DMaCh3_PYTHON_ENABLED=ON ${MACH3_WORK_DIR}
RUN make VERBOSE=1
RUN make install

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Some functionalities rely on setting `Env{MACH3}` which should point to path exp

MaCh3 can be compiled with a python interface by specifying the cmake option
```
cmake ../ MaCh3_PYTHON_ENABLED=ON
cmake ../ -DMaCh3_PYTHON_ENABLED=ON
make && make install
```
and then adding the path to the installed module to your `PYTHONPATH` environment variable:
Expand Down
1 change: 1 addition & 0 deletions cmake/Templates/MaCh3Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(DEBUG_LEVEL @DEBUG_LEVEL@)
set(MaCh3_DEBUG_ENABLED @MaCh3_DEBUG_ENABLED@)
set(MaCh3_MULTITHREAD_ENABLED @MaCh3_MULTITHREAD_ENABLED@)
set(MaCh3_GPU_ENABLED @MaCh3_GPU_ENABLED@)
set(MaCh3_PYTHON_ENABLED @MaCh3_PYTHON_ENABLED@)
set(MaCh3_MINUIT2_ENABLED @MaCh3_MINUIT2_ENABLED@)

get_filename_component(MaCh3_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
Expand Down
4 changes: 1 addition & 3 deletions plotting/plottingUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ target_link_libraries( Plotting ${ROOT_LIBRARIES} MaCh3::Manager )

## to be compiled into python module needs to be compiled as position independent library
if( MaCh3_PYTHON_ENABLED )

set_property( TARGET Plotting PROPERTY POSITION_INDEPENDENT_CODE ON )

endif()

install(TARGETS Plotting
Expand All @@ -32,4 +30,4 @@ install(TARGETS Plotting
PUBLIC_HEADER DESTINATION include/plotting
)

add_library(MaCh3::Plotting ALIAS Plotting)
add_library(MaCh3::Plotting ALIAS Plotting)
4 changes: 2 additions & 2 deletions plotting/plottingUtils/inputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ std::vector<std::string> InputManager::getTaggedValues(const std::vector<std::st
if (valTags.size() == 0) continue;

// count how many of the specified tags match the tags of the current value
int tagCount = 0;
unsigned int tagCount = 0;
for ( const std::string &tag: tags )
{
if ( std::find( valTags.begin(), valTags.end(), tag ) != valTags.end() )
Expand Down Expand Up @@ -734,4 +734,4 @@ void InputManager::fillFileData(InputFile &inputFileDef, bool printThoughts) {
}
}

} // namespace MaCh3Plotting
} // namespace MaCh3Plotting
Loading