GithubHelp home page GithubHelp logo

cp problem about tensorflow_cc HOT 6 CLOSED

floopcz avatar floopcz commented on June 26, 2024
cp problem

from tensorflow_cc.

Comments (6)

chaowyc avatar chaowyc commented on June 26, 2024

I read the issue the other one posted who faced the same problem before, and the solution you provided in that issue by adding -DCMAKE_INSTALL_PREFIX is doesn't work for me, and at the same time I face a new problem before the cp.

_20171121224004

so, is there any relation between the two problem?

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Hi, the solution will probably work for you as well, but you have to remove the tensorflow_cc/build folder first. Also consider removing ~/.cache to clean up the previous builds.

from tensorflow_cc.

chaowyc avatar chaowyc commented on June 26, 2024

hi, I think I find the key point why this cp error appears after reading the your whole project and many times building.
At first, I found the error always showed after tensorflow build process was finished. That means our tensorflow is successful built and then next step will do some cp operations, At that time I didn't know why there should have cp operation because I only typed make command without make install, as you can see the make install command will cause some files movement and use cp is make sense.
So, I began read your cmake files. After long time reading, I found some clues in cmake directory. In the TensorflowShared.cmake file, there are some command execute sequences, the last two commands are to build tensorflow and do some copy links by executing bash files respectively. That is what I want find as I described above, the error shows after tensorflow is successful built.
Then read the copy-links bash file. According to my understanding, the main function of the bash file is find symbolic links under the directory which is specified by argument, then remove these symbolic links by unlink them and copy the content from the realpath to there, it seems something wrong when copying . Actually it is, when I comment the do copy-links bash file command, which means there is no copy process after building tensorflow, the cp problem is disappear.
Then, I execute the commands inside the copy-links.sh manually, I get the same cp error, and the error only happened when process this path:

"./tensorflow/contrib/makefile/gen/protobuf/protobuf"

after testing this path, I find this symbolic links actully is a circle.
when list the content in this path (./tensorflow/contrib/makefile/gen/protobuf/protobuf), shows below

lib, bin, include, protobuf

then cd to the protobuf dir and list(./tensorflow/contrib/makefile/gen/protobuf/protobuf/protobuf), shows same content as below. you can do these processes several times, you will find the content is NEVER changed.
So this circle will lead the source and destination is same when do the copy command to protobuf dir !!!.
AND, fortunately it's also means that we do not need do the copy command to this dir beacause it's content not changed, it's SAME one.
I finally got this, and modify your copy-links.sh file, now it's look likes below:

#!/bin/sh
set -e
skip="./tensorflow/contrib/makefile/gen/protobuf/protobuf"
for f in $(find "$1" -type l); do
    if test $f = $skip
        then
            continue
    fi
    realf="$(realpath $f)"
    unlink "$f"
    cp -r "$realf" "$f"
done

it's look likes simple and force, but it really works for me, faceplam.

I still have some question, I don't understand why you clean up the symbolic links. I browse the commit history find that it's no need delete these links before.
And, when I compile the tensorflow by bazel, there is no symbolic links generated, so why there is some when compile tf through your project.
Anyway, thank for you project, I can get my hand on building the tf by cmake, and I also learn a lot by read your code. Hope my issue will help you find the truly solution for this problem.

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Hi,

The reason for "delinking" is that some of the files in the compiled library folder are actually only links to the ~/.cache/bazel. After removing ~/.cache, the installation would stop working. Can you please try to remove both tensorflow_cc/build and ~/.cache, and rebuild the project with -DCMAKE_INSTALL_PREFIX=/usr/local?

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Closing for inactivity, please reopen if you continue to encounter this issue.

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Hi, the issue should be fixed in the latest master.

from tensorflow_cc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.