Skip to content

Commit

Permalink
fix mex file missing symbol error, thanks to @ShijieYan
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Sep 8, 2023
1 parent 03e36cd commit 4829e35
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,43 +184,43 @@ if(BUILD_MEX AND Matlab_FOUND)
matlab_add_mex(
NAME mmclab
SRC mmclab.cpp
LINK_TO zmat mmc-matlab OpenCL::OpenCL
LINK_TO mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL zmat
)
else()
matlab_add_mex(
NAME mmclab
SRC mmclab.cpp
NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES
LINK_TO ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} zmat mmc-matlab OpenCL::OpenCL
LINK_TO ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL zmat
)
endif()

target_compile_definitions(mmclab PUBLIC MCX_CONTAINER MATLAB_MEX_FILE)

set_target_properties(mmclab
PROPERTIES OUTPUT_NAME ${CMAKE_SOURCE_DIR}/../mmclab/mmciii)
PROPERTIES OUTPUT_NAME ${CMAKE_SOURCE_DIR}/../mmclab/mmc)
add_dependencies(mmclab clheader)

if(BUILD_CUDA)
if(${CMAKE_VERSION} VERSION_LESS "3.24.0")
matlab_add_mex(
NAME mmclab-trinity
SRC mmclab.cpp
LINK_TO zmat mmc-cuda mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL
LINK_TO mmc-cuda mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL zmat
)
else()
matlab_add_mex(
NAME mmclab-trinity
SRC mmclab.cpp
NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES
LINK_TO ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} zmat mmc-cuda mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL
LINK_TO ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} mmc-cuda mmc-matlab OpenMP::OpenMP_CXX OpenCL::OpenCL zmat
)
endif()

target_compile_definitions(mmclab-trinity PUBLIC MCX_CONTAINER MATLAB_MEX_FILE USE_CUDA)

set_target_properties(mmclab-trinity
PROPERTIES OUTPUT_NAME ${CMAKE_SOURCE_DIR}/../mmclab/mmc-trinity)
PROPERTIES OUTPUT_NAME ${CMAKE_SOURCE_DIR}/../mmclab/mmciii)
add_dependencies(mmclab-trinity clheader)
endif()

Expand Down

0 comments on commit 4829e35

Please sign in to comment.