Commit bcbe581d authored by Daniel Campora's avatar Daniel Campora Committed by Rosen Matev
Browse files

Remove macos specific settings.

parent 3efa8928
Pipeline #3772608 waiting for manual action with stages
in 19 minutes and 14 seconds
......@@ -25,13 +25,7 @@ get_target_property(LIBCLANG_LIBDIR libclang IMPORTED_LOCATION_RELEASE)
get_filename_component(LIBCLANG_LIBDIR "${LIBCLANG_LIBDIR}" PATH)
if(NOT LIBCLANG_LIBDIR)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# In macOS, libClang typically exists even if llvm-config does not exist.
# Attempt default directory
set(LIBCLANG_LIBDIR /Library/Developer/CommandLineTools/usr/lib)
set(LIBCLANG_ALTERNATIVE_FOUND ON)
message(STATUS "Using predefined macos libclang directory")
elseif(EXISTS /cvmfs/sft.cern.ch)
if(EXISTS /cvmfs/sft.cern.ch)
# As a last resort, try a hard-coded directory in cvmfs
set(LIBCLANG_LIBDIR /cvmfs/lhcb.cern.ch/lib/lcg/releases/clang/12.0.0/x86_64-centos7/lib)
set(LIBCLANG_ALTERNATIVE_FOUND ON)
......@@ -44,13 +38,6 @@ endif()
message(STATUS "Found libclang at ${LIBCLANG_LIBDIR}")
# Macos requires DYLD_LIBRARY_PATH, otherwise LD_LIBRARY_PATH
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIBRARY_PATH_VARNAME "DYLD_LIBRARY_PATH")
else()
set(LIBRARY_PATH_VARNAME "LD_LIBRARY_PATH")
endif()
# Parse Allen algorithms
# TODO: Parsing should depend on ALL algorithm headers and ALL algorithm sources
add_custom_command(
......@@ -59,7 +46,7 @@ add_custom_command(
COMMAND
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/configuration/parser" "${ALLEN_PARSER_DIR}" &&
${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/scripts/clang" "${ALLEN_PARSER_DIR}/clang" &&
${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate parsed_algorithms --filename "${PARSED_ALGORITHMS_OUTPUTFILE}" --prefix_project_folder "${PROJECT_SOURCE_DIR}"
${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate parsed_algorithms --filename "${PARSED_ALGORITHMS_OUTPUTFILE}" --prefix_project_folder "${PROJECT_SOURCE_DIR}"
DEPENDS "${PROJECT_SOURCE_DIR}/configuration/parser/ParseAlgorithms.py")
# Symlink Allen build directories
......@@ -77,7 +64,7 @@ add_custom_target(generate_conf_core DEPENDS "${SEQUENCE_DEFINITION_DIR}" "${ALL
add_custom_command(
OUTPUT "${ALGORITHMS_OUTPUTFILE}"
COMMAND
${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate views --filename "${ALGORITHMS_OUTPUTFILE}" --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}"
${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate views --filename "${ALGORITHMS_OUTPUTFILE}" --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}"
WORKING_DIRECTORY ${ALLEN_PARSER_DIR}
DEPENDS "${PARSED_ALGORITHMS_OUTPUTFILE}" generate_conf_core)
......@@ -87,7 +74,7 @@ add_custom_target(generate_algorithms_view DEPENDS "${ALGORITHMS_OUTPUTFILE}")
add_custom_command(
OUTPUT "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/AlgorithmDB.h"
COMMENT "Generating AlgorithmDB"
COMMAND ${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate db --filename "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/AlgorithmDB.h" --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}"
COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate db --filename "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/AlgorithmDB.h" --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}"
WORKING_DIRECTORY ${ALLEN_PARSER_DIR}
DEPENDS "${PARSED_ALGORITHMS_OUTPUTFILE}")
......@@ -104,7 +91,7 @@ install(TARGETS algorithm_db
add_custom_command(
OUTPUT "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/StructToTuple.cuh"
COMMAND
${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate struct_to_tuple --filename "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/StructToTuple.cuh" --prefix_project_folder "${PROJECT_SOURCE_DIR}"
${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate struct_to_tuple --filename "${ALLEN_GENERATED_INCLUDE_FILES_DIR}/StructToTuple.cuh" --prefix_project_folder "${PROJECT_SOURCE_DIR}"
WORKING_DIRECTORY ${ALLEN_PARSER_DIR}
DEPENDS "${PARSED_ALGORITHMS_OUTPUTFILE}")
......@@ -125,7 +112,7 @@ if(NOT STANDALONE)
file(MAKE_DIRECTORY ${ALGORITHM_WRAPPERS_FOLDER})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/configuration/parser" "${ALLEN_PARSER_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/scripts/clang" "${ALLEN_PARSER_DIR}/clang")
execute_process(COMMAND ${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate wrapperlist --filename "${ALGORITHM_WRAPPERS_LISTFILE}" --algorithm_wrappers_folder "${ALGORITHM_WRAPPERS_FOLDER}" --prefix_project_folder "${PROJECT_SOURCE_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate wrapperlist --filename "${ALGORITHM_WRAPPERS_LISTFILE}" --algorithm_wrappers_folder "${ALGORITHM_WRAPPERS_FOLDER}" --prefix_project_folder "${PROJECT_SOURCE_DIR}")
file(READ "${ALGORITHM_WRAPPERS_LISTFILE}" WRAPPED_ALGORITHM_SOURCES) # WRAPPED_ALGORITHM_SOURCES="a.cpp b.cpp c.cpp"
# Build step that will produce all .cpp conversion files
......@@ -133,7 +120,7 @@ if(NOT STANDALONE)
OUTPUT ${WRAPPED_ALGORITHM_SOURCES}
COMMENT "Generating wrapped algorithm sources"
COMMAND
${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate wrappers --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}" --algorithm_wrappers_folder "${ALGORITHM_WRAPPERS_FOLDER}"
${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LIBCLANG_LIBDIR}:$ENV{LD_LIBRARY_PATH}" "CPLUS_INCLUDE_PATH=$ENV{CPLUS_INCLUDE_PATH}" "${Python_EXECUTABLE}" "${ALGORITHMS_GENERATION_SCRIPT}" --generate wrappers --parsed_algorithms "${PARSED_ALGORITHMS_OUTPUTFILE}" --algorithm_wrappers_folder "${ALGORITHM_WRAPPERS_FOLDER}"
WORKING_DIRECTORY ${PROJECT_SEQUENCE_DIR}
DEPENDS "${PARSED_ALGORITHMS_OUTPUTFILE}")
else()
......@@ -168,7 +155,7 @@ function(generate_sequence sequence)
add_custom_command(
OUTPUT "${PROJECT_BINARY_DIR}/${sequence}.json"
COMMAND
${CMAKE_COMMAND} -E env "${LIBRARY_PATH_VARNAME}=$ENV{LD_LIBRARY_PATH}" "PYTHONPATH=${PROJECT_SEQUENCE_DIR}:$ENV{PYTHONPATH}" "${Python_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/configuration/sequences/${sequence}.py" &&
${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}" "PYTHONPATH=${PROJECT_SEQUENCE_DIR}:$ENV{PYTHONPATH}" "${Python_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/configuration/sequences/${sequence}.py" &&
${CMAKE_COMMAND} -E rename "${sequence_dir}/Sequence.json" "${PROJECT_BINARY_DIR}/${sequence}.json"
DEPENDS "${PROJECT_SOURCE_DIR}/configuration/sequences/${sequence}.py" generate_algorithms_view checkout_gaudi_dirs
WORKING_DIRECTORY ${sequence_dir})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment