OCaml Unbound Graphics Module - module

Running
open Graphics;;
in OCaml returns an error, saying it is an unbound module. Running it in terminal (ocaml) returns the same thing.
Does this mean my Graphics Module was somehow not installed with the OCaml package? If so, how can I install the module?
On Fedora.

This error also appears often on Mac OS X. With Homebrew this module is disabled by default on installation, so brew install ocaml will not install the Graphics module, probably due to the XQuartz dependency.
If you run brew info ocaml, it will tell you that there's a flag, namely --with-x11, that will "Install with the Graphics module". So to install/reinstall ocaml you'll have to run:
brew install Caskroom/cask/xquartz
brew [re]install ocaml --with-x11
Finally remember to check that the instance of ocaml that is running is the one in /usr/local/Cellar/objective-caml/x.yy.z[_w]/bin, and if it isn't then prepend that url to your PATH environment variable. Also remember to restart your computer after the XQuartz installation.

Graphics module is not ready by default. You need to load it manually. In toplevel:
$ ocaml
OCaml version blahblah
# #load "graphics.cma";;
# open Graphics;;
or you can specify it at the command line:
$ ocaml graphics.cma
OCaml version blahblah
# open Graphics;;
I do not know about Fedora but if the above fails, graphics is not really installed in your environment.

Related

problems with Arch linux installation commands

It's my first time trying to install and using Arch linux, I was trying to install it in VirtualBox in Mac Os mojave, when i did arch-chroot /mnt(after all the configuration), then tried to nano /etc/locale.conf it just printed command not found.
I've already tried with vim or other commands like sudo or apt to install a plain text editor but it's always the same and I also tried twice but nothing changes.
PLEEAAASE, I need help.
In Archlinux you should use pacman -S to install packages
try this :
"pacman -S nano"
you can see more information here:
https://wiki.archlinux.org/index.php/pacman#Installing_packages
You can install it with the Linux kernel etc.
For installing the kernel you use
pacstrap
so just add nano, vim or whatever text-editor you like to use.
For more information: https://wiki.archlinux.org/index.php/Installation_guide

configure: error: Qtenv cannot find qmake in omnet++ installation

I'm trying to install omnetpp 5.2.1 on windows 10. But getting an error while doing ./configure command related to QT environment. I tried changing the configure.user file in omnetpp package to change the path of QT but still its not working. Here is the error:
configure:error: Qtenv cannot find qmake--maybe it is not in the path
or has some exotic name (tested names were: qmake qmake-qt5 qmake5)-
disabling Qtenv. You can try setting QT_PATH variable in
configure.user to a valid location.
qt5 might not be installed.
sudo apt install qt5-default worked for me while installing on Ubuntu 20.04.
OMNeT++ comes with all dependencies bundled. As long as you have executed the mingwenv.cmd and running from that shell, qmake should be available in the path (in tools/win64/mingw64/bin). Check if qmake.exe is present there. If not, make sure that ZIP file you have downloaded is intact. Standard windows unzip may fail on certain systems...
run ./configure WITH_QTENV = no

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

Could not find module `Test.QuickCheck' on Ubuntu

I'm importing QuickCheck at the top of my file:
import Test.QuickCheck
...
Compiling the file with ghc Lab1.hs gives me this error:
Lab1.hs:1:8:
Could not find module `Test.QuickCheck'
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
I tried an apt-cache search for quickcheck and got a dire list of packages. Tried installing libghc-test-framework-dev just because I thought the name seemed appropriate, but the error persists.
How do I install the QuickCheck module?
If you're interested in managing your Haskell packages outside of your package manager (which may be beneficial if you're interested in using the latest versions of things) then Cabal is the Haskell package manager which would allow you to do
apt-get install cabal-install
cabal update
cabal install QuickCheck
to make QuickCheck available globally.
What's more recommended of late however is to use the sandbox feature of Cabal. This is very similar to Python's virtualenv or Ruby's bundle if you're more familiar with those. To do this, you must create a "cabalized" project
cabal init # in an empty directory
and then put QuickCheck (and your other library dependencies) in the build-depends: slot of the generated <folder name>.cabal file.
After you've done this you use Cabal for all further package management and compilation commands.
cabal sandbox init # creates your local package sandbox
cabal install --only-dependencies # gets and installs all the build-dependencies
cabal repl # starts up GHCi in the local sandbox
cabal build # configures and builds the local project
cabal sandbox delete # cleans up the sandbox
In Ubuntu 14.04.1:
sudo apt-get install libghc-quickcheck2-dev
Before:
> :m +Test.QuickCheck
<no location info>:
Could not find module `Test.QuickCheck'
It is not a module in the current program, or in any known package.
After:
Prelude> :m +Test.QuickCheck
Prelude Test.QuickCheck>

Configuration for Java binding for ZeroMQ (0MQ) with no root privileges on Linux

I am a novice with zeroMQ and I am stuck at binding ØMQ with java on a server running CentOS release 5.9.
Unfortunately, I do not have super user/root privileges on the server and am trying to install ØMQ as a normal user with restricted privileges. I have installed ØMQ by following instructions on http://www.zeromq.org/area:download
Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
Could not run the following obviously
To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.
Then I attempted to install jzmq.
Cloned [git clone https://github.com/zeromq/jzmq.git]
Ran autogen.sh
Ran configure
At this point I get the following error
checking for ZeroMQ... no
checking zmq.h usability... no
checking zmq.h presence... no
checking for zmq.h... no
configure: error: cannot find zmq.h
As a result of the above error I am not able to run java tests and get error "no jzmq in java.library.path".
Can anybody help/direct me to how to get java binding for zeromq work when you dont have root privileges to install it? Its difficult to get IT department to install a new software on servers.
Appreciate your help.
Note: I do not have write permissions to /usr directory
Thanks
GBP
This can be overcome by adding --with-zeromq=/home/user/zeromq (installation directory of zeromq)
./configure --with-zeromq=/home/user/zeromq
Other steps include
export LD_LIBRARY_PATH=/home/user/zeromq/lib
You can also use JeroMQ (https://github.com/zeromq/jeromq) which is a pure Java implementation of ZeroMQ
I got this working by running autogen.sh on OEL 6 then running configure / compiling / installing on CentOS 5.9. I briefly looked into why autogen.sh was failing and the problem was the tool chain was too old. Since I had a more up-to-date system with a modern tool chain available running autogen.sh on something other than CentOS 5 was the easiest path for me. I'm sure it works fine with other modern Linux variants, I had OEL 6 at my finger tips.
I also did not have access to a standard directory for installation. To get that working I added zmq.jar to my class path, and the run-time linker needed to be able to find the zeromq and jzmq run-time libraries.
I faced the same issue on CentOS 6.5 and found that you need to install "gcc-c++" for this to work.
I used the following to install dependencies:
yum -y install jdk zeromq-devel unzip libtool gcc autoconf automake gcc-c++ python
Note that "jdk" comes from our private repository and it's same what can be downloaded from java.com
The following public repositories are installed on server:
atomic
Actually, I ended up having this same issue, and the following script worked for me, where I installed zeromq into ~ (so that I have ~/lib contains libzmq.a libzmq.la libzmq.so libzmq.so.3 libzmq.so.3.1.0 pkgconfig)
./autogen.sh ./configure --prefix=$HOME \ #because you don't have root privileges
--with-zeromq=$HOME --includedir=$HOME/include/ --libdir=$HOME/lib/
./make
./make -n install
#to check to see if it installs it to the right location
make install