Skip to content

Commit a1ac24f

Browse files
fix: build files
1 parent 181f6ce commit a1ac24f

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

CMakeLists.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@ else()
114114
# install DiscoPoP python modules
115115
find_package(Python3 REQUIRED COMPONENTS Interpreter)
116116

117+
# setup DiscoPoP venv
118+
message(STATUS "Setting up DiscoPoP python venv: ${DiscoPoP_SOURCE_DIR}/venv")
119+
execute_process(
120+
COMMAND ${Python3_EXECUTABLE} -m venv ${DiscoPoP_SOURCE_DIR}/venv
121+
)
122+
set(Python3_VENV_EXECUTABLE ${DiscoPoP_SOURCE_DIR}/venv/bin/python3)
123+
124+
117125
# check if python tkinter module is available
118126
execute_process(
119-
COMMAND ${Python3_EXECUTABLE} -c "import tkinter"
127+
COMMAND ${Python3_VENV_EXECUTABLE} -c "import tkinter"
120128
RESULT_VARIABLE TKINTER_AVAILABLE_EXIT_CODE
121129
)
122130
if(${TKINTER_AVAILABLE_EXIT_CODE})
@@ -126,12 +134,35 @@ else()
126134
# install DiscoPoP python modules
127135
message(STATUS "Installing DiscoPoP python modules")
128136
execute_process(
129-
COMMAND ${Python3_EXECUTABLE} -m pip install ${DiscoPoP_SOURCE_DIR}
137+
COMMAND ${Python3_VENV_EXECUTABLE} -m pip install ${DiscoPoP_SOURCE_DIR}
130138
RESULT_VARIABLE DP_INSTALLATION_EXIT_CODE
131139
OUTPUT_VARIABLE DP_INSTALLATION_OUTPUT
132140
)
133141
# check if installation of DiscoPoP Modules was successful
134142
if(${DP_INSTALLATION_EXIT_CODE})
135143
message(FATAL_ERROR "${DP_INSTALLATION_OUTPUT}")
136144
endif()
145+
146+
# create symlinks for python executables
147+
message(STATUS "Creating symlinks for DiscoPoP python executables")
148+
set(DP_LOCAL_BIN_DIR "$ENV{HOME}/.local/bin")
149+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_auto_tuner)
150+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_config_provider)
151+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_explorer)
152+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_optimizer)
153+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_patch_applicator)
154+
execute_process(COMMAND rm -f ${DP_LOCAL_BIN_DIR}/discopop_patch_generator)
155+
message(STATUS "--> discopop_auto_tuner")
156+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_auto_tuner ${DP_LOCAL_BIN_DIR}/discopop_auto_tuner)
157+
message(STATUS "--> discopop_config_provider")
158+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_config_provider ${DP_LOCAL_BIN_DIR}/discopop_config_provider)
159+
message(STATUS "--> discopop_explorer")
160+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_explorer ${DP_LOCAL_BIN_DIR}/discopop_explorer)
161+
message(STATUS "--> discopop_optimizer")
162+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_optimizer ${DP_LOCAL_BIN_DIR}/discopop_optimizer)
163+
message(STATUS "--> discopop_patch_applicator")
164+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_patch_applicator ${DP_LOCAL_BIN_DIR}/discopop_patch_applicator)
165+
message(STATUS "--> discopop_patch_generator")
166+
execute_process(COMMAND ln -sf ${DiscoPoP_SOURCE_DIR}/venv/bin/discopop_patch_generator ${DP_LOCAL_BIN_DIR}/discopop_patch_generator)
167+
137168
endif()

scripts/dev/create_package.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
2+
#
3+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
4+
#
5+
# This software may be modified and distributed under the terms of
6+
# the 3-Clause BSD License. See the LICENSE file in the package base
7+
# directory for details.
8+
19
# create a temporary copy of the code to build the package
210
rm -rf tmp_package_build_dir
311
mkdir -p tmp_package_build_dir
@@ -20,6 +28,8 @@ echo "" >> DEBIAN/control
2028
rm -rf opt/DiscoPoP/build
2129
# delete packages folder if exists
2230
rm -rf opt/DiscoPoP/packages
31+
# delete venv folder if exists
32+
rm -rf opt/DiscoPoP/venv
2333
# cleanup
2434
rm -rf opt/DiscoPoP/tmp_packages_build_dir
2535

@@ -31,4 +41,4 @@ dpkg-deb --build tmp_package_build_dir packages/DiscoPoP.deb
3141
chmod 775 packages/DiscoPoP.deb
3242

3343
# cleanup
34-
rm -rf tmp_package_build_dir
44+
rm -rf tmp_package_build_dir

0 commit comments

Comments
 (0)