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

Added Mac OS X build to Lib folder CMakeList.txt files. Added a CPU_MATLAB simulation engine for those that don't have IPP/FW installed and want to test-drive MRiLab. #18

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fcf1770
Modifications made to compile MRiLab on Mac OS X 64-bit High Sierra (…
drwillis Apr 23, 2018
9fdad25
Ignore output directory in commits.
drwillis Apr 23, 2018
7928498
Fixed FindIPP.cmake to be Linux and Mac compatible (for most recent I…
drwillis Apr 23, 2018
4c4ebaf
Worked on linux build for the CPU engine makefiles.
drwillis Apr 23, 2018
61f10a2
Modifications to make the Linux GPU code build off of CUDA 9.1.
drwillis Apr 23, 2018
25395c9
Modified the base makefile to build up support for Mac OS X compilation.
drwillis Apr 23, 2018
44358c0
New linux CUDA 9.1 GPU mex files.
drwillis Apr 23, 2018
648f76a
Added include_directories directive to find VTK header files for comp…
drwillis Apr 24, 2018
27acc61
Added build for Mac OS X libraries.
drwillis Apr 24, 2018
f6201ca
Added build for Mac OS X libraries.
drwillis Apr 24, 2018
8eb2462
Added build for Mac OS X libraries.
drwillis Apr 24, 2018
8fc2a0a
Added build for Mac OS X libraries.
drwillis Apr 24, 2018
d1c5d86
Added build for Mac OS X libraries.
drwillis Apr 24, 2018
eaab775
Updated FindMatlab.cmake for Mac OS X. Updated FindIPP.cmake revertin…
drwillis Apr 24, 2018
336afeb
Removed fast math flag which causes errors on Linux for GPU scan simu…
drwillis Apr 24, 2018
1b66847
MATLAB version of DoScanAtCPU for teaching.
drwillis Apr 25, 2018
7fc40c2
Ignore temporary MATLAB files.
drwillis Apr 25, 2018
2e3b320
More work on porting the CPU scan code to MATLAB.
drwillis Apr 25, 2018
13d72a4
New code for a MATLAB reference implementation of the simulator.
drwillis Apr 26, 2018
3bc4591
Further work on C++ / IPP to MATLAB back-port.
drwillis Apr 27, 2018
dd0b4a6
Compiled versions of several Mex functions for MRiLab on Mac OS X (IP…
drwillis Apr 27, 2018
56c1ec5
Refined the CMakeLists.txt files to build correctly on UNIX and APPLE…
drwillis Apr 27, 2018
b50dfb2
Refined the CMakeLists.txt files to build correctly on UNIX and APPLE…
drwillis Apr 27, 2018
887d0a9
Added MATLAB compute engine under the Parallel menu item.
drwillis Apr 27, 2018
9068880
Added the MATLAB compute simulator.
drwillis Apr 27, 2018
b8bad88
Removed temporary development files.
drwillis Apr 27, 2018
371b320
Fixed function name.
drwillis Apr 27, 2018
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Output/
*.m~
Binary file modified Lib/bin/DoCESTScanAtGPU.mexa64
Binary file not shown.
Binary file added Lib/bin/DoCalSARAtCPU.mexmaci64
Binary file not shown.
Binary file modified Lib/bin/DoGMScanAtGPU.mexa64
Binary file not shown.
Binary file added Lib/bin/DoGridding.mexmaci64
Binary file not shown.
Binary file modified Lib/bin/DoMEScanAtGPU.mexa64
Binary file not shown.
Binary file modified Lib/bin/DoMTScanAtGPU.mexa64
Binary file not shown.
Binary file added Lib/bin/DoSARAverageAtCPU.mexmaci64
Binary file not shown.
Binary file added Lib/bin/DoScanAtCPU.mexmaci64
Binary file not shown.
Binary file modified Lib/bin/DoScanAtGPU.mexa64
Binary file not shown.
1 change: 1 addition & 0 deletions Lib/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build/
36 changes: 35 additions & 1 deletion Lib/src/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
cmake_minimum_required(VERSION 2.8)
project(MRiLab)

# Ubuntu Linux (local user install)
SET(ENV{IPP_ROOT} /home.old/arwillis/intel)
SET(ENV{MATLAB_ROOT} /usr/local/bin/matlab/R2018a)
# On Mac OS X
#SET(ENV{IPP_ROOT} /opt/intel)
#SET(ENV{MATLAB_ROOT} /Applications/MATLAB_R2016b.app)

SET(CMAKE_VERBOSE_MAKEFILE ON)
#MESSAGE( STATUS "WIN32: " ${WIN32} )
#MESSAGE( STATUS "UNIX: " ${UNIX} )
#MESSAGE( STATUS "APPLE: " ${APPLE} )

if (APPLE)
SET(LLVM_DIR /usr/local/opt/llvm/share/cmake/modules/)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(MACOSX_RPATH 1)
SET(CC /usr/local/opt/llvm/bin/clang)
SET(CXX /usr/local/opt/llvm/bin/clang++)
SET(CMAKE_CXX_COMPILER g++-7)
endif(APPLE)


#set(CC gcc)
#set(CXX g++)

set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(CMAKE_SIZEOF_VOID_P 8) # use 64-bit by default
Expand All @@ -13,7 +40,14 @@ add_definitions(/DMX_COMPAT_32)
find_package(Matlab REQUIRED)
find_package(IPP)
find_package(Framewave)
find_package(OpenMP)

if (APPLE)
set(LDFLAGS -L/usr/local/opt/llvm/lib/)
find_package(LLVM)
else(APPLE)
find_package(OpenMP)
endif(APPLE)

find_package(CUDA)
find_package(VTK)
find_package(Ismrmrd)
Expand Down
50 changes: 26 additions & 24 deletions Lib/src/cmake/FindIPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ELSE( "$ENV{IPP_ROOT}" STREQUAL "" )
PATH_SUFFIXES ipp ipp/include)
INCLUDE_DIRECTORIES(${IPP_INCLUDE_DIR})


SET(IPP_LIB_PATH $ENV{IPP_ROOT}/lib/intel64/)
FIND_LIBRARY( IPP_S_LIBRARY
NAMES "ipps_l"
Expand Down Expand Up @@ -49,7 +50,7 @@ ELSE( "$ENV{IPP_ROOT}" STREQUAL "" )
INCLUDE_DIRECTORIES(${IPP_INCLUDE_DIR})

SET(IPP_LIB_PATH $ENV{IPP_ROOT}/lib)

FIND_LIBRARY( IPP_SE_LIBRARY
NAMES ippsemergedem64t
PATHS ${IPP_LIB_PATH})
Expand Down Expand Up @@ -115,49 +116,50 @@ ELSE( "$ENV{IPP_ROOT}" STREQUAL "" )
)
MESSAGE (STATUS "IPP_ROOT (IPP 7): $ENV{IPP_ROOT}")

ELSE ($ENV{IPP_ROOT} MATCHES .*composer.*) #IPP 6.X
ELSE ($ENV{IPP_ROOT} MATCHES .*composer.*) #IPP 2018 UNIX/Mac OS X

FIND_PATH(IPP_INCLUDE_DIR ipp.h
PATHS $ENV{IPP_ROOT}/include $ENV{IPP_ROOT}/../include /usr/include /usr/local/include
PATHS $ENV{IPP_ROOT}/ipp/include $ENV{IPP_ROOT}/../include /usr/include /usr/local/include
PATH_SUFFIXES ipp ipp/include)
INCLUDE_DIRECTORIES(${IPP_INCLUDE_DIR})


SET(IPP_LIB_PATH $ENV{IPP_ROOT}/lib)

FIND_LIBRARY( IPP_SE_LIBRARY
NAMES ippsemergedem64t
PATHS ${IPP_LIB_PATH})
if (APPLE)
# Mac OS X relative path to IPP libraries
SET(IPP_LIB_PATH $ENV{IPP_ROOT}/ipp/lib)
else(APPLE)
# Linux/Unix relative path to 64-bit IPP libraries
SET(IPP_LIB_PATH $ENV{IPP_ROOT}/ipp/lib/intel64)
endif(APPLE)

FIND_LIBRARY( IPP_S_LIBRARY
NAMES ippsmergedem64t_t
PATHS ${IPP_LIB_PATH})

FIND_LIBRARY( IPP_VME_LIBRARY
NAMES ippvmemergedem64t
NAMES "ipps"
PATHS ${IPP_LIB_PATH})

FIND_LIBRARY( IPP_VM_LIBRARY
NAMES ippvmmergedem64t_t
NAMES "ippvm"
PATHS ${IPP_LIB_PATH})

FIND_LIBRARY( IPP_IOMP5_LIBRARY
NAMES "iomp5"
PATHS $ENV{IPP_ROOT}/sharedlib)

FIND_LIBRARY( IPP_CORE_LIBRARY
NAMES ippcoreem64t_t
NAMES "ippcore"
PATHS ${IPP_LIB_PATH})

SET(IPP_LIBRARIES
${IPP_SE_LIBRARY}
${IPP_S_LIBRARY}
${IPP_VME_LIBRARY}
${IPP_VM_LIBRARY}
${IPP_IOMP5_LIBRARY}
${IPP_CORE_LIBRARY}
)

# iomp5 library only exists for Mac OS X
if (APPLE)
FIND_LIBRARY( IPP_IOMP5_LIBRARY
NAMES "iomp5"
PATHS $ENV{IPP_ROOT}/lib)
SET(IPP_LIBRARIES
${IPP_LIBRARIES}
${IPP_IOMP5_LIBRARY}
)
endif(APPLE)

MESSAGE (STATUS "IPP_ROOT (IPP 6): $ENV{IPP_ROOT}")
ENDIF ($ENV{IPP_ROOT} MATCHES .*composer.*)

Expand All @@ -170,4 +172,4 @@ IF(IPP_INCLUDE_DIR AND IPP_LIBRARIES)
ENDIF(IPP_INCLUDE_DIR AND IPP_LIBRARIES)

INCLUDE( "FindPackageHandleStandardArgs" )
FIND_PACKAGE_HANDLE_STANDARD_ARGS("IPP" DEFAULT_MSG IPP_LIBRARIES IPP_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS("IPP" DEFAULT_MSG IPP_LIBRARIES IPP_INCLUDE_DIR)
8 changes: 5 additions & 3 deletions Lib/src/cmake/FindMatlab.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ ELSE("$ENV{MATLAB_ROOT}" STREQUAL "" )
FIND_LIBRARY( MATLAB_MEX_LIBRARY
NAMES libmex mex
PATHS $ENV{MATLAB_ROOT}/bin $ENV{MATLAB_ROOT}/extern/lib
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft)
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft maci64 maci
NO_DEFAULT_PATH)

FIND_LIBRARY( MATLAB_MX_LIBRARY
NAMES libmx mx
PATHS $ENV{MATLAB_ROOT}/bin $ENV{MATLAB_ROOT}/extern/lib
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft)
PATHS $ENV{MATLAB_ROOT}/bin $ENV{MATLAB_ROOT}/extern/lib
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft maci64 maci
NO_DEFAULT_PATH)

MESSAGE (STATUS "MATLAB_ROOT: $ENV{MATLAB_ROOT}")

Expand Down
Empty file modified Lib/src/engine/CMakeLists.txt
100644 → 100755
Empty file.
10 changes: 8 additions & 2 deletions Lib/src/engine/CPUEngine/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR} ${IPP_INCLUDE_DIR} ${FW_INCLUDE_DIR})

SET(CPP_FILES DoScanAtCPU DoCalSARAtCPU)

SET(OpenMP_CXX_FLAGS -fopenmp)
foreach(CPP_FILE ${CPP_FILES})
SET(CPP_FILE_NAME ${CPP_FILE}.cpp)
add_library(${CPP_FILE} SHARED ${CPP_FILE_NAME} ${CMAKE_SOURCE_DIR}/Matlabdef.def)
Expand All @@ -14,12 +14,18 @@ foreach(CPP_FILE ${CPP_FILES})
else(CMAKE_CL_64)
SET_TARGET_PROPERTIES(${CPP_FILE} PROPERTIES SUFFIX .mexw32 COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
endif(CMAKE_CL_64)
else(WIN32)
elseif(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CPP_FILE} PROPERTIES SUFFIX .mexa64 PREFIX "" COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CPP_FILE} PROPERTIES SUFFIX .mexglx PREFIX "" COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
elseif(APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CPP_FILE} PROPERTIES SUFFIX .mexmaci64 PREFIX "" COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CPP_FILE} PROPERTIES SUFFIX .mexmaci PREFIX "" COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(WIN32)

install(TARGETS ${CPP_FILE} DESTINATION ../bin)
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/CPUEngine/DoCalSARAtCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ and multi-threading (OpenMP) written by Fang Liu ([email protected]).

/* includes CPU kernel */
#include "SARKernel.h"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/CPUEngine/DoScanAtCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ and multi-threading (OpenMP) written by Fang Liu ([email protected]).

/* includes CPU kernel */
#include "BlochKernel.h"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
30 changes: 17 additions & 13 deletions Lib/src/engine/GPUEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@

IF (IPP_FOUND) # use ipp
# compile kernels for shader models 20 30 35 50, support double-precision floating-point operation
set(CUDA_NVCC_FLAGS -Xcompiler -fPIC -use_fast_math -gencode=arch=compute_20,code="sm_20,compute_20"
-gencode=arch=compute_30,code="sm_30,compute_30"
-gencode=arch=compute_35,code="sm_35,compute_35"
-gencode=arch=compute_50,code="sm_50,compute_50"
--ptxas-options=-v -DMATLAB_MEX_FILE -DIPP)
set(CUDA_NVCC_FLAGS -Xcompiler -fPIC -gencode=arch=compute_30,code="sm_30,compute_30"
-gencode=arch=compute_35,code="sm_35,compute_35"
-gencode=arch=compute_50,code="sm_50,compute_50"
--ptxas-options=-v -DMATLAB_MEX_FILE -DIPP)
else (IPP_FOUND) # use framewave
# compile kernels for shader models 20 21 30 35 50, support double-precision floating-point operation
set(CUDA_NVCC_FLAGS -Xcompiler -fPIC -use_fast_math -gencode=arch=compute_20,code="sm_20,compute_20"
-gencode=arch=compute_30,code="sm_30,compute_30"
-gencode=arch=compute_35,code="sm_35,compute_35"
-gencode=arch=compute_50,code="sm_50,compute_50"
--ptxas-options=-v -DMATLAB_MEX_FILE -DFW)
set(CUDA_NVCC_FLAGS -Xcompiler -fPIC -gencode=arch=compute_30,code="sm_30,compute_30"
-gencode=arch=compute_35,code="sm_35,compute_35"
-gencode=arch=compute_50,code="sm_50,compute_50"
--ptxas-options=-v -DMATLAB_MEX_FILE -DFW)
endif (IPP_FOUND)

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler ${OpenMP_CXX_FLAGS})
Expand All @@ -38,11 +36,17 @@ foreach(CU_FILE ${CU_FILES})
else(CMAKE_CL_64)
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexw32)
endif(CMAKE_CL_64)
else(WIN32)
elseif(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexa64 PREFIX "")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexa64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexglx PREFIX "")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexglx PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
elseif(APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexmaci64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(${CU_FILE} PROPERTIES SUFFIX .mexmaci PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(WIN32)

Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

/* includes CUDA kernel */
#include "BlochKernelCEST.cuh"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/GPUEngine/DoGMScanAtGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

/* includes CUDA kernel */
#include "BlochKernelGM.cuh"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/GPUEngine/DoMEScanAtGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

/* includes CUDA kernel */
#include "BlochKernelME.cuh"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/GPUEngine/DoMTScanAtGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

/* includes CUDA kernel */
#include "BlochKernelMT.cuh"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
3 changes: 2 additions & 1 deletion Lib/src/engine/GPUEngine/DoScanAtGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

/* includes CUDA kernel */
#include "BlochKernel.cuh"
extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
//extern "C" bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy);
extern "C" int mxUnshareArray(mxArray *array_ptr, int noDeepCopy);

/* MEX entry function */
void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
Expand Down
10 changes: 8 additions & 2 deletions Lib/src/interface/DoMatToHDF5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ if(WIN32)
else(CMAKE_CL_64)
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexw32)
endif(CMAKE_CL_64)
else(WIN32)
elseif(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexa64 PREFIX "")
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexa64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexglx PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
else(APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexmaci64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoMatToHDF5 PROPERTIES SUFFIX .mexmaci PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(WIN32)

install(TARGETS DoMatToHDF5 DESTINATION ../bin)
18 changes: 12 additions & 6 deletions Lib/src/recon/DoGridding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ if(WIN32)
else(CMAKE_CL_64)
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexw32)
endif(CMAKE_CL_64)
else(WIN32)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexa64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexglx PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
elseif(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexa64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexglx PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
elseif(APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexmaci64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoGridding PROPERTIES SUFFIX .mexmaci PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(WIN32)

install(TARGETS DoGridding DESTINATION ../bin)
2 changes: 1 addition & 1 deletion Lib/src/renderer/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

include(${VTK_USE_FILE})
#include(${VTK_USE_FILE})

if (VTK_FOUND)
add_subdirectory(DoKSpaceTrajVTK)
Expand Down
13 changes: 10 additions & 3 deletions Lib/src/renderer/DoKSpaceTrajVTK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@

add_library(DoKSpaceTrajVTK SHARED DoKSpaceTrajVTK.cpp ${CMAKE_SOURCE_DIR}/Matlabdef.def)
target_link_libraries(DoKSpaceTrajVTK ${MATLAB_LIBRARIES})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

if(WIN32)
if (CMAKE_CL_64)
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexw64)
else(CMAKE_CL_64)
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexw32)
endif(CMAKE_CL_64)
else(WIN32)
elseif(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexa64 PREFIX "")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexa64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexglx PREFIX "")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexglx PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
elseif(APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexmaci64 PREFIX "")
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET_TARGET_PROPERTIES(DoKSpaceTrajVTK PROPERTIES SUFFIX .mexmaci PREFIX "")
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(WIN32)

Expand Down
Loading