From 2f04bf87c85b51def0fb1e50917b355de06c5c36 Mon Sep 17 00:00:00 2001 From: Das Date: Fri, 11 Feb 2022 14:29:47 +0100 Subject: [PATCH 1/4] integrating bare_etiss_processor --- .github/workflows/ci.yml | 32 +++++------ CMakeLists.txt | 30 +++++++++-- examples/CMakeLists.txt | 2 +- .../bare_etiss_processor/CMakeLists.txt.in | 48 ----------------- .../bare_etiss_processor/CMakeLists.txt | 51 ++++++++---------- .../bare_etiss_processor/ETISS.ini | 0 .../bare_etiss_processor/README.md | 0 .../bare_etiss_processor/TracePrinter.h | 0 .../bare_etiss_processor/base.ini | 0 .../bare_etiss_processor/etissSnapshot.png | Bin .../bare_etiss_processor/gdbSnapshot.png | Bin .../bare_etiss_processor/get_metrics.py | 0 .../bare_etiss_processor/main.cpp | 0 .../bare_etiss_processor/requirements.txt | 0 .../bare_etiss_processor/run.sh.in | 0 .../bare_etiss_processor/run_helper.sh.in | 8 +-- src/jitlibs/resources/CMakeLists.txt | 8 +-- src/jitlibs/softfloat/CMakeLists.txt | 4 +- 18 files changed, 77 insertions(+), 106 deletions(-) delete mode 100644 examples/bare_etiss_processor/CMakeLists.txt.in rename {examples => src}/bare_etiss_processor/CMakeLists.txt (74%) rename {examples => src}/bare_etiss_processor/ETISS.ini (100%) rename {examples => src}/bare_etiss_processor/README.md (100%) rename {examples => src}/bare_etiss_processor/TracePrinter.h (100%) rename {examples => src}/bare_etiss_processor/base.ini (100%) rename {examples => src}/bare_etiss_processor/etissSnapshot.png (100%) rename {examples => src}/bare_etiss_processor/gdbSnapshot.png (100%) rename {examples => src}/bare_etiss_processor/get_metrics.py (100%) rename {examples => src}/bare_etiss_processor/main.cpp (100%) rename {examples => src}/bare_etiss_processor/requirements.txt (100%) rename {examples => src}/bare_etiss_processor/run.sh.in (100%) rename {examples => src}/bare_etiss_processor/run_helper.sh.in (94%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba9f8dc1a5..5d60f3669e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,6 @@ jobs: cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv/build64 cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build64 - cmake -E make_directory ${{runner.workspace}}/install/examples/bare_etiss_processor/build cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_dhry/build - name: Setup tests @@ -112,10 +111,7 @@ jobs: cd SW/riscv_dhry/build cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf ${{matrix.config.cmakegen}} cmake --build . --config $BUILD_TYPE - cd - - cd bare_etiss_processor/build - cmake .. - cmake --build . --config $BUILD_TYPE + - name: Compress Compiled System run: tar -C ${{runner.workspace}} -cvf ${{runner.workspace}}/etiss.tar install @@ -150,18 +146,18 @@ jobs: run: tar -xf etiss.tar - name: Test (Linux/Mac) - working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor + working-directory: ${{runner.workspace}}/install/bin if: matrix.config.name == 'Linux' shell: bash run: | - ./run_helper.sh ../SW/riscv/build/riscv_example.elf - ./run_helper.sh ../SW/riscv/build/riscv_example.elf gcc - ./run_helper.sh ../SW/riscv/build/riscv_example.elf llvm - ./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf - ./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf gcc - ./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf llvm - ./run_helper.sh ../SW/riscv/build64/riscv_example.elf - ./run_helper.sh ../SW/riscv_cpp/build64/riscv_example.elf + ./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf + ./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf gcc + ./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf llvm + ./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf + ./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf gcc + ./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf llvm + ./run_helper.sh ../examples/SW/riscv/build64/riscv_example.elf + ./run_helper.sh ../examples/SW/riscv_cpp/build64/riscv_example.elf # - name: Test (Windows) # working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor/build @@ -182,7 +178,7 @@ jobs: matrix: run-no: [1, 2, 3, 4, 5] jit-engine: ["tcc", "gcc", "llvm"] - + if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'pull_request' needs: build runs-on: ubuntu-latest @@ -203,9 +199,9 @@ jobs: run: mkdir ${{runner.workspace}}/results - name: Run Benchmarks - working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor + working-directory: ${{runner.workspace}}/install/bin run: | - ./run_helper.sh ../SW/riscv_dhry/build/riscv_example ${{matrix.jit-engine}} --vp.stats_file_path=${{runner.workspace}}/results/run.json + ./run_helper.sh ../examples/SW/riscv_dhry/build/riscv_example ${{matrix.jit-engine}} --vp.stats_file_path=${{runner.workspace}}/results/run.json mv ${{runner.workspace}}/results/run.json ${{runner.workspace}}/results/run_${{matrix.jit-engine}}_${{matrix.run-no}}.json - name: Save Benchmark Results @@ -411,7 +407,7 @@ jobs: delete-artifact: if: always() - needs: [display-wiki, display-pr] + needs: [display-wiki, display-pr, test] runs-on: ubuntu-latest continue-on-error: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b8edea490..92c3996e4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) MESSAGE(FATAL_ERROR "In-source builds are not allowed because they pollute the source tree with temporary files that might have to be deleted later. Please create a separate folder in which you run CMake.") ENDIF() +set(ETISS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "ETISS build location") # Declare ETISS version set(ETISS_VERSION_MAJOR 0) set(ETISS_VERSION_MINOR 8) @@ -85,10 +86,23 @@ ELSE() SET(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined") ENDIF() + # use, i.e. don't skip the full RPATH for the build tree + set(CMAKE_SKIP_BUILD_RPATH FALSE) + + # when building, don't use the install RPATH already + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # the RPATH to be used when installing, but only if it's not a system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + endif("${isSystemDir}" STREQUAL "-1") - # Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - SET(CMAKE_INSTALL_RPATH "\$ORIGIN") ENDIF() # Support colored output for ninja generator. @@ -291,6 +305,16 @@ FILES_MATCHING # copy cmake files set(INSTALL_CMAKE_DIR lib/CMake/ETISS CACHE PATH "Installation directory for CMake files") +# to allow linking with ETISS lib in build-tree +# copying headers +#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${ETISS_BINARY_DIR}/include/) +#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include_c/ DESTINATION ${ETISS_BINARY_DIR}/include/) +file(GLOB JIT_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/jitlibs/**/*.h) +file(COPY ${JIT_HEADERS} DESTINATION ${ETISS_BINARY_DIR}/include/jit/etiss/jit/) +# plugins/list.txt file +file(WRITE ${ETISS_BINARY_DIR}/lib/plugins/list.txt) + + ############# TARGETS ############## diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 87cb75a394..c836b2b25d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -34,7 +34,7 @@ # -ADD_SUBDIRECTORY(bare_etiss_processor) +#ADD_SUBDIRECTORY(bare_etiss_processor) #ADD_SUBDIRECTORY(mixed_level_fault_injection) ADD_SUBDIRECTORY(SW) #ADD_SUBDIRECTORY(systemc) diff --git a/examples/bare_etiss_processor/CMakeLists.txt.in b/examples/bare_etiss_processor/CMakeLists.txt.in deleted file mode 100644 index b470c2c34b..0000000000 --- a/examples/bare_etiss_processor/CMakeLists.txt.in +++ /dev/null @@ -1,48 +0,0 @@ - -cmake_minimum_required(VERSION 3.14) -project(bare_etiss_processor) - -# may not be needed if ETISS was installed into the default directory (e.g. /usr/... for linux or "C:\Program Files\..." for windows) -# if ETISS cannot be found search for the file ETISSConfig.cmake -set(ETISS_DIR "@CMAKE_INSTALL_PREFIX@/lib/CMake/ETISS") -set(CMAKE_CXX_LINK_FLAGS "@CMAKE_CXX_LINK_FLAGS@") - -#NOTE: etiss NEEDS at least the c++0x standard as implemented by gcc. C++11 recommended. the compiler used here must be the same as the compiler used for etiss. -# by default the -std=c++0x / -std= c++11 options are set in the package file unless ETISS_DISABLE_COMPILERFLAGS is set to on - -#find ETISS package -find_package(ETISS @ETISS_VERSION_MAJOR@.@ETISS_VERSION_MINOR@) - -#add include directories -include_directories(${ETISS_INCLUDE_DIRS}) - -#main executable -add_executable(main main.cpp) - -#link required libraries -#not python libraries may not be found and this could lead to problems if ETISS was configure to use python. -target_link_libraries(main ${ETISS_LIBRARIES}) - -IF(PULPINO_ROM_START) - add_compile_definitions(ROM_START=${PULPINO_ROM_START}) -ELSE() - add_compile_definitions(ROM_START=0x0) -ENDIF() - -IF(PULPINO_ROM_SIZE) - add_compile_definitions(ROM_SIZE=${PULPINO_ROM_SIZE}) -ELSE() - add_compile_definitions(ROM_SIZE=0x80000) -ENDIF() - -IF(PULPINO_RAM_START) - add_compile_definitions(RAM_START=${PULPINO_RAM_START}) -ELSE() - add_compile_definitions(RAM_START=0x80000) -ENDIF() - -IF(PULPINO_RAM_SIZE) - add_compile_definitions(RAM_SIZE=${PULPINO_RAM_SIZE}) -ELSE() - add_compile_definitions(RAM_SIZE=0x80000) -ENDIF() diff --git a/examples/bare_etiss_processor/CMakeLists.txt b/src/bare_etiss_processor/CMakeLists.txt similarity index 74% rename from examples/bare_etiss_processor/CMakeLists.txt rename to src/bare_etiss_processor/CMakeLists.txt index ca405e8b14..5979556015 100644 --- a/examples/bare_etiss_processor/CMakeLists.txt +++ b/src/bare_etiss_processor/CMakeLists.txt @@ -33,47 +33,42 @@ # Version 0.1 # -project(bare_etiss_processor_example) +project(bare_etiss_processor) +add_executable(bare_etiss_processor main.cpp) +target_link_libraries(bare_etiss_processor ETISS) + +set(ETISS_DIR ${CMAKE_INSTALL_PREFIX} ) configure_file( - CMakeLists.txt.in - "${PROJECT_BINARY_DIR}/tobeinstalled/CMakeLists.txt" + run_helper.sh.in + "${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh" @ONLY ) + +set(ETISS_DIR ${CMAKE_BINARY_DIR}) configure_file( - run.sh.in - "${PROJECT_BINARY_DIR}/tobeinstalled/run.sh" + run_helper.sh.in + "${CMAKE_BINARY_DIR}/bin/run_helper.sh" @ONLY ) configure_file( - run_helper.sh.in - "${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh" - @ONLY + base.ini + "${CMAKE_BINARY_DIR}/examples/base.ini" + COPYONLY ) +set_target_properties( bare_etiss_processor + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" + ) -install(FILES - "${PROJECT_BINARY_DIR}/tobeinstalled/CMakeLists.txt" - "${PROJECT_BINARY_DIR}/tobeinstalled/run.sh" - "${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh" - "get_metrics.py" - DESTINATION examples/bare_etiss_processor +install(TARGETS bare_etiss_processor DESTINATION bin) +install(FILES "${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh" + DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) - install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ - DESTINATION examples/bare_etiss_processor + DESTINATION examples FILES_MATCHING - PATTERN "*.h" - PATTERN "*.cpp" - PATTERN "*.c" - PATTERN "*.S" - PATTERN "*.s" PATTERN "*.ini" - PATTERN "README*" - PATTERN "code_or1k.bin" - PATTERN "code_ARMv6M.elf" - PATTERN ".svn" EXCLUDE - PATTERN "*.in" EXCLUDE - PATTERN "CMakeLists.txt" EXCLUDE -) +) \ No newline at end of file diff --git a/examples/bare_etiss_processor/ETISS.ini b/src/bare_etiss_processor/ETISS.ini similarity index 100% rename from examples/bare_etiss_processor/ETISS.ini rename to src/bare_etiss_processor/ETISS.ini diff --git a/examples/bare_etiss_processor/README.md b/src/bare_etiss_processor/README.md similarity index 100% rename from examples/bare_etiss_processor/README.md rename to src/bare_etiss_processor/README.md diff --git a/examples/bare_etiss_processor/TracePrinter.h b/src/bare_etiss_processor/TracePrinter.h similarity index 100% rename from examples/bare_etiss_processor/TracePrinter.h rename to src/bare_etiss_processor/TracePrinter.h diff --git a/examples/bare_etiss_processor/base.ini b/src/bare_etiss_processor/base.ini similarity index 100% rename from examples/bare_etiss_processor/base.ini rename to src/bare_etiss_processor/base.ini diff --git a/examples/bare_etiss_processor/etissSnapshot.png b/src/bare_etiss_processor/etissSnapshot.png similarity index 100% rename from examples/bare_etiss_processor/etissSnapshot.png rename to src/bare_etiss_processor/etissSnapshot.png diff --git a/examples/bare_etiss_processor/gdbSnapshot.png b/src/bare_etiss_processor/gdbSnapshot.png similarity index 100% rename from examples/bare_etiss_processor/gdbSnapshot.png rename to src/bare_etiss_processor/gdbSnapshot.png diff --git a/examples/bare_etiss_processor/get_metrics.py b/src/bare_etiss_processor/get_metrics.py similarity index 100% rename from examples/bare_etiss_processor/get_metrics.py rename to src/bare_etiss_processor/get_metrics.py diff --git a/examples/bare_etiss_processor/main.cpp b/src/bare_etiss_processor/main.cpp similarity index 100% rename from examples/bare_etiss_processor/main.cpp rename to src/bare_etiss_processor/main.cpp diff --git a/examples/bare_etiss_processor/requirements.txt b/src/bare_etiss_processor/requirements.txt similarity index 100% rename from examples/bare_etiss_processor/requirements.txt rename to src/bare_etiss_processor/requirements.txt diff --git a/examples/bare_etiss_processor/run.sh.in b/src/bare_etiss_processor/run.sh.in similarity index 100% rename from examples/bare_etiss_processor/run.sh.in rename to src/bare_etiss_processor/run.sh.in diff --git a/examples/bare_etiss_processor/run_helper.sh.in b/src/bare_etiss_processor/run_helper.sh.in similarity index 94% rename from examples/bare_etiss_processor/run_helper.sh.in rename to src/bare_etiss_processor/run_helper.sh.in index 2084136ca1..3723c333fc 100755 --- a/examples/bare_etiss_processor/run_helper.sh.in +++ b/src/bare_etiss_processor/run_helper.sh.in @@ -1,8 +1,8 @@ #!/bin/bash set -e # Config -ETISS_DIR=@CMAKE_INSTALL_PREFIX@/ +ETISS_DIR=@ETISS_DIR@/ # Clear tmp file DYN_INI=$(mktemp /tmp/etiss_dynamic_XXXXXXXXXX.ini) @@ -30,7 +30,8 @@ TARGETSW_PATH_ELF=$1 TARGET_ELFFILE=$(basename -- "$TARGETSW_PATH_ELF") TARGET_ELFDIR=$(dirname -- "$TARGETSW_PATH_ELF") -VP_EXE="${ETISS_DIR}/examples/bare_etiss_processor/build/main" +VP_EXE="${ETISS_DIR}bin/bare_etiss_processor" + CMD_OPTIONS="" @@ -99,7 +100,8 @@ echo -e "simple_mem_system.memseg_origin_01=0x00080000" >> $DYN_INI echo -e "simple_mem_system.memseg_length_01=0x00080000" >> $DYN_INI # Call -ARGS="-i${ETISS_DIR}/examples/bare_etiss_processor/base.ini -i${DYN_INI} ${CMD_OPTIONS}" +ARGS="-i${ETISS_DIR}/examples/base.ini -i${DYN_INI} ${CMD_OPTIONS}" + if [ "${USE_TGDB}" -eq 1 ]; then if [ "${DO_NOT_ATTACH}" -eq 0 ]; then konsole --workdir $(pwd) -e "bash -c '/usr/local/research/projects/SystemDesign/tools/riscv/current/bin/riscv64-unknown-elf-gdb -ex \"tar rem :2222\" $TARGETSW_PATH_ELF'" & diff --git a/src/jitlibs/resources/CMakeLists.txt b/src/jitlibs/resources/CMakeLists.txt index df8b4eadc2..f171a4477a 100644 --- a/src/jitlibs/resources/CMakeLists.txt +++ b/src/jitlibs/resources/CMakeLists.txt @@ -8,14 +8,16 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED resources.cpp ) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ETISS) add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD VERBATIM - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/ - COMMAND ${CMAKE_COMMAND} -E copy "$" ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/ + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/ + COMMAND ${CMAKE_COMMAND} -E copy "$" ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/ ) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ETISS) + INSTALL(FILES libresources.h DESTINATION include/jit/etiss/jit diff --git a/src/jitlibs/softfloat/CMakeLists.txt b/src/jitlibs/softfloat/CMakeLists.txt index e44a79f98a..67421bf1f6 100644 --- a/src/jitlibs/softfloat/CMakeLists.txt +++ b/src/jitlibs/softfloat/CMakeLists.txt @@ -403,8 +403,8 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${BPROJECT_NAME}) add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD VERBATIM - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/ - COMMAND ${CMAKE_COMMAND} -E copy "$" ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/ + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/ + COMMAND ${CMAKE_COMMAND} -E copy "$" ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/ ) ENDIF() From 2ff70cd3549f6234cb3b6b48d13817378b6b66ee Mon Sep 17 00:00:00 2001 From: Das Date: Fri, 18 Feb 2022 11:39:48 +0100 Subject: [PATCH 2/4] remove trailing slashes in run_helper.sh.in --- src/bare_etiss_processor/run_helper.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bare_etiss_processor/run_helper.sh.in b/src/bare_etiss_processor/run_helper.sh.in index 3723c333fc..27574e8391 100755 --- a/src/bare_etiss_processor/run_helper.sh.in +++ b/src/bare_etiss_processor/run_helper.sh.in @@ -2,7 +2,7 @@ set -e # Config -ETISS_DIR=@ETISS_DIR@/ +ETISS_DIR=@ETISS_DIR@ # Clear tmp file DYN_INI=$(mktemp /tmp/etiss_dynamic_XXXXXXXXXX.ini) @@ -30,7 +30,7 @@ TARGETSW_PATH_ELF=$1 TARGET_ELFFILE=$(basename -- "$TARGETSW_PATH_ELF") TARGET_ELFDIR=$(dirname -- "$TARGETSW_PATH_ELF") -VP_EXE="${ETISS_DIR}bin/bare_etiss_processor" +VP_EXE="${ETISS_DIR}/bin/bare_etiss_processor" CMD_OPTIONS="" From f4efef6d15dd7c5229fb1aa4b32524f9662fe4dd Mon Sep 17 00:00:00 2001 From: Das Date: Tue, 22 Feb 2022 23:14:25 +0100 Subject: [PATCH 3/4] RPATH handling --- CMakeLists.txt | 20 ++++---------------- src/bare_etiss_processor/CMakeLists.txt | 5 +++++ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92c3996e4e..0473ee1954 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,22 +86,10 @@ ELSE() SET(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined") ENDIF() - # use, i.e. don't skip the full RPATH for the build tree - set(CMAKE_SKIP_BUILD_RPATH FALSE) - - # when building, don't use the install RPATH already - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # the RPATH to be used when installing, but only if it's not a system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if("${isSystemDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - endif("${isSystemDir}" STREQUAL "-1") + # Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + SET(CMAKE_INSTALL_RPATH "\$ORIGIN") + ENDIF() diff --git a/src/bare_etiss_processor/CMakeLists.txt b/src/bare_etiss_processor/CMakeLists.txt index 5979556015..e9850aa03c 100644 --- a/src/bare_etiss_processor/CMakeLists.txt +++ b/src/bare_etiss_processor/CMakeLists.txt @@ -35,10 +35,15 @@ project(bare_etiss_processor) +SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") add_executable(bare_etiss_processor main.cpp) target_link_libraries(bare_etiss_processor ETISS) +# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir) + + + set(ETISS_DIR ${CMAKE_INSTALL_PREFIX} ) configure_file( run_helper.sh.in From 816706407e601da196813f37e4c6708216848e91 Mon Sep 17 00:00:00 2001 From: Das Date: Fri, 25 Feb 2022 12:29:43 +0100 Subject: [PATCH 4/4] setting build_with_install_rpath to true --- src/bare_etiss_processor/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bare_etiss_processor/CMakeLists.txt b/src/bare_etiss_processor/CMakeLists.txt index e9850aa03c..6612d78efc 100644 --- a/src/bare_etiss_processor/CMakeLists.txt +++ b/src/bare_etiss_processor/CMakeLists.txt @@ -35,15 +35,14 @@ project(bare_etiss_processor) +# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir) + +SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") add_executable(bare_etiss_processor main.cpp) target_link_libraries(bare_etiss_processor ETISS) -# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir) - - - set(ETISS_DIR ${CMAKE_INSTALL_PREFIX} ) configure_file( run_helper.sh.in