Where can I find good open source code flow visualization software? - visualization

I am working on an academic research regarding some very long functions in the Linux kernel (link, link).
For that research, I would like to use some code flow visualization tool, that would be able to plot a graph in which each vertex is a decision point and each edge is a piece of code which runs in a consequent way.
Do you know of any good, open source project that can visualize C code?

Perhaps a tool like KCacheGrind would be of help. It generates call graphs based on actual calls and cannot pre-generate a call graph without actually running the program, which may not suit your needs, but then it again it may.

History flow's are very neat for changes/diff across multiple versions.
Codeplex has a project, Dependency Visualizer which does support C also.
Gprof2Dot can render oprofile, this would get you dynamic info also.
CodeViz also (static tool) would work.
If your using gcc, gcc-xml has an introspector plugin also todo this.

You appears to want to acquire a flowchart of C source code ("decisions", "code blocks").
Something like this C flowchart?
To do this correctly, esp. for Linux kernal code, I'd expect you to have to preprocess the code first to get rid of macros and conditionals. I would assume that GCC would construct such a graph internally and that you ought to be able to get your hands on that graph.

Doxygen does some amount of 'visualization',
but you need to work on the code a bit for it to be usable.
Another interesting thing to check would be lxr
Linux Cross Referencer is a software toolset for indexing and presenting source code repositories. LXR was initially targeted at the Linux source code, but has proved usable for a wide range of software projects. lxr.linux.no is currently running an experimental fork of the LXR software.

I can recommend Sourcetrail. Can work with a compile_commands.json. Not sure if it's still maintained, though. But it's foss and you can fork it!

Related

Problems in OpenModelica v1.19.2 when installing OpenHydraulics v1.0.1 with Modelica Standard Lib v3.2

Greeting Everyone, I am a new one here.
I'm a brand new Modelica user. I'm trying to learn the language with OpenModelica. I'd like to use OpenHydraulics which is in github link in OpenModelica (specifically in the OMEdit Connection Editor).
I downloaded OpenModelica v1.19.2 and Modelica Standard Lib v3.2 to browse and run the library OpenHydraulics v1.0.1. However, when I open the Excavator example and try to Instantiate or Simulate the model I get many errors of the form:
[OpenHydraulics.Basic.VariableRestriction: 51:3-54:64]: Function ReynoldsNumber_m_flow not found in scope VariableRestriction.
Could you help me with this problem?
Thanks in advance.
there are a couple of things you need to take into consideration:
The current version of OpenHydraulics is still the original release from almost 10 years ago.
The library was developed using Dymola which at the time also supported a couple of non-standard Modelica, Dymola-specific constructs that other tools struggle to work with.
The example you are trying to run is the most complex one utilizing almost all of the power of the library and hence has quite a high degree of complexity.
Taking all this together means that OpenModelica is bound to struggle with that example. But all is not lost. If you actually look at the more simple circuit examples (under Circuit) you'll find that they work just fine. And depending on your application area they might already demonstrate a usage that will fit your needs.
I hope this helps.

Finding built-in Unity scripts

If one would like to look into the core files of the Unity Engine, e.g: I've tried using the unity in-built "Fog" effect, but would like to see how it works on a deeper level (code). Is this something one can find, or is it encrypted in some way?
You can try to take a look at Unofficial unity decompiled repo to check if there are sources you're looking for. It's a decompiled verison so there is no guarantee that it's the actual code. Also big part of Unity's sources is written in C++ and C# scripts just call this Unity's native C++ part, so it's really incomplete.
The other option is that some of big companies, Unity's partners which have highest support level, have access to official source code. So may be you're able to find someone with access to sources.

Easiest was to share group project code written in MatLab

We are working on a group project written in MatLab. We all need to be able to access and write the same program, sometime simultaneously. We are working on a scientific Linux distribution. We are all physicists so we would rather find a very simple - ideally GUI, solution.
It sounds like GitHub would enable us to write simultaneously and merge mismatched code but it seems so complicated. We don't really understand the push/pull/fork/commit terminology and we would rather not study it if there is an easier option.
What is the path of least resistance for a group project in Matlab?
I regularly use Subversion for group MATLAB projects. It has what I find a slightly simpler workflow than Git/GitHub.
The latest versions of MATLAB integrate directly with Subversion, so you can check things in and out directly from within the MATLAB workspace. Alternatively you can use TortoiseSVN, which integrates within Windows Explorer (I believe there is an equivalent for Linux as well).
However, I'll speak bluntly - Git and GitHub are really not that hard, and I'm pretty sure that anyone who's clever enough to be a physicist working with MATLAB is clever enough to understand them as well. Although Subversion is a bit simpler to learn, Git and GitHub have a lot of advantages, they integrate well with many other services, and they're just overall kind of better. The latest versions of MATLAB integrate directly with them in the same way as with Subversion.

Using a build system for reproducible research?

I am doing a research project that involves a pipeline of programs, each generating an output file that becomes the input for the next program. I would like to make it easy to repeat the series of commands that I used to create the desired output. It seems like make or any other build system would be a good fit for this task, but all the build systems that I've looked at (except for maybe make itself) seem to be strongly biased toward building executabe files from source code, and I can't figure out how to do anything else with them. Does anyone have experience using a build system for tasks other than compiling source code into executables? Can I easily use a build system to facilitate reproducible research, or should I be looking for a different kind of tool?
Well, I figured this out by myself eventually. I'm using plain old (GNU) Makefiles.

Graphically laying out wx app

Being really new to wx, I'm wondering if there is an IDE (especially for Linux) which would help me lay out a frame or dialog or whatever just to help me see what I'm doing. That means also creating the code for those changes.
I remember way back when using resource compilers for OS/2 and Windows that produced binaries that would then create the window, and was hoping for something similar (though obviously not binary if wx doesn't support that).
I use wxFormBuilder. It is written in wxWidgets, so it works on Linux quite well. It can generate C++ code or XRC files. Make sure you understand its philosophy, and use it like this:
generate C++ code for the GUI
don't edit the code wxFormBuilder generated, but create new files
in new files, derive new classes from the classes it generated
implement event handlers in you own class (wxFB creates virtual function for each event handler you wish to use)
I usually name the wxFormBuilder generated classes/files like, for example, MainFrameGUI, and one with implementation (derived one in which I write all my code) would be just MainFrame. This enables you to change the visual layout and regenerate C++ files from wxFB at any time without overwriting your code.
DialogBlocks works quite well for me, although sometimes you need to edit the code to fix errors manually. It has a property editor that seems advanced enough.
Just another options is wxGlade. It does not have the that much features as the others mentioned seem to have, but it works just good enough for me to not daring to switch.
I use Code::Blocks IDE from http://www.codeblocks.org which has
- built-in GUI editor
- Cross compilable, so you can use it under Linux, OSX and Windows.
But I still use wxFormBuilder with it instead of built-in wxSmith editor. But they are compatible with internal wxSmith.
For windows you've got "wx-devcpp" which is Blodsheed Dev C++ with some addons providing what you looking for
Here is project page
http://wxdsgn.sourceforge.net/