gongtiansu / KnotFold

Accurate Prediction of RNA Secondary Structure Including Pseudoknots through Solving Minimum-cost Flow with Learned Potential
MIT License
3 stars 2 forks source link

Opaque failure on macos #4

Open everyday847 opened 3 months ago

everyday847 commented 3 months ago

The supplied command in run_example.sh fails with an assertion error due to the subprocess call failing:

Traceback (most recent call last):
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 98, in <module>
    main()
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 94, in main
    pairs = predict(fasta, cuda)
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 67, in predict
    assert p.returncode == 0
AssertionError

This is not due to anything explicit in KnotFold_mincostflow.cc as far as I can tell (i.e., nothing explicitly returns a nonzero error code), so my guess is there's an architecture issue with the presupplied binary. My assumption is that the install instructions should direct users to compile from source instead of hoping the versioned binary will work on their platform.

heqin-zhu commented 3 months ago

The supplied command in run_example.sh fails with an assertion error due to the subprocess call failing:

Traceback (most recent call last):
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 98, in <module>
    main()
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/watkina6/mambaforge/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 94, in main
    pairs = predict(fasta, cuda)
  File "/Users/watkina6/Programs/KnotFold/example/../KnotFold.py", line 67, in predict
    assert p.returncode == 0
AssertionError

This is not due to anything explicit in KnotFold_mincostflow.cc as far as I can tell (i.e., nothing explicitly returns a nonzero error code), so my guess is there's an architecture issue with the presupplied binary. My assumption is that the install instructions should direct users to compile from source instead of hoping the versioned binary will work on their platform.

I encountered the same problem as yours. I added one line print(p.stdout.decode()) after line 66 in KnotFold.py and got the messege as follows:

CompletedProcess(args='./KnotFold_mincostflow /tmp/tmp1zd661jb/prior.mat /tmp/tmp1zd661jb/reference.mat', returncode=1, stdout=b'', stderr=b"./KnotFold_mincostflow: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by ./KnotFold_mincostflow)\n")

It indicates your assumption is right. The compiled binary executable KnotFold_mincostflow doesn't work on other devices different from the authors'.

gongtiansu commented 2 months ago

Hello,

It seems like the issue you're encountering is due to "KnotFold_mincostflow" not running successfully. Please ensure that you have a C++ runtime environment installed and try running "KnotFold_mincostflow" or recompile "KnotFold_mincostflow.cc" using the following command:

g++ KnotFold_mincostflow.cc -o KnotFold_mincostflow -std=c++0x -O2

This command will compile the program using the GNU C++ compiler (g++) with the specified options (-std=c++0x for C++11 compatibility and -O2 for optimization level 2).

Please let me know if you encounter any further issues.

Best regards,

everyday847 commented 2 months ago

I think that's almost certainly going to be sufficient. My point is rather:

the install instructions should direct users to compile from source instead of hoping the versioned binary will work on their platform.

The pattern to be avoided here is versioning the binary at all, IMO.