flexdll error with ocaml on cygwin - cygwin

I just did a fresh install of cygwin64 on windows 10.1.
I installed ocaml package (4.02.3) from the cygwin repository.
I have strange errors related to flexdll :
$ ocaml
OCaml version 4.02.3
#load "str.cma";;
Cannot load required shared library dllcamlstr.
Reason: /usr/lib/ocaml/stublibs/dllcamlstr.so: flexdll error: cannot relocate RELOC_REL32, target is too far: 0xfffffffc12c2a92a 0x12c2a92a.
Do you know what the problem is and how to circumvent it ? In fact, I encountered a similar issue while trying to compile findlib on cygwin from sources.
Best regards,
François

François,
I faced the same problem when trying to compile findlib under cygwin. I was using cygwin's package for ocaml.
My solution has been to uninstall the ocaml package(s) from cygwin, then download and compile ocaml from sources (that is version 4.03.0, instead of 4.02.3 packaged with cygwin), using the following to have the installation replace cygwin's ocaml software:
./configure -prefix /usr -no-curses
make world.opt
make install
Once ocaml installed from sources, configure and build findlib is successful:
cd findlib-1.7.1
./configure
make all
make opt
make install
I hope that helps,
David.

Related

Configuration of LLVM for Haskell on M1 Mac

I installed Haskell on an M1 Mac following the official guide. During the installation, the following message was prompted:
System requirements
Note: On OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.
On Darwin M1 you might also need a working llvm installed (e.g. via brew) and have the toolchain exposed in PATH.
I additionally installed LLVM using homebrew:
brew install llvm#12
When trying ...
ghc --make <file>
... I get the following error message:
<no location info>: error:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt
How can I fix that? Or how can I go about the "have the toolchain exposed in PATH" part of the alert? I'm using ZSH, in case this is of relevance.
Probably not the best solution, but I got it working by adding /opt/homebrew/Cellar/llvm#12/12.0.1_1/bin to the PATH variable.

How to fix error: Cygwin gcc cannot be used with --compiler=mingw32

I'm trying to install this project: https://github.com/drufat/triangle. Unfortunatly, I get the following error:
error: Cygwin gcc cannot be used with --compiler=mingw32
I'm using the lastest version of gcc for Cygwin on Windows 7 64 bit and I'm trying to install that project for python 3.7.1. It's seems to come from my distutil configuration. My distutils.cfg file contains:
[build]
compiler=mingw32
I tried that solution but it doens't helped:
https://stackoverflow.com/a/16740123/5075502
The gcc options to build for MinGW64 is no longer supported by the regular cygqin compiler gcc, aka x86_64-pc-cygwin-gcc. Instead, you should also install the mingw64-x86_64-gcc-core package which provides the GCC for Win64 toolchain (C, OpenMP). This will also install other packages (through dependencies) which provide compatible binutils, headers, libraries, and runtime.
In your Makefile or compiler command line, replace gcc with x86_64-w64-mingw32-gcc. This will allow you to compile and link executables which do not depend on the cygwin1.dll.
A similar problem occured. I fixed it by changing mingw32 by gcc like #phd said.

problems building CodeLite

Having a heck of a time trying to build CodeLite for an ARM-based Ubuntu Linux target. (Build instructions here: http://codelite.org/Developers/Linux). I get an error from CMAKE that says Could not locate GTK2. Looking in the CmakeLists.txt file I can see that this is a result of find_package(GTK2) failing to find GTK2. I think I have installed gtk according to what the CodeLite build instructions say to do using the command sudo apt-get install libgtk2.0-dev.
In terms of cmake, I don't understand what a "package" is. How would I [manually] locate this package on my filesystem and how do I get cmake to find it?
For my aarch64 ubuntu 17.04, the libraries and headers were under /usr/lib/aarch64-linux-gnu, so invoking cmake with them produced the correct build files:
cmake -DCMAKE_INCLUDE_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1

How to install wxHaskell on Windows with MinGW/MSYS

I was trying to install wxHaskell into a machine running Windows XP64, with MinGW/MSYS and wxWidget 3.0 built from source using gcc. I did:
cabal install wx
and got an error:
...
Configuring wxc-0.90.0.4...
setup.exe: wx-config: does not exist
Failed to install wxc-0.90.0.4
cabal.exe: Error: some packages failed to install:
wx-0.90.0.1 depends on wxc-0.90.0.4 which failed to install.
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.90.0.3 depends on wxc-0.90.0.4 which failed to install.
I had successfully used wxWidgets to write an sample application in C++ (gcc). So I do have a working wxWidget installation. And I have wx-config at:
$ which wx-config
/usr/local/bin/wx-config
The problem is that wx-config is a unix shell script, and cabal (called from MSYS) somehow refuses to recognize it even if it's on the system path. If I run wx-config in MSYS, I get something like:
$ wx-config --cxxflags
-I/usr/local/lib/wx/include/msw-unicode-3.0 -I/usr/local/include/wx-3.0 -D_LARGE
FILE_SOURCE=unknown -DWXUSINGDLL -D__WXMSW__ -mthreads
I have asked a question https://stackoverflow.com/questions/21998763/how-to-convert-msys-shell-scripts-to-windows-exe-files to see if it's possible to convert the script to an exe, but no one responded with any solutions.
There is also a related question here, wxHaskell installation on windows , and another here wx 0.90.0.1 fails to install on Haskell Platform 2012.2.0.0 (WinXP). In fact, I couldn't found an answer that's confirmed to work. Also, the errors/settings here seem to be different, or the answers therein don't seem solve my problem. In particular, I downloaded an external wx-config.exe from https://sourceforge.net/projects/wxhaskell/files/wx-config-win/ per http://www.haskell.org/haskellwiki/WxHaskell/Windows. But running wx-config.exe can't recognize my wxWidget installation and always gives me an error about cannot find wxWidgets, like this:
$ ./wx-config.exe --prefix=/usr/local/
wx-config Error: wxWidgets hasn't been found installed at 'C:\MinGW\msys\1.0\loc
al'.
Please use the --prefix flag (as in wx-config --prefix=C:\wxWidgets)
or set the environment variable WXWIN (as in WXWIN=C:\wxWidgets)
to specify where is your installation of wxWidgets.
Any idea how to work around this issue?
Thanks,
-- Update --
#JP I tried:
C:\temp\wxdirect-0.90.0.1>runhaskell Setup configure --extra-lib-dirs=c:\MinGW\lib --extra-include-dirs=c:\MinGW\include --extra-include-dirs=c:\MinGW\msys\1.0\local\include
Configuring wxdirect-0.90.0.1...
and got
Setup: At least the following dependencies are missing:
containers >=0.2 && <0.5, strict -any
I tweaked wxdirect.cabal to bypass containers >=0.2 && <0.5, but can't get pass strict.
I've written a powershell script that automates the setup of MinGW and the downloading/building of wxWidgets in order to build wxHaskell for Windows 7.
https://github.com/cessationoftime/wxHaskell-Windows-Builder

Linux software installation - override version of library in ./configure

I'm trying to install the software TinyOWS on a Linux computer. The source code is written in C programming language. I don't have much experience with installing C or C++ programs from source code on Linux. I read installation instructions, and it says that I must follow 3 steps after I unzip the source code folder:
./configure
make
make install
When I run ./configure, I get the following error:
checking for xml2-config... /usr/bin/xml2-config
checking for libxml2 version... 2.7.6
configure: error: You need at least libxml 2.8.0
This means that the software being installed requires version 2.8.0 of a library called libxml2 but my computer only has the 2.7.6 version. Unfortunately I found out that I cannot easily install the libxml 2.8.0 on my Linux distribution. The reason why the software TinyOWS that I'm trying to install requires libxml2.8.0 of the library is because libxml2.7.6 has a small bug. But most of the functionality of the software is not affected by the bug.
So, here is my question:
What files do I have to edit or what command line options do I need to use If I want the ./configure command to use the library libxml2.7.6 instead of libxml2.8.0?
Get the source, in the file configure.in replace the line:
AC_MSG_ERROR([You need at least libxml 2.8.0])
By
AC_MSG_NOTICE([You need at least libxml 2.8.0])
Then, do:
autoreconf -f -i -s
./configure
make
The configure step will not stop. But i think if the developpers have restricted this version of libxml2 there must be a good reason.

Resources