how to build hxselect with mingw? - html

I downloaded html-xml-utils-6.5.tar.gz and started compiling hxselect.c with mingw. I need a makefile, but the package is designed to generate the makefile. The build instructions are in a configure script, config.h.in file and makefile.in.
Is there a mingw-compatible tool to help generate the makefile? I am considering making a linux machine so I can run the configuration to get the generic makefile, and then bring that back for mingw to start chewing on...
Is there an easier way?
Thanks !

Assuming you've downloaded and installed mingw from [1], launch the MinGW Shell
from the start menu and then cd to directory containing the configure script and proceed as you typically do with autotools based projects:
./configure
make
make install
The purpose of MinGW is in fact to make available to Windows a minimalistic GNU environment (meaning shell and other tools) which allow you to work (mostly) as you would in an operating system with a full-fledged GNU userland (such as GNU/Linux). Occasionally it seems that MinGW is used to denote the windows port of the gcc compiler, but it should be empathized that MinGW actually denotes the Windows port of a (minimalistic) GNU environment.
[1] http://www.mingw.org/

Related

nvcc not found but cuda runs fine?

I was trying to run nvcc -V to check cuda version but I got the following error message.
Command 'nvcc' not found, but can be installed with:
sudo apt install nvidia-cuda-toolkit
But gpu acceleration is working fine for training models on cuda. Is there another way to find out cuda compiler tools version. I know nvidia-smi doesn't give the right version.
Is there a way to install or configure nvcc. So I don't have to install a whole new toolkit.
Most of the time, nvcc and other CUDA SDK binaries are not in the environment variable PATH. Check the installation path of CUDA; if it is installed under /usr/local/cuda, add its bin folder to the PATH variable in your ~/.bashrc:
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
You can apply the changes with source ~/.bashrc, or the next time you log in, everything is set automatically.
As #pQB and #talonmies above mentioned you only need to install the GPU drivers (Versioned 430-470 these days) to use PyTorch. If you are using your GPU display port you should be fine.
For Cuda compilation tools you need to install the whole toolkit, which includes the driver as well. If installing manually from CLI the downloaded file, CLI will give you the option to choose the components to install or skip.
Generally, it is recommended to install the compilation tools (which are system wide) and GPU drivers together because it avoids compatibility issues.
Append:
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
to
~/.bashrc
Note: your path to cuda may include a version so navigate to /usr/local/ and check for cudaXX.XX and modify the command to point to that in ~/.bashrc

How do I make Octave see installed Shogun libraries in Ubuntu 16.04?

I copied the commands (from these instructions: http://www.shogun-toolbox.org/install#ubuntu) into the terminal and they seem to have worked, but there is no documentation on how to make Octave find the libraries. I have tried modshogun and init_shogun but Octave cannot find them. I do have the libraries in usr/lib, and I have put that directory on PATH. I have even set usr/lib as my working directory in Octave and that did not help. As far as I have found, there is no Shogun documentation on what to do at this point.
I have also tried compiling Shogun from source, but configure couldn't find GCC. Apparently, this is a known problem with newer versions of GCC. I decided to ask for help with the former method because at least I have the libraries with that.
Edit: I am following the instructions here http://www.shogun-toolbox.org/install#manual-basics
When i do cd build and then "cmake -DINTERFACE_OCTAVE=ON" it tells me there is no cmakelists.txt. There is one in in the above folder, but when I go to that directory and do "cmake -DINTERFACE_OCTAVE=ON" again, it tells me "Shogun can only be built with GPL codes if the source files are in /home/derose/shogun/src/shogun/src/gpl. Please download or disable with LICENSE_GPL_SHOGUN=OFF."
However, when I add -LICENSE_GPL_SHOGUN=OFF as an option, i get the error "CMake Error: The source directory "/home/derose/shogun/src/shogun/-LICENSE_GPL_SHOGUN=OFF" does not exist."
You've linked to the Ubuntu install instructions. From there
These currently do contain the C++ library and Python bindings..
No word that this would include the GNU Octave binding. See below on the same page:
The native C++ interface is always included. The cmake options for building interfaces are -DINTERFACE_PYTHON=ON -DINTERFACE_R .. etc. For example, replace the cmake step above by cmake -DINTERFACE_PYTHON=ON...
So you have to grab the source and fire up cmake with something like -DINTERFACE_OCTAVE=ON
Steps to build the bleeding edge of shogun (the github repo) and the Octave interface:
git clone https://github.com/shogun-toolbox/shogun && cd shogun
git submodule update --init
mkdir build && cd build
cmake .. -DINTERFACE_OCTAVE=ON
make -j4

Make TortoiseHG use my Python installation

I created some python hooks for Mercurial that use some external libraries (namely jira-python). In Linux, I install the packages using pip. In Windows, however, Mercurial comes with a bundled version of Python. My hooks fail when I run them because the external packages are not installed.
I want to make Mercurial / TortoiseHG use my Python installation so I can control its environment. How can I do that?
You can install Mercurial package for Python:
Mercurial 2.4 Python 2.7 package - x86 Windows
Mercurial 2.4 Python 2.7 package - x64 Windows
For TortoiseHG-specific details I can suggest to inspect %TortoiseHg%\library.zip - it contains (some? all?) needed for TortoiseHG|Mercurial Python's modules, which list you can (try) to extend: "in Where is the Python path for TortoiseHG?" topic Steve Borho wrote:
TortoiseHg's entire python environment is contained within the library.zip that comes packaged
with it.
What I suspect you can do is add a line or two to the top of your reviewboard extension file to add your installed python path to sys.path before trying to import simplejson
Hint for adding python path to sys.path is applicable for you too
Recommendation from Convert Extension page
you'll need to use a Mercurial installed on top of a stand-alone Python, and you may also need to do something like
set HG=python c:\Python25\Scripts\hg
to override the default Win32 binaries if you have those installed also
I have Mercurial installed through pip, and I also have TortoiseHg. My system path selects the Python version first.
I renamed C:\Program Files\TortoiseHg\hg.exe to something else, and then ran TortoiseHg. Everything still worked, but I haven't got a good way of verifying it does what you want. You can give it a shot.

How to compile using uclibc?

Hi all I have installed buildroot toolchain and am able to compile simple "Hello World" program which runs on uClibc based chroot. However I am confused how to do so for programs that use ./configure as how to ask it to use the uclibc based toolchain and not the glibc based toolchain present in my system.
My OS is Fedora and it is i386 based machine.I want to compile programs using uClibc for the same platform.
buildroot contains the package directory where there are numerous examples how to do it
Just set CC=PATH_TO_BUILDROOT_UCLIBC_GCC etc.
And you don't need to use chroot:
xxx/buildrootxxx/output/host/bin/xxxxx-gcc works fine, it would search the headers and libs in its own directory (like xxx/buildrootxxx/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/*)

MySQL include files from Cygwin gcc

How can I set up MySQL so that i can have header-files and libraries in my Cygwin gcc C++ builds?
I have seen descriptions on the web, but it seems to refer to stuff I don't have, Like "configure.
(I suspect MySQL has changed their build system).
Using an older version could be an option, but I would prefer to have the same versions as on Linux.
I have a full Cygwin install.
First, what's wrong with just using the Windows version? It works fine.
Then, I've wanted to do the same thing as you, and it can be done. Note that I haven't attempted to build the server; all I was interested in was the MySQL client library so I could do some simple client development in the Cygwin environment.
So what do you have to do in order to build the client library on Cygwin?
First, get the tarball. I used mysql-5.5.13.tar.gz. Unpack it in a suitable location, like /usr/local/src.
Then, install the CMake build system via the Cygwin installer. MySQL has switched from GNU Autotools to CMake. CMake is a meta-build system. It generates Makefiles and other build scripts for specific build environments.
Of course, you also need make and gcc.
I had to apply an innocuous little patch posted on the MySQL forum by one Hiroaki Kawai in order to get the stuff to compile:
Finally, I renamed all dtoa() to _dtoa() in mysql/strings/dtoa.c.
The function is static, and should be safe to be renamed.
You can patch using Perl:
perl -pi.orig -e 's/\bdtoa\b/_dtoa/g' strings/dtoa.c
Then, in the top source directory, type:
cmake .
make mysqlclient
You'll get two static libraries in libmysql/, libclientlib.a and libmysqlclient.a. I don't know that the former is (possibly just a build artefact), but the latter is the real thing.
cp /usr/local/src/mysql-5.5/libmysql/libmysqlclient.a /usr/local/lib/
But it's static, and you likely want a dynamic library. This is where the Cygwin docs come in handy. So:
module=mysqlclient
gcc -shared -o cyg${module}.dll \
-Wl,--out-implib=lib${module}.dll.a \
-Wl,--export-all-symbols \
-Wl,--enable-auto-import \
-Wl,--whole-archive lib${module}.a \
-Wl,--no-whole-archive -lz
That'll create the shared library cygmysqlclient.dll and the import library libmysqlclient.dll.a. Copy both to /usr/local/bin. And that's it.
Here's another question on building the MySQL client library on Cygwin.