Which ghdl (llvm/gcc) and which VUnit are a known good combination? - ghdl

I'm trying to get into the VUnit stuff and have been playing around with some tutorials which worked nicely so far. So, I became curious and found the example array_axis_vcs inside the VUnit GitHub repo. First things first, I cloned the VUnit nightly (02/13/23) and tested the example without any changes to it, using GHDL V1.0.0 which is the Ubuntu 22.04 default version. The result is that the example fails on execution of run.py *.test with the following output:
Starting lib.tb_axis_loop.test Output file: /home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/test_output/lib.tb_axis_loop.test_260bb5c8c675e898eca5dc9024a4420ede12c0bc/output.txt
******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 1.0.0 (Ubuntu 1.0.0+dfsg-6) [Dunoon edition]
Compiled with GNAT Version: 10.3.1 20211117
Target: x86_64-linux-gnu
/home/me/vunit/examples/vhdl/array_axis_vcs/
Command line: /usr/bin/ghdl-mcode --elab-run --std=08 --work=lib
--workdir=/home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/ghdl/libraries/lib
-P/home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/ghdl/libraries/vunit_lib
-P/home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/ghdl/libraries/osvvm
-P/home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/ghdl/libraries/lib tb_axis_loop tb
-gtb_path=/home/me/vunit/examples/vhdl/array_axis_vcs/src/test/
-grunner_cfg=active python runner : true,enabled_test_cases : test,output path : /home/me/vunit/examples/vhdl/array_axis_vcs/vunit_out/test_output/lib.tb_axis_loop.test_260bb5c8c675e898eca5dc9024a4420ede12c0bc/,tb path : home/me/vunit/examples/vhdl/array_axis_vcs/src/test/,use_color : true --assert-level=error Exception SYSTEM.ASSERTIONS.ASSERT_FAILURE raised Exception information: raised SYSTEM.ASSERTIONS.ASSERT_FAILURE :
ortho_code-x86-emits.adb:1724 Call stack traceback locations:
0x7f1b6d0c1542 0x5605bde1ce35 0x5605bde1ede4 0x5605bde1ff55 0x5605bde15a9f 0x5605bde15c4f 0x5605bde08ef8 0x5605bde214df 0x5605be0d0c82 0x5605be0e3957 0x5605be078bd5 0x5605be0e39b2 0x5605be0d1bef 0x5605be0bc882 0x5605be0cddbe 0x5605be0c80a0 0x5605be10db55 0x5605be04c250 0x5605bdf8469e 0x5605be1114b3 0x5605bdd3cb07 0x7f1b6cc43d8e 0x7f1b6cc43e3e 0x5605bdd3b243 0xfffffffffffffffe
******************************************************************
Ok, maybe the pretty outdated GHDL Version is a problem here? Let's try the latest GHDL nightly. Perhaps it's already solved there. That's what I thought and downloaded the latest GHDL nightly to a clean testVM and also downloaded the latest VUnit there.
Different setup, different (more interesting) issues.
VUnit appears to be unable to identify the LLVM backend of ghdl:
me#testVM:~\testprj$ python run.py *test
ERROR - Could not detect known LLVM backend by parsing 'ghdl --version' Expected to find one of dict_keys(['mcode code generator', 'llvm code generator', 'GCC back-end code generator'])
== Output of 'ghdl --version'============================================================
GHDL 3.0.0-dev (2.0.0.r1367.g803edb716) [Dunoon edition]
Compiled with GNAT Version: 10.4.0
llvm 14.0.0 code generator
Written by Tristan Gingold.
Copyright (C) 2003 - 2022 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================================
For my current work, I'll go and try a prebuild docker container now, but I'm still interested in solving this issue. Any ideas? Anybody tried the actual VUnit build against the actual ghdl build? I would be interested if it is a concern on my machine or a more general difficulty. 
Greets Stefan

Related

unknown import: `wasi_snapshot_preview1::sock_setsockopt` has not been defined when running Rust WASI binary

Title says it all - I am attempting to run a very basic Rust program using hyper_wasi, and everything compiles seemingly ok using cargo wasi run. Unfortunately when it actually executes, I get:
Error: failed to run main module `target/wasm32-wasi/debug/<my project name here>.wasm`
Caused by:
0: failed to instantiate "target/wasm32-wasi/debug/<my project name here>.wasm"
1: unknown import: `wasi_snapshot_preview1::sock_setsockopt` has not been defined
Execution environment is a rather older Mac (2013 MBP with Big Sur), clang version:
Homebrew clang version 15.0.3
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
If anyone can point me at what I might be missing I'd appreciate it.

Unable to build Tensorflow from source MacOS High Sierra

I've followed all the steps in the official guide. Except I built it using:
$ bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=- msse4.1 --copt=-msse4.2 --config=opt -k //tensorflow/tools/pip_package:build_pip_package
And during ./config I've set the right paths and disabled Google Cloud Platform, Hadoop, XLA, VERBS, OpenCL, CUDA, MPI support.
Hardware:
Macbook Pro 13 inch (mid 2014)
CPU: Intel Core i5 (4278U)
RAM: 8GB
Software:
High Sierra (10.13.2)
Clang Version: clang-900.0.39.2
Bazel Version: 0.9.0
Conda Version: 4.4.3
Python: 3.6.3
All the packages are upto date. This worked perfectly fine 2 months ago on this machine. For some strange reasons it doesn't build anymore now. I'm just posting a part of the error list here:
WARNING: Config values are not defined in any .rc file: opt
ERROR: Skipping 'msse4.1': no such target '//:msse4.1': target 'msse4.1' not declared in package '' defined by /Users/rakshithgb/Documents/Tensorflow/tensorflow/BUILD
WARNING: Target pattern parsing failed.
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:96:1: First argument of 'load' must be a label and start with either '//', ':', or '#'. Use --incompatible_load_argument_is_label=false to temporarily disable this check.
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:98:1: name 're2_test' is not defined (did you mean 'ios_test'?)
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:100:1: name 're2_test' is not defined (did you mean 'ios_test'?)
And it ends like this:
ERROR: /Users/rakshithgb/Documents/Tensorflow/tensorflow/tensorflow/core/kernels/BUILD:550:1: Target '#local_config_sycl//sycl:using_sycl' contains an error and its package is in error and referenced by '//tensorflow/core/kernels:debug_ops'
WARNING: errors encountered while analyzing target '//tensorflow/tools/pip_package:build_pip_package': it will not be built
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (203 packages loaded).
INFO: Found 0 targets...
ERROR: command succeeded, but there were errors parsing the target pattern
INFO: Elapsed time: 12.763s, Critical Path: 0.02s
FAILED: Build did NOT complete successfully
Has anyone else had this issue? How do I fix it? I've uploaded the entire error log on GitHub Tensorflow issue page. #15622
Ok it looks like the new bazel version isn't compatible with the current Tensorflow release. It looks like the fix will be issued in the next release. According to this thread on GitHub - #15492
The temporary fix that worked for me was to build it using --incompatible_load_argument_is_label=false in the bazel command. So my build command now looks like this:
$ bazel build --config=opt --incompatible_load_argument_is_label=false //tensorflow/tools/pip_package:build_pip_package

GTK2HS fails to install with recent cabal versions

I'm starting a new project that will hopefully use gtk2hs. However, I can not get this package to install on my fairly typical Linux box. Here is the failure :
[1 of 2] Compiling SetupWrapper ( /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs, /tmp/cairo-0.12.4-4201/cairo-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )
/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:94:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32
/tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:95:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/cairo-0.12.4-4201/cairo-0.12.4/SetupWrapper.hs:8:1-32
Failed to install cairo-0.12.4
[1 of 2] Compiling SetupWrapper ( /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs, /tmp/glib-0.12.4-4201/glib-0.12.4/dist/dist-sandbox-58b5f9c6/setup/SetupWrapper.o )
/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:94:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32
/tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:95:45:
Ambiguous occurrence `moreRecentFile'
It could refer to either `SetupWrapper.moreRecentFile',
defined at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:149:1
or `Distribution.Simple.Utils.moreRecentFile',
imported from `Distribution.Simple.Utils' at /tmp/glib-0.12.4-4201/glib-0.12.4/SetupWrapper.hs:8:1-32
Failed to install glib-0.12.4
It seems to be related to recent cabal versions, since that used to work before. It seems to be a known bug (http://trac.haskell.org/gtk2hs/ticket/1292 , http://trac.haskell.org/gtk2hs/ticket/1291 and http://trac.haskell.org/gtk2hs/ticket/1289), however it has not moved for weeks. I am not sufficiently competent to suggest a good fix, so I would like your advice. This is very annoying since I am stuck on this important project, and it pains me to think that the main GUI lib of our language has been broken for many weeks now.
cabal-install version 1.18.0.2 using version 1.18.1.1 of the Cabal library / ghc 7.4.1
Thanks for your help
The correct solution for now is to build from darcs. Detailed instructions are given in the Getting the latest and greatest section of the installation instructions; the short version is:
darcs get --lazy http://code.haskell.org/gtk2hs
cd gtk2hs
sh bootstrap.sh
EDIT: The official 0.12.5 release of gtk2hs from December 2013 supports cabal 1.18, so the above darcs instructions are no longer needed. The full installation instructions are still available from the Gtk2Hs download page; the short version is:
cabal install gtk2hs-buildtools
cabal install gtk gtk3
You can try with older Cabal version using cabal install --cabal-lib-version=1.16.0 gtk.

Undefined "___divmodsi4" linking Monotouch project with static library in release mode

I have a Monotouch project linked to a static library containing C++ modules.
Monotouch version: 3.0.3.5
XCode version: 4.4.1
C/C++ Compiler: Apple LLVM 4.0
When building the project in debug mode for iOS simulator and iOS device everything is OK -
application is linked and runs.
However when building the release configuration for iOS device the following error appears:
Undefined symbols for architecture armv7: "___divmodsi4"
The following line from the static library code somehow causes the trouble:
int number_of_buckets = num_samples / window_samples_step;
If this line is modified as follows the problem disappears:
int number_of_buckets = (int)((float)num_samples / (float)window_samples_step);
Do you have any ideas how to fix the problem without the above modification?
Thanks,
Ury.
This occurs near the end of the build and generally depends on it's original parameters. Try to compare your options between your Release and Debug builds and check that:
you are using the same Additional mtouch arguments on both configuration;
you are using the same compiler, Mono AOT versus LLVM compilers, on both configuration;
you are using the same architecture, ARMv6 versus ARMv7, on both configuration.
Otherwise attach (e.g. preferable to a bug report or pastebin) the full build log (from the Build Output of MonoDevelop's Error Pad) for both Debug and Release builds.
To be more helpful add "-v -v -v" to the Additional mtouch arguments before re-building. This will augment the verbosity (details) about each steps.
You need to set the app's Deployment Target (in the project's options, Build / iPhone Application page) to at least 5.0.

evaluation version of monotouch failing to build to native code

this is Ajit.
I tried downloading the trial version of monotouch from the website but all the links were broken.
So I downloaded the following by digging from google.
()MonoDevelop-3.0.3.5
()MonoFramework-MRE-2.10.9_11.macos10.xamarin.x86.dmg
(*)Monotouch-eval-5.1.0.pkg
but after doing so when I run a sample ios app from the xamarin website only then it fails to build -> not being able to compile to native code.
This is error log.
Building Solution: HelloWorld_iPhone (Debug|iPhoneSimulator)
Building: HelloWorld_iPhone (Debug|iPhoneSimulator)
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG" /t:exe "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Main.cs" "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/AppDelegate.cs" "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/HelloWorld_iPhoneViewController.cs" "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/HelloWorld_iPhoneViewController.designer.cs"
Copying content files
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/57_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/57_icon.png'
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/114_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/114_icon.png'
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/72_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/72_icon.png'
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/29_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/29_icon.png'
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/58_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/58_icon.png'
Copying '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/Images/Icons/50_icon.png' to '/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app/50_icon.png'
Build complete -- 0 errors, 0 warnings
Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign -sim "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -debug -nolink -sdk "5.1" "/Users/PBSK/Desktop/HelloWorld_iPhone/HelloWorld_iPhone/bin/iPhoneSimulator/Debug/HelloWorld_iPhone.exe"
This feature is not supported in the evaluation version
No gcc compiler found!
mtouch exited with code 1
---------------------- Done ----------------------
Build: 1 error, 0 warnings
Xcode version is 4.4 and Mac version is 10.7.4.
-Thanks!
but all the links were broken
Please email support#xamarin.com if you have any issues with the website.
Monotouch-eval-5.1.0.pkg
This is an pretty old, beta version of MonoTouch.
MonoTouch 5.2.12 is the current stable release while 5.3.5 is the current unstable release.
No gcc compiler found
This means no C compiler was found. In general you should make sure your MonoDevelop preferences (SDK Locations) are set the point to your Xcode installation directory.
However in this case I think your MonoTouch version is too old to work with Xcode 4.4. Updating your evaluation version to 5.2.12 is the first step you should try to fix this.
Below is the manual installation for MonoTouch evaluation which FINALLY works!:
Download and install packages listed below, in the order given:
1) Mono: http://download.mono-project.com/archive/2.10.9/macos-10-x86/10/MonoFramework-MDK-2.10.9_10.macos10.xamarin.x86.dmg
2) MonoDevelop: http://download.xamarin.com/monodevelop/Mac/MonoDevelop-3.0.dmg
3) Eval MonoTouch: http://download.xamarin.com/priv/d6d0ad447c01dd2bbbbbba829f6e1a/MonoTouch/Mac-eval/monotouch-eval-5.2.11.pkg
For the above mentioned environment this combination works like magic.
Just hope that they'll fix the broken links on their site too or else many other newbies would continue to get discouraged.
Thanks to support people of Xamarin who shared these links.

Resources