How to build Courguette in Debian - compilation

Right now I am trying to compile Courguette in order to generate a diff patch. The source and some documentation can be found in the following link:
Courguette
I downloaded it but I don't find the way of compiling it.
I have Googled and found some references even to this forum, such as:
StackOverflow link
And other references:
Chromium Linux build instructions
After reading things about ninja and gpy I decided to install them, but there are not references to a .ninja file. I find a courguette.gyp file but using gpy I neither get it compiled...
I am following the guide they provide:
Installed the depot_tools and added to the path.
gclient runhooks
gclient sync
And when I execute gn gen out/Default it fails with the following message:
gn.py: Could not find gn executable at: ~/binary_diff_tools/courgette-master/courgette/buildtools/linux64/gn
Then I used git to pull from the repository the buildtools, but I get the same result.
Any help will be appreciated.
Best regards,
Iván

Ok... It seems that is needed to install all Chromium dependencies before being able to compile courgette so... it must be done as follows:
Install depot_tools git clone and you will have them installed.
After including the depot_tools in your patch (.profile or .bashsrc for example as indicate the depot_tools installation tutorial) execute fetch chromium ouside the depot_tools folder ( it always failed me when I executed it inside the same folder).
I want to build it in Debian so I have to do "gclient runhooks" instead of the .sh script for Ubuntu.
ninja -C out/Default courgette
You will find the executable in the folder out/Default, so ./courgette and it will indicate you the right parameters in order to generate your patch properly.
Best regards,
Iván.

Related

Error in pkg-config when try to download git repository

I was trying to make a facial recognition app using Go and Kagami/go-face repository. It requires dlib-models. And I was used MSYS tool for get the distribution in windows.
But when I try to get the go repository using go get github.com/Kagami/go-face command and it gives an error:
# pkg-config --cflags -- dlib-1
Any one had this issue before in windows 10.
As commented, the README lists the Windows pre-requisites, involving MSYS2.
This was from commit 968bbf9, following issue 5 "Windows support?"
Another approach would be to use Docker, with an Ubuntu image, which would come with dlib, where you can add Go and experiment there.
I also faced the same problem. pkg-config.exe will be found in the path:
C:\msys64\mingw64\bin
if you installed MSYS2 on default path. Export
C:\msys64\mingw64\bin
this path to environment variable then you wont get that error.

How to fix "-bash: bazel: command not found" when running "bazel build //src:bazel" from windows

Hi I downloaded the last release of bazel 0.24.1 for windows and I did the same instructions But, when I run
./compile.sh
It shows the error as mentioned and I tried bazel build //src:bazel but it didn't work to it shows me
-bash: bazel: command not found
after searching I tried : bazel --output_user_root=c:\tmp build //src:bazel.exe
but the same error
-bash: bazel: command not found
Ps: I run it from msys64 any suggestions please thanks a lot for reacting
./compile.sh
🍃 Building Bazel from scratch ERROR: Must specify PROTOC if not
bootstrapping from the distribution artifact
-------------------------------------------------------------------------------- NOTE: This failure is likely occuring if you are trying to bootstrap
bazel from a developer checkout. Those checkouts do not include the
generated output of the protoc compiler (as we prefer not to version
generated files)
.
To build a developer version of bazel, do
bazel build //src:bazel
To bootstrap your first bazel binary, please download a dist archive from our release page at
https://github.com/bazelbuild/bazel/releases and run compile.sh on
the unpacked archive.
The full install instructions to install a release version of bazel
can be found at https://docs.bazel.build/install-compile-source.html
For a rationale, why the bootstrap process is organized in this way,
see https://bazel.build/designs/2016/10/11/distribution-artifact.html

Installing liblapack without root permissions? (Trying to get Armadillo/Lapack/Blas working)

I'm trying to install Armadillo (and thus also BLAS and LAPACK) on a linux server for which I do not have root permission. I have jumped through a few of the first hurdles, but I am getting an error:
/usr/bin/ld: cannot find -llapack
This question addresses the same problem, with the solution being to install
liblapack-dev
liblapack3
libopenblas-base
libopenblas-dev
The problem is the only way I've found to do this online is by doing something like sudo-aptget install or yum install. Both are not allowed on the server I use. I can download binaries and install them locally - that is it.
My question is: how can I install these packages without the above permissions and get on my way to using Armadillo?
I'm using Centos linux, if it helps.
Since you do not have root permissions, the best way is to download and build LAPACK and BLAS. You can download the source code from netlib.
Description of installation instructions can be found here and here.
The basic steps are:
Unzip and tar the file.
Copy and edit the file LAPACK/make.inc.example to LAPACK/make.inc.
Edit the file LAPACK/Makefile
type make.
Similarly you can download and build BLAS.

Golang zmq binding, ZMQ4, returns package error not finding file zmq.h

I am trying to include ZMQ sockets in a Go app but both zmq4 and gozmq (the referred ZMQ binding libraries for Go) are giving me problems. I would like to understand why zmq4 specifically isn't importable on my system.
I am running a Windows 8 system and I used the windows installer from the ZMQ website for version 4.0.3. I am primarily concerned about getting zmq4 set up and here is the result of my "go get" query on the github library's location:
> go get github.com/pebbe/zmq4
# github.com/pebbe/zmq4
polling.go:4:17: fatal error: zmq.h: No such file or directory
compilation terminated.
This issue is not alleviated by cloning the Github repository - the error remains the same.
I know the issue has to do with the C library zmq.h that is located in the "include" folder of my ZMQ installation, but whether the dependency is held up by a pathing issue or an external tool issue is a mystery to me.
A similar error has come up in regards to node.js and is the solution I see others referred to, outside of node scripting, but it was unsuccessful in my case.
I've so far included the path to the "include" folder in my PATH environment variable and previously placed zmq.h inside of the zmq4 top-level folder. I don't have much of an arsenal otherwise to understand this problem because I am new to C and C-importing packages in Go
I wanted to do the same thing, but on Windows 7, and here is what I had to do.
Since the Go bindings are using cgo to integrate with zeromq, you need zeromq built with gcc. There are no pre-built binaries, so you'll have to build them yourself, with mingw or similar, but this process is easier than it may sound, and nicely described on the zeromq site.
As #photoionized pointed out, C_INCLUDE_PATH and LIBRARY_PATH need to be set when building the Go bindings.
(In my case, I ran into a problem when compiling libzmq with IN6_ADDR not being defined. The only solution I found was, inspired by this issue, to manually add the line #include <in6addr.h> to the windows.hpp file.)
The Windows installer version of ZeroMQ won't work with zmq4, you need to compile from source with gcc, I recommend using MSYS2.
Install and update MSYS2 following the instructions from
http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
Start the mingw32_shell.bat or mingw64_shell.bat based on Go arch (32bit or 64bit)
pacman -S mingw-w64-(x86_64|i686)-toolchain make (x86_64 for 64bit, i686 for 32bit)
cd into zeromq src folder (C:\ path starts with /c/ inside the shell)
./configure
make
make install
CGO_CFLAGS=-I/usr/local/include CGO_LDFLAGS=-L/usr/local/lib go get github.com/pebbe/zmq4
Copy the following dlls and put them next to your go program (.exe):
/usr/local/bin/libzmq.dll
/mingw(32|64)/bin/libgcc*.dll
/mingw(32|64)/bin/libwinpthread*.dll
/mingw(32|64)/bin/libstdc++*.dll
Here's updated steps for #user2172816's MSYS2 solution:
Install and update MSYS2 following the instructions from http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
Start the mingw32_shell.bat or mingw64_shell.bat based on Go arch (32bit or 64bit)
pacman -S mingw-w64-(x86_64|i686)-toolchain make (x86_64 for 64bit, i686 for 32bit)
Add C:\msys64\mingw64\bin to your Path (pkg-config is there)
Restart the msys2 shell to get the new Path
Download and unzip libsodium source: https://github.com/jedisct1/libsodium/releases
cd into libsodium folder (C:\ path starts with /c/ inside the shell)
./configure --build=(x86_64|i686)-w64-mingw32
make
make install
Add /usr/local/lib to PKG_CONFIG_PATH (export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig)
cd into zeromq src folder
./configure --build=(x86_64|i686)-w64-mingw32
Add
#ifdef ZMQ_HAVE_MINGW32
#include <winsock2.h>
#include <windows.h>
#include "netioapi.h"
#endif
To the top of src/tcpaddress.cpp
make
make install
CGO_CFLAGS=-I/usr/local/include CGO_LDFLAGS=-L/usr/local/lib go get github.com/pebbe/zmq4
CGO_CFLAGS=-I/usr/local/include CGO_LDFLAGS=-L/usr/local/lib go build in your project directory
Copy the following dlls and put them next to your go program (.exe):
/usr/local/bin/libzmq.dll
/mingw(32|64)/bin/libgcc*.dll
/mingw(32|64)/bin/libwinpthread-*.dll
/mingw(32|64)/bin/libstdc++*.dll
/usr/local/bin/libsodium-*.dll
maybe? /usr/local/bin/libsodium-*.def
An updated answer using MSYS2.
Install MSYS2 MSYS2 installation guide.
Make sure to choose the correct installation 32bit or 64bit.
Open the appropriate shell MSYS2 MinGW 64-bit or MSYS2 MinGW 32-bit. All further steps assume you are using this shell.
Update packages following instructions at the installation guide.
Install libtool pacman -Sy libtool.
Download zmq source code to a location of your choice.
Navigate to the zmq source folder.
To generate the configure file, run the autogen tool by running ./autogen.sh.
In the probable case that step 8 fails:
Find the file at fault (probably version.sh).
Replace line endings by (replace file by the actual filename).
cp file file.bak
tr -d '\r' <file.bak> file
If this fails you'll have to dive in the code and find the problem.
Run the configure tool ./configure.
In the probable case of failure. Comment out empty else clauses in the configure file.
Add Go to Path: PATH=${PATH}:<go bin directory>.
Install Go Package: CGO_CFLAGS=-I/usr/local/include CGO_LDFLAGS=-L/usr/local/lib go get github.com/pebbe/zmq4
To install ZMQ in windows: Problem in Installing Golang ZMQ for windows - fatal error: czmq.h: No such file or directory
First of all, install the msys64. Download the software from https://www.msys2.org/ and install it on C:\msys64.
Then add C:\msys64\mingw64\bin to PATH environment variable of the windows.
Then run the following commands (in CMD) one by one.
pacman -Su
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S base-devel gcc vim cmake
pacman -S mingw-w64-x86_64-libsodium
pacman -S mingw-w64-x86_64-zeromq
Finally, run the Go install command:
go get github.com/pebbe/zmq4
Finished.

mvn and the make package error

OK. Here's the problem and it's driving me crazy!!!
I followed the instruction online, installed hadoop and when running the text it said snappy local library can't be loaded.
It's said I have to install snappy first and then install hadoop-snappy.
I download snappy-1.0.4 from google code and do the following:
cd ../snappy-1.0.4
./configure
make
sudo make install
Then it's the problem when:
mvn package -Dsnappy.prefix=/usr/local
The post online said by default the snappy should be installed in the /usr/local.
But I got the following error and no matter what I change the path, still get erro:
The goal you specified required a project to execute but there's no POM in the directory. Please verify you invoked the maven from the correct directory.
It's the wrong directory of mvn? Or improper of snappy? And it said lack of pom that should be a .xml that in no where I can find..
Please help!
Alright, so looking at that page, you are in the wrong directory.
The directory you should be in for that step is "hadoop-snappy" which you can see has a pom.xml, you can verify by looking at the github, https://github.com/electrum/hadoop-snappy.
So after you follow these steps from the guide you showed me.
Download it(hadoop-snappy) from GitHub
Install libtool, make sure ‘libtoolize’ works
Install Maven 3 if necessary
Change your directory to hadoop-snappy and run the command you were trying before.

Resources