Skip to content

Commit 02fb545

Browse files
yhwangnkreeger
authored andcommitted
Use relative path to link to tf shared libs (tensorflow#252)
* Use relative path to link to tf shared libs When linking the tf shared libs for node binding, the symbolic links may become invalid if the application folder is moved to different directory. Using relative path to create the symbolic links may avoid this issue. Signed-off-by: Yihong Wang <yh.wang@ibm.com>
1 parent 9e2ec6e commit 02fb545

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/deps-stage.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ async function symlinkDepsLib() {
4949
throw new Error('Destination path not supplied!');
5050
}
5151
try {
52-
await symlink(depsLibTensorFlowPath, destLibPath);
52+
await symlink(
53+
path.relative(path.dirname(destLibPath), depsLibTensorFlowPath),
54+
destLibPath);
5355
if (os.platform() !== 'win32') {
54-
await symlink(depsLibTensorFlowFrameworkPath, destFrameworkLibPath);
56+
await symlink(
57+
path.relative(
58+
path.dirname(destFrameworkLibPath),
59+
depsLibTensorFlowFrameworkPath),
60+
destFrameworkLibPath);
5561
}
5662
} catch (e) {
5763
console.error(

0 commit comments

Comments
 (0)