How can I generate a console-less program in ocaml? - console

I'm trying to make a Ocaml graphics program in Windows, but I cannot generate it without the console window.
The correct command should be:
ocamlopt -o test.exe -ccopt "-subsystem console" graphics.cmxa test.ml
However I receive the following error :
ld: cannot find -lcomdlg32
** Fatal error: Error during linking
Im' working on windows 10, 64 bits, having installed 32 bit ocaml
ocpwin32-20160113-4.02.1+ocp1-mingw32
(Just to be able to use also ocaml-top, that comes only in 32 bit version).
Any suggestion ?

Related

M1 Silicon gfortran c++ in R install issues

I bought an M1 Silicon with Monterey back in January and --- after a three+ month pause -- am trying again to get Rcpp running so I can install RStan. Following these instructions in response to (I'd like to just comment on this other issue, but being new to posting on Stack Overflow it tells me that I cannot and what I am about to post is certainly NOT an answer):
Configuring compilers on Mac M1 (Big Sur, Monterey) for Rcpp and other tools
While step 3 (installing gfortran) looks to go well, when I ask about gfortran things seem less hopeful:
-bash: gfortran: command not found
Or maybe this is not how to ask if all went well with the installation?
No matter, I charge on to step 4 installing from openmp-13.0.0-darwin21-Release.tar.gz based on:
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I confirm that I have the files where expected, then create the .R directory and the Makevars file (in nano) then try to run the R and get ....
+ #endif
+ }
+ ')
/Users/lizzie/.R/Makevars:6: *** missing separator. Stop.
Error in Rcpp::sourceCpp(code = "\n#include <RcppArmadillo.h>\n#ifdef _OPENMP\n# include <omp.h>\n#endif\n\n// [[Rcpp::depends(RcppArmadillo)]]\n// [[Rcpp::export]]\nvoid omp_test()\n{\n#ifdef _OPENMP\n Rprintf(\"OpenMP threads available: %d\\n\", omp_get_max_threads());\n#else\n Rprintf(\"OpenMP not supported\\n\");\n#endif\n}\n") :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install Command Line Tools for XCode (or equivalent).
Any thoughts or ideas much appreciated. Again, I am new to posting to StackOverflow so apologize as I am sure I am doing this wrong.

Windows Subsytem for Linux - running applications that use openGL

I am able to run a number of GUI applications successfully on windows subsystem for linux (WSL), Ubuntu 14.04.4 LTS, using X-forwarding (via MobaXterm).
I recently tried to run an application that uses OpenGL. Although the GUI opens, there are a number of errors and some aspects of the GUI don't work properly. The errors are:
QT error: 1
QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7f88e21d9ba8>
QT error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
libGL error: failed to load driver: swrast
I can get rid of the swrast error by setting export LIBGL_ALWAYS_INDIRECT=1 but the other errors remain:
QT error: 1
QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7fed3689e828>
QT error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
A typical error when attempting to use part of the GUI is:
WARNING: QT error: 1 (Gui.qtMessageHandler:51)
WARNING: QT error: <PyQt5.QtCore.QMessageLogContext object at 0x7f9b35e7b6d8> (Gui.qtMessageHandler:51)
WARNING: QT error: QOpenGLWidget: Failed to make context current (Gui.qtMessageHandler:51)
I can run glxgears, but I realise this only checks a fraction of OpenGLs functions. If I run glmark2 I get the following:
glmark2
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
Error: Glmark2 needs OpenGL(ES) version >= 2.0 to run (but version string is: '1.4 (4.0.0 - Build 10.18.10.4358)')!
Error: main: Could not initialize canvas
If I run find /usr -iname "*libGL.so*" -exec ls -l -- {} + suggested on this link https://askubuntu.com/questions/541343/problems-with-libgl-fbconfigs-swrast-through-each-update I get the following output but I'm not sure if this indicates an error or not?
lrwxrwxrwx 1 root root 14 Jan 12 2016 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 413968 Jan 12 2016 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
Running glxinfo seems to indicate the on-chip graphics card is used (there is a separate AMD graphics card but I don't think it's necessary to use that).
glxinfo | grep render
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
OpenGL renderer string: Intel(R) HD Graphics 4000
How can I successfully run OpenGL applications via WSL?

Error in installing nachos 4.0 c++ version

I have been trying to install nachos 4.0 (c++ version), but on running the "make" command, I get the following error:
gcc -E -I../userprog -I../threads start.cc > _/strt.s
mips-xgcc/as -mips2 -o _/start.o /strt.s
make[1]: execvp: mips-xgcc/as: Permission denied
make[1]: * [/start.o] Error 127
make: * [all] Error 2
I also tried giving all the permissions to the mentioned folder (mips-xgcc), but to no avail.
Also I had doubts regarding running user-processes. There is a sample code in the test folder, which performs matrix multiplication. To run this program one needs to convert the binary which is .coff format to .noff format (where .coff is the format of any a.out file in linux). My doubt is that since the example code contains statements which are peculiar to the MIPS architecture (e.g: Exit(C[Dim-1][Dim-1]) in "matmult.c"), how can we first compile the program as normal gcc and then use coff2noff to convert it into ".noff" format.
Is it possible that user-level process doesn't run because of the error mentioned in "1."
Any help would be appreciated.
Thank You

errors while installing frama-c in cygwin

I am trying to install frama-c in cygwin and get the following errors but I can't interpret them. Can you help me interpreting them or give me a link to where I get the information?
Preparing Wp-Coq Sources
Uncaught exception: Util.UserError("_", _)
Makefile:49: recipe for target `depend' failed
make[1]: *** [depend] Error 2
src/wp/Makefile:285: recipe for target `.make-wpcoqs' failed
make: *** [.make-wpcoqs] Error 2
note that coqc and ocaml are both the latest version
Are you using Coq 8.4 by any chance? I had something very similar happen to me, and my issue was the lack of the option -coqlib <your Coq installation directory> when Coq is not installed in the standard directory in the PATH. There used to be a specific error message in Coq 8.3, but it seems to have disappeared in Coq 8.4.
If you can find the line in the Makefile which runs the coqdep command, and replace it with something like coqdep -coqlib ~/coq84pl1 (replacing ~/coq84pl1 with your Coq installation directory), it could work. But you would also need to add this flag to other Coq-related commands as well (coqc, for instance) or other issues might come up later.

pyside show.ui > showGui.py error: No module named pkg-resources (Windows 7 64 bit)

I am trying to convert an .ui-file into a .py-file and it does not find the module named above in the title.
Information about my setup (perhaps here is the problem?):
C:\Entwicklung\Python33 <== Python v.3.3.0, 64 bit
C:\Entwicklung\Python33... <== with pyside v.1.1.2, 64 bit (IDLE from Python33 can find pyside correct)
C:\Entwicklung\Qt\Qt5.0.2 <== Qt 5.0.2-mingw47_32-x86-offline, 32 bit
(I used 32 bit for Qt because i hoped, there was the Qt-Designer included... but no.. where is the designer, by the way?)
With the commandline cmd i navigated into the folder
C:\Entwicklung\Python33\Scripts where the pyside-uic.exe is placed, and also put my show.ui-file into this folder. then i've ran
"pyside-uic.exe show.ui -o showGui.py" and the error shown in the title occured!
What did I do wrong?
You need to install the distribute package.
Download and run distribute_setup.py [python-distribute.org/distribute_setup.py]:
python.exe distribute_setup.py

Resources