Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d6508c30 authored by hhakim's avatar hhakim
Browse files

Minor fixes.

- in matio linking for mex building (since the modification by 1ea31014).
- in wrapper/matlab/CMakeLists.txt for inline generation (issue with windows python command, replaced now by a script), fix also win32 faust includes.
parent e28173ba
Branches
Tags
No related merge requests found
...@@ -12,36 +12,36 @@ stages: ...@@ -12,36 +12,36 @@ stages:
- test - test
- pkg_rev - pkg_rev
#ctest: ctest:
# <<: *ctest_script <<: *ctest_script
# variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured) variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured)
# except: except:
# - schedules - schedules
# - tags - tags
# stage: test stage: test
# tags: tags:
# - linux - linux
#
#ctest_python: ctest_python:
# <<: *ctest_script <<: *ctest_script
# variables: {BUILD_WRAPPER_PYTHON: "ON", SLOW_TESTS: "OFF", DONT_PYPLOT_FAUST_TIME: "ON", NOCPPTESTS: "ON", NOPY2: "ON", BUILD_MULTITHREAD: "ON"} #, GIT_STRATEGY: none} variables: {BUILD_WRAPPER_PYTHON: "ON", SLOW_TESTS: "OFF", DONT_PYPLOT_FAUST_TIME: "ON", NOCPPTESTS: "ON", NOPY2: "ON", BUILD_MULTITHREAD: "ON"} #, GIT_STRATEGY: none}
# except: except:
# - schedules - schedules
# - tags - tags
# stage: test stage: test
# allow_failure: false allow_failure: false
# tags: tags:
# - linux - linux
#
#ctest_matlab: ctest_matlab:
# <<: *ctest_script <<: *ctest_script
# variables: {BUILD_WRAPPER_MATLAB: "ON", SLOW_TESTS: "OFF", NOCPPTESTS: "ON", BUILD_MULTITHREAD: "ON"} variables: {BUILD_WRAPPER_MATLAB: "ON", SLOW_TESTS: "OFF", NOCPPTESTS: "ON", BUILD_MULTITHREAD: "ON"}
# except: except:
# - schedules - schedules
# - tags - tags
# stage: test stage: test
# tags: tags:
# - matlab - matlab
.ctest_nightly: &ctest_nightly_script .ctest_nightly: &ctest_nightly_script
<<: *ctest_script <<: *ctest_script
......
...@@ -634,6 +634,22 @@ endif() ...@@ -634,6 +634,22 @@ endif()
include_directories(BEFORE ${EIGEN_INC_DIR} ${FAUST_SRC_LINEAR_OPERATOR_DIR} ${FAUST_LINEAR_OPERATOR_CPU_SRC_DIR} ${FAUST_ALGORITHM_FACTORIZATION_SRC_DIR} ${FAUST_UTILS_SRC_DIR} ${FAUST_ALGORITHM_CONSTRAINT_SRC_DIR}) include_directories(BEFORE ${EIGEN_INC_DIR} ${FAUST_SRC_LINEAR_OPERATOR_DIR} ${FAUST_LINEAR_OPERATOR_CPU_SRC_DIR} ${FAUST_ALGORITHM_FACTORIZATION_SRC_DIR} ${FAUST_UTILS_SRC_DIR} ${FAUST_ALGORITHM_CONSTRAINT_SRC_DIR})
if(FAUST_TORCH)
find_package(Torch REQUIRED)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} -DFAUST_TORCH") #-D_GLIBCXX_USE_CXX11_ABI=0")
message(STATUS TORCH_LIBRARY=${TORCH_LIBRARY})
target_compile_definitions(${FAUST_TARGET} PUBLIC FAUST_TORCH -D_GLIBCXX_USE_CXX11_ABI=1)
#target_compile_options(${FAUST_TARGET} PUBLIC ${TORCH_CXX_FLAGS})
#message(STATUS "TORCH_CXX_FLAGS=" ${TORCH_CXX_FLAGS)
get_filename_component(Torch_DIR ${TORCH_LIBRARY} DIRECTORY)
message(STATUS TORCH_DIR=${Torch_DIR})
include_directories(${FAUST_TARGET} ${Torch_DIR}/../include ${Torch_DIR}/../include/torch/csrc/api/include)
# target_link_libraries(${FAUST_TARGET} torch c10)
target_include_directories(${FAUST_TARGET} PUBLIC ${Torch_DIR}/../include ${Torch_DIR}/../include/torch/csrc/api/include)
endif()
########### add_subdirectory ############### ########### add_subdirectory ###############
if (BUILD_WRAPPER_PYTHON) if (BUILD_WRAPPER_PYTHON)
add_subdirectory(${FAUST_PYTHON_SRC_DIR} ${FAUST_PYTHON_BIN_DIR}) add_subdirectory(${FAUST_PYTHON_SRC_DIR} ${FAUST_PYTHON_BIN_DIR})
...@@ -699,19 +715,6 @@ else (BUILD_USE_GPU) ...@@ -699,19 +715,6 @@ else (BUILD_USE_GPU)
endif(BUILD_WRAPPER_MATLAB) endif(BUILD_WRAPPER_MATLAB)
endif (BUILD_USE_GPU) endif (BUILD_USE_GPU)
if(FAUST_TORCH)
find_package(Torch REQUIRED)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} -DFAUST_TORCH") #-D_GLIBCXX_USE_CXX11_ABI=0")
message(STATUS TORCH_LIBRARY=${TORCH_LIBRARY})
target_compile_definitions(${FAUST_TARGET} PUBLIC FAUST_TORCH -D_GLIBCXX_USE_CXX11_ABI=1)
#target_compile_options(${FAUST_TARGET} PUBLIC ${TORCH_CXX_FLAGS})
#message(STATUS "TORCH_CXX_FLAGS=" ${TORCH_CXX_FLAGS)
get_filename_component(Torch_DIR ${TORCH_LIBRARY} DIRECTORY)
message(STATUS TORCH_DIR=${Torch_DIR})
include_directories(${FAUST_TARGET} ${Torch_DIR}/../include ${Torch_DIR}/../include/torch/csrc/api/include)
# target_link_libraries(${FAUST_TARGET} torch c10)
target_include_directories(${FAUST_TARGET} PUBLIC ${Torch_DIR}/../include ${Torch_DIR}/../include/torch/csrc/api/include)
endif()
if(USE_GPU_MOD) if(USE_GPU_MOD)
include_directories(${FAUST_TARGET} ${GPU_MOD_INCLUDE_DIR} ${GPU_MOD_INCLUDE_DIR}/../build) include_directories(${FAUST_TARGET} ${GPU_MOD_INCLUDE_DIR} ${GPU_MOD_INCLUDE_DIR}/../build)
......
# this script is temporary, TODO: delete it when
# gen_matlab_inline_doc_from_doxy_blocks will handle matlab function files in
# addition to class files
import sys, shutil, os.path, os
if(len(sys.argv) < 2):
print("error: two arguments are needed, the input and ouput files.")
exit(1)
IN_FILE=sys.argv[1]
OUT_FILE=sys.argv[2]
OUT_DIR=os.path.dirname(OUT_FILE)
if not os.path.exists(IN_FILE):
exit(0)
# raise Exception(IN_FILE+ " not found.") # not an error because some files
# are totally experimental code and deleted
if not os.path.exists(OUT_DIR):
os.mkdir(OUT_DIR)
shutil.copy(IN_FILE, OUT_FILE)
...@@ -77,8 +77,8 @@ foreach(MATFAUST_FILE IN LISTS FAUST_MATLAB_MATFAUST_FILE_LIST) ...@@ -77,8 +77,8 @@ foreach(MATFAUST_FILE IN LISTS FAUST_MATLAB_MATFAUST_FILE_LIST)
#TODO: inline doc should be possible for function files too #TODO: inline doc should be possible for function files too
#configure_file(${FAUST_MATLAB_NAMESPACE_SRC_DIR}/${MATFAUST_FILE} ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE} @ONLY) #configure_file(${FAUST_MATLAB_NAMESPACE_SRC_DIR}/${MATFAUST_FILE} ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE} @ONLY)
add_custom_command(OUTPUT ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE} add_custom_command(OUTPUT ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE}
COMMAND python COMMAND python
ARGS -c 'import shutil, os.path, os\;os.path.exists(\"${FAUST_MATLAB_BIN_DIR}/expfiltered/${MATFAUST_FILE}\") and (os.path.exists(\"${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${PARENT_DIR}\") or os.mkdir(\"${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${PARENT_DIR}\")) and shutil.copy(\"${FAUST_MATLAB_BIN_DIR}/expfiltered/${MATFAUST_FILE}\", \"${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE}\")' ARGS ${PROJECT_SOURCE_DIR}/gen_doc/matlab_copy_function_file.py ${FAUST_MATLAB_BIN_DIR}/expfiltered/${MATFAUST_FILE} ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE}
DEPENDS ${FAUST_MATLAB_BIN_DIR}/expfiltered/${MATFAUST_FILE} DEPENDS ${FAUST_MATLAB_BIN_DIR}/expfiltered/${MATFAUST_FILE}
COMMENT "Generating matfaust inline doc for ${MATFAUST_FILE} (just copied because it's a function file).") COMMENT "Generating matfaust inline doc for ${MATFAUST_FILE} (just copied because it's a function file).")
add_custom_target(GEN_MATFAUST_INLINE_DOC_${MATFAUST_SHORT_FILE} ALL DEPENDS ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE}) add_custom_target(GEN_MATFAUST_INLINE_DOC_${MATFAUST_SHORT_FILE} ALL DEPENDS ${FAUST_MATLAB_NAMESPACE_BIN_DIR}/${MATFAUST_FILE})
...@@ -125,6 +125,20 @@ file(GLOB CPP_MEX_FILES "${FAUST_MATLAB_MEX_SRC_DIR}/*.cpp") ...@@ -125,6 +125,20 @@ file(GLOB CPP_MEX_FILES "${FAUST_MATLAB_MEX_SRC_DIR}/*.cpp")
string(REGEX REPLACE "[a-zA-Z0-9_/:.-]+/([a-zA-Z0-9_]+)\\.cpp(;|$)" "\\1\\2" MEXFILE_TARGET_LIST "${CPP_MEX_FILES}") string(REGEX REPLACE "[a-zA-Z0-9_/:.-]+/([a-zA-Z0-9_]+)\\.cpp(;|$)" "\\1\\2" MEXFILE_TARGET_LIST "${CPP_MEX_FILES}")
if(WIN32) if(WIN32)
set(CMAKE_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS_LIST} "-I${MATIO_INC_DIR}" "-I${MATLAB_INCLUDE_DIR}" "-I${EIGEN_INC_DIR}" "-I${FAUST_SRC_LINEAR_OPERATOR_DIR}" "-I${FAUST_LINEAR_OPERATOR_CPU_SRC_DIR}" "-I${FAUST_ALGORITHM_CONSTRAINT_SRC_DIR}" "-I${FAUST_ALGORITHM_FACTORIZATION_SRC_DIR}" "-I${FAUST_MATLAB_TOOLS_SRC_DIR}" "-I${FAUST_UTILS_SRC_DIR}")
if(USE_GPU_MOD)
set(CMAKE_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS_LIST} -DUSE_GPU_MOD -I${GPU_MOD_INCLUDE_DIR} -I${GPU_MOD_INCLUDE_DIR}/../build/)
endif()
if(BUILD_OPENBLAS)
set(CMAKE_CXX_FLAGS_LIST "${CMAKE_CXX_FLAGS_LIST}" "-I${OPENBLAS_INC_DIR}")
endif()
if(FAUST_TORCH)
set(CMAKE_CXX_FLAGS_LIST "${CMAKE_CXX_FLAGS_LIST}" "-I${Torch_DIR}/../include" "-I${Torch_DIR}/../include/torch/csrc/api/include")
endif()
#windows version uses static lib of matio anyway (so replace any dyn. lib found by the static lib) #windows version uses static lib of matio anyway (so replace any dyn. lib found by the static lib)
string(REGEX REPLACE "^(.+)/.*$" "\\1/libmatio.lib" LDD_MEX_FLAGS "${MATIO_LIB_FILE}") string(REGEX REPLACE "^(.+)/.*$" "\\1/libmatio.lib" LDD_MEX_FLAGS "${MATIO_LIB_FILE}")
set(LDD_MEX_FLAGS ${LDD_MEX_FLAGS} ${HDF5_STATIC_LIB_PATH} ${Z_STATIC_LIB_PATH}) set(LDD_MEX_FLAGS ${LDD_MEX_FLAGS} ${HDF5_STATIC_LIB_PATH} ${Z_STATIC_LIB_PATH})
...@@ -177,7 +191,7 @@ foreach(mex_target ${MEXFILE_TARGET_LIST}) ...@@ -177,7 +191,7 @@ foreach(mex_target ${MEXFILE_TARGET_LIST})
if(USE_MATIO_STATIC_LIBS) if(USE_MATIO_STATIC_LIBS)
target_link_libraries(${mex_target} "${MATIO_STATIC_LIB_PATH}" "${HDF5_STATIC_LIB_PATH}" "${Z_STATIC_LIB_PATH}") target_link_libraries(${mex_target} "${MATIO_STATIC_LIB_PATH}" "${HDF5_STATIC_LIB_PATH}" "${Z_STATIC_LIB_PATH}")
else() else()
target_link_libraries(${mex_target} matio) target_link_libraries(${mex_target} ${MATIO_LIB_FILE})
endif() endif()
# add_custom_command(OUTPUT ${mex_target}.${MEX_EXT} # add_custom_command(OUTPUT ${mex_target}.${MEX_EXT}
# COMMAND ${MATLAB_ROOT}/bin/mex # COMMAND ${MATLAB_ROOT}/bin/mex
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment